// JavaScript Document
function objectAjax()
	{
	var xmlhttp=false;
	try 
		{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} 
	catch (e) 
		{
		try 
			{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} 
		catch (E) 
			{
			xmlhttp = false;
			}
		}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') 
		{
  		xmlhttp = new XMLHttpRequest();
  		}
  	return xmlhttp;
  	}
	
function moreMinusContent(ID)
	{
	if (document.getElementById('div_more_'+ID).style.display=='')
		{
		document.getElementById('div_minus_'+ID).style.display='';
		document.getElementById('div_more_'+ID).style.display='none';
        $('#subList_'+ID).fadeIn(500);
        }
	else
		{
		document.getElementById('div_more_'+ID).style.display='';
		document.getElementById('div_minus_'+ID).style.display='none';
        $('#subList_'+ID).fadeOut(500);
        }
	//Effect.toggle('subList_'+ID,'appear', { duration: 0.5 });
	//return false;
	}
function moreMinusSubList(ID)
    {
    if (document.getElementById('div_more_'+ID).style.display=='')
        {
        document.getElementById('div_minus_'+ID).style.display='';
        document.getElementById('div_more_'+ID).style.display='none';
        $('#treeList_'+ID).fadeIn(500);
        }
    else
        {
        document.getElementById('div_more_'+ID).style.display='';
        document.getElementById('div_minus_'+ID).style.display='none';
        $('#treeList_'+ID).fadeOut(500);
        }
    //Effect.toggle('subList_'+ID,'appear', { duration: 0.5 });
    //return false;
    }

function moreOffContent(ID)
    {
        document.getElementById('div_more_off_'+ID).style.display='';
        document.getElementById('div_more_'+ID).style.display='none';
        document.getElementById('div_minus_'+ID).style.display='none';
    }
    
function setClassInput(input,status)
	{
	if (status=='ON')
		input.className = 'inputover';
	else
		input.className = 'input';
	}  
function setClassInput3(input,status)
    {
    if (status=='ON')
        input.className = 'input3Over';
    else
        input.className = 'input3';
    }    
function setClassTextArea(input,status)
    {
    if (status=='ON')
        input.className = 'uploadfileOver';
    else
        input.className = 'uploadfile';
    }
function setClassUploadFile(input,status)
    {
    if (status=='ON')
        input.className = 'textareaover';
    else
        input.className = 'textarea';
    }	
function setClassInputLogin(input,status)
	{
	if (status=='ON')
		input.className = 'inputOverl';
	else
		input.className = 'inputl';
	}
function setClassExpanding(input,status)
    {
    if (status=='ON')
        input.className = 'expandingOver';
    else
        input.className = 'expanding';
    }    
    
function verifyContent()
	{
    sw=true;
    if(!is_validate ('col_title', 'text', 'input', 'inputError', true, 'El nombre del contenido es requerido', 'Error de tipo')) sw=false; 
//    if(!is_validate ('col_metatitle', 'text', 'input', 'inputError', true, 'La descripción corta es requerido', 'Error de tipo')) sw=false; 
//    if(!is_validate ('col_metadescription', 'text', 'input', 'inputError', true, 'La descripción corta es requerido', 'Error de tipo')) sw=false; 
//    if(!is_validate ('col_metakeyword', 'text', 'input', 'inputError', true, 'La descripción corta es requerido', 'Error de tipo')) sw=false; 
//    if(!is_validate ('eve_description', 'text', 'textarea', 'textareaError', true, 'La descripción es requerido', 'Error de tipo')) sw=false; 
//    if(!is_validate ('eve_image', 'text', 'uploadfile', 'uploadfileError', true, 'La imagen es requerido', 'Error de tipo')) sw=false; 		}
	if (sw) 
		{
		document.frmContent.submit();
		}
	else
		{
		scroll(0,0);
		}
		
	}

function verifyEvent()
    {
    sw=true;
    if(!is_validate ('eve_title', 'text', 'input', 'inputError', true, 'El título es requerido', 'Error de tipo')) sw=false; 
//    if(!is_validate ('eve_shortdescription', 'text', 'textarea', 'textareaError', true, 'La descripción corta es requerido', 'Error de tipo')) sw=false; 
//    if(!is_validate ('eve_description', 'text', 'textarea', 'textareaError', true, 'La descripción es requerido', 'Error de tipo')) sw=false; 
//    if(!is_validate ('eve_image', 'text', 'uploadfile', 'uploadfileError', true, 'La imagen es requerido', 'Error de tipo')) sw=false; 
    if (sw) 
        {
        document.frmEvent.submit();
        }
    else
        {
        scroll(0,0);
        }
        
    }
    
function verifyBanner()
    {
    
    sw=true;
    if(!is_validate ('ban_title', 'text', 'input', 'inputError', true, 'El nombre del contenido es requerido', 'Error de tipo')) sw=false; 
    if (sw)
    {
      //alert('submit');
      document.frmBanner.submit();
      
    }
    }    

function verifyChannel()
    {
    sw=true;
    if(!is_validate ('cha_title', 'text', 'input', 'inputError', true, 'El nombre es requerido', 'Error de tipo')) sw=false; 
//    if(!is_validate ('cha_logo', 'text', 'uploadfile', 'uploadfileError', true, 'La descripción corta es requerido', 'Error de tipo')) sw=false; 
    if (sw) 
        {
        document.frmChannel.submit();
        }
    else
        {
        scroll(0,0);
        }
        
    }
    
function contentCS(con_uid,status)
  {
//  alert(uidMoney);
//	  alert(columna);
  //donde se mostrará lo resultados
  divx = document.getElementById('status_' + con_uid);
  divx.innerHTML = '<img border="0" src="lib/loading.gif">';
//  alert('hola');
  //instanciamos el objetoAjax
  ajax=objectAjax();
  //uso del medotod POST
  //archivo que realizará la operacion
  //registro.php

  ajax.open("POST", "code/execute/contentCS.php",true);
  ajax.onreadystatechange=function() {
									  if (ajax.readyState==4) 
										{
										//mostrar resultados en esta capa
										divx.innerHTML=ajax.responseText;
									  	}
  									}  
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  //enviando los valores
  ajax.send("con_uid="+con_uid+"&con_status="+status)
  }
function eventCS(eve_uid,status)
  {
//  alert(uidMoney);
//      alert(columna);
  //donde se mostrará lo resultados
  divx = document.getElementById('status_' + eve_uid);
  divx.innerHTML = '<img border="0" src="lib/loading.gif">';
//  alert('hola');
  //instanciamos el objetoAjax
  ajax=objectAjax();
  //uso del medotod POST
  //archivo que realizará la operacion
  //registro.php

  ajax.open("POST", "code/execute/eventCS.php",true);
  ajax.onreadystatechange=function() {
                                      if (ajax.readyState==4) 
                                        {
                                        //mostrar resultados en esta capa
                                        divx.innerHTML=ajax.responseText;
                                          }
                                      }  
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  //enviando los valores
  ajax.send("eve_uid="+eve_uid+"&eve_status="+status)
  }
  function bannerCS(ban_uid,status)
  {
//  alert(uidMoney);
//      alert(columna);
  //donde se mostrará lo resultados
  divx = document.getElementById('status_' + ban_uid);
  divx.innerHTML = '<img border="0" src="lib/loading.gif">';
//  alert('hola');
  //instanciamos el objetoAjax
  ajax=objectAjax();
  //uso del medotod POST
  //archivo que realizará la operacion
  //registro.php

  ajax.open("POST", "code/execute/bannerCS.php",true);
  ajax.onreadystatechange=function() {
                                      if (ajax.readyState==4) 
                                        {
                                        //mostrar resultados en esta capa
                                        divx.innerHTML=ajax.responseText;
                                          }
                                      }  
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  //enviando los valores
  ajax.send("ban_uid="+ban_uid+"&ban_status="+status)
  }

  function channelCS(cha_uid,status)
  {
//  alert(uidMoney);
//      alert(columna);
  //donde se mostrará lo resultados
  divx = document.getElementById('status_' + cha_uid);
  divx.innerHTML = '<img border="0" src="lib/loading.gif">';
//  alert('hola');
  //instanciamos el objetoAjax
  ajax=objectAjax();
  //uso del medotod POST
  //archivo que realizará la operacion
  //registro.php

  ajax.open("POST", "code/execute/channelCS.php",true);
  ajax.onreadystatechange=function() {
                                      if (ajax.readyState==4) 
                                        {
                                        //mostrar resultados en esta capa
                                        divx.innerHTML=ajax.responseText;
                                          }
                                      }  
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  //enviando los valores
  ajax.send("cha_uid="+cha_uid+"&cha_status="+status)
  }
  
  function subList(e)
  {
     switch (e.value)
            {
                default:
                   $('#divwysiwig').fadeIn(500);
                   $('#divaudio').fadeOut(500);
                   $('#divdirectory').fadeOut(500);
                   
            }    
      divx = document.getElementById('divcon_parent2');
      divx.innerHTML = '';
      ajax=objectAjax();
      ajax.open("POST", "code/execute/subListDys.php",true);
      ajax.onreadystatechange=function() {
                                          if (ajax.readyState==4) 
                                            {
                                            divx.style.display='';
                                            divx.innerHTML=ajax.responseText;
                                            }
                                          }  
      ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
      ajax.send("con_uid="+e.value);
  }
  
  function audio(e)
  {
         audioVar = document.getElementById('con_parent').value;
         if (e.value!=0)
         {
         switch (audioVar)
            {
                   case '7':
                       //$('#divwysiwig').fadeOut(500);
                       $('#divaudio').fadeIn(500);
                   break;
                   case '15':
                       $('#divwysiwig').fadeOut(500);
                       $('#divdirectory').fadeIn(500);
                   break;
                   case '333':
                       $('#divwysiwig').fadeOut(500);
                       $('#divdirectory').fadeIn(500);
                   break;
                   default: 
                   $('#divwysiwig').fadeIn(500);
                   $('#divaudio').fadeOut(500);
                   $('#divdirectory').fadeOut(500);
            } 
         } else 
         {
                   $('#divwysiwig').fadeIn(500);
                   $('#divaudio').fadeOut(500);
                   $('#divdirectory').fadeOut(500);

         }
  }
  
 function verifyNews()
    {

    sw=true;
    if(!isValidate ('nel_title', 'text', 'input', 'inputError', true, null, null)) sw=false; 
    if (sw) 
        {
        document.frmNews.submit();
        }
    else
        {
        scroll(0,0);
        }
    }
function newsCS(uid,status)
  {
  divx = document.getElementById('status_' + uid);
  divx.innerHTML = '<img border="0" src="lib/loading.gif">';
  //instanciamos el objetoAjax
  ajax=objectAjax();
  //uso del medotod POST
  ajax.open("POST", "code/execute/newsCS.php",true);
  ajax.onreadystatechange=function() {
                                      if (ajax.readyState==4) 
                                        {
                                        //mostrar resultados en esta capa
                                        divx.innerHTML=ajax.responseText;
                                          }
                                      }  
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  //enviando los valores
  ajax.send("uid="+uid+"&status="+status)
  }

function verifyPress()
    {
    sw=true;
    
    document.getElementById('div_pre_title').style.display='none';
    document.getElementById('div_pre_prc_uid').style.display='none';
    if (document.getElementById('pre_title').value=='')
        {
        document.getElementById('pre_title').className='inputError';
        document.getElementById('div_pre_title').style.display='';
        sw=false;
        }
    if (document.getElementById('pre_prc_uid').selectedIndex==0)
        {        
        document.getElementById('pre_prc_uid').className='inputError';
        document.getElementById('div_pre_prc_uid').style.display='';
        sw=false;
        }
    if (sw) 
        {
        document.frmPress.submit();
        }
    else
        {
        scroll(0,0);
        }
    }

function changeCategoryPress()
    {
    if (document.getElementById('pre_prc_uid').selectedIndex==5)
        document.getElementById("div_thematic").style.display='';
    else
        document.getElementById("div_thematic").style.display='none';
    }
    
    
function pressCS(uid,status)
    {
    divx = document.getElementById('status_' + uid);
    divx.innerHTML = '<img border="0" src="lib/loading.gif">';
    //instanciamos el objetoAjax
    ajax=objectAjax();
    //uso del medotod POST
    ajax.open("POST", "code/execute/pressCS.php",true);
    ajax.onreadystatechange=function() {
                                      if (ajax.readyState==4) 
                                        {
                                        //mostrar resultados en esta capa
                                        divx.innerHTML=ajax.responseText;
                                        }
                                    }  
    ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    //enviando los valores
    ajax.send("uid="+uid+"&status="+status)
    }
function pressCSC(uid,status)
    {
    divx = document.getElementById('status_c_' + uid);
    divx.innerHTML = '<img border="0" src="lib/loading.gif">';
    //instanciamos el objetoAjax
    ajax=objectAjax();
    //uso del medotod POST
    ajax.open("POST", "code/execute/pressCSC.php",true);
    ajax.onreadystatechange=function() {
                                      if (ajax.readyState==4) 
                                        {
                                        //mostrar resultados en esta capa
                                        divx.innerHTML=ajax.responseText;
                                        }
                                    }  
    ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    //enviando los valores
    ajax.send("uid="+uid+"&status="+status)
    }

 function delImg(uid, mdl)
 {
 
  divx = document.getElementById('delImg');
  divx.innerHTML = '<img border="0" src="lib/loading.gif">';
  //instanciamos el objetoAjax
  ajax=objectAjax();
  //uso del medotod POST
  ajax.open("POST", "code/execute/imageDel.php",true);
  ajax.onreadystatechange=function() {
                                      if (ajax.readyState==4) 
                                        {
                                        //mostrar resultados en esta capa
                                        divx.innerHTML=ajax.responseText;
                                          }
                                      }  
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  //enviando los valores
  ajax.send("uid="+uid+"&mdl="+mdl+"&");
  return false;
 }
function delCv(uid, mdl)
 {
 
  divx = document.getElementById('delCv');
  divx.innerHTML = '<img border="0" src="lib/loading.gif">';
  //instanciamos el objetoAjax
  ajax=objectAjax();
  //uso del medotod POST
  ajax.open("POST", "code/execute/cvDel.php",true);
  ajax.onreadystatechange=function() {
                                      if (ajax.readyState==4) 
                                        {
                                        //mostrar resultados en esta capa
                                        divx.innerHTML=ajax.responseText;
                                          }
                                      }  
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  //enviando los valores
  ajax.send("uid="+uid+"&mdl="+mdl+"&");
  return false;
 }