<!--Aca van todos los scripts -->
<!-- Scripts de Texto -->

  bv = parseInt(navigator.appVersion);
  
  if (bv >= 3) ver = "n3"
  else ver = "n2"
	
  function showstatus(text) 
  {
    window.status= text;
  }
  
  function shdefst()
  {
    window.status= 'IceWarp WebMail';
  }
	
  function CheckAll()
  {
    for (var i=0;i<document.main.elements.length;i++)
    {
      var e=document.main.elements[i];
      if (e.name != 'checkall')
        e.checked=document.main.checkall.checked;
    }
  }
	
  function SendForm()
  {
	  document.main.submit();
  }	


function BR(CuadroTexto)
	{
		var varBR1;
		var varBR2;
		varBR = "document._ctl0." + CuadroTexto + ".value = document._ctl0." + CuadroTexto + ".value + '<br>'" ;
		eval(varBR);
	}

function funcKM_InputDefaultText(valor)
	{
		varNA = "document.ctl01.txtAC_page.value = '" + valor + "'";
		eval(varNA);
	}
	
function ChangeValidatorStatus(obj) 
    {
        var enableShip = event.srcElement.status;
        hfIGT_chkFechaExp = enableShip;
        ValidatorEnable(document.getElementById(obj.id), enableShip);
    }	

<!-- Scripts de Ventana -->

function ventana_dataview(Destino)
	{
		window.open(Destino, 'window_dataview', 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=750,height=270, left=100,top=240')
	}

function ventana_open(Destino)
	{
		window.open(Destino, 'windowprocesssmall', 'toolbar=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=510,height=665, left=500,top=50')
	}

function ventana_file(Destino)
	{
		window.open(Destino, 'windowprocesssmall', 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=420,height=400, left=240,top=240')
	}

function ventana_generateId(Destino)
	{
		window.open(Destino, 'windowprocesssmall', 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=420,height=150, left=240,top=240')
	}

function Op_Visita(Destino)
	{
		window.open(Destino, 'addvisita', 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=300,height=80, left=240,top=240')
	}	
	
function cerrar()
	{
		window.close()
		window.opener.location.reload()
	}
		
function cerrar_ventana()
	{
		window.close()
	}	
	
function ventanaScroll_open(Destino)
	{
		window.open(Destino, 'windowprocesssmall', 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=528,height=150, left=240,top=240')
	}	
	
function open_insert_form()
    {
        ventana_open(document.aspnetForm.ddlIGT_InsertSelector.options[aspnetForm.ddlIGT_InsertSelector.selectedIndex].value)
    }
    
function ventana_open_delete(Destino)
	{
		window.open(Destino, 'windowprocesssmall', 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=500,height=120, left=300,top=150')
	}    

function ventana_open_publish(Destino)
	{
		window.open(Destino, 'windowprocesssmall', 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=500,height=145, left=300,top=150')
	} 
	
<!-- Fin Scripts de Ventana -->		

function MM_displayStatusMsg(msgStr) 
	{ //v1.0
		status=msgStr;
		document.MM_returnValue = true;
	}
	
var Open = ""
var Closed = ""
var OpenFile = ""
var ClosedFile = ""

function preload(){
if(document.images){	
	Open = new Image(16,13)    	
	Closed = new Image(16,13)	
	Open.src = "../images/vinetas/open_black.gif"	
	Closed.src = "../images/vinetas/closed_black.gif"
}}

function showhide(what,what2){
if (what.style.display=='none')
{
	what.style.display='';
	what2.src=Open.src;		
}
else
{
	what.style.display='none';
	what2.src=Closed.src;	
}
}

function showhide_dotted(what) {
    if (what.style.display=='none') {
	    what.style.display='';
    }
    else {
	    what.style.display='none';
    }
}

function Hide_obj(obj)
{
    obj.style.display="none"
}

function Show_obj(obj)
{
    obj.style.display=""
}

function Show_menu_obj(obj, sign)
{
    obj.style.display="";
    document.getElementById(sign.id).src=Open.src;		
}

function obj_underline_on(obj)
{
	document.getElementById(obj.id).style.textDecoration="underline";
}		

function obj_underline_off(obj)
{
	document.getElementById(obj.id).style.textDecoration="none";
}

function setmenu_open_elements()
{
    showhide(idspmm1dOutline,idspmm1dSign)
}

function textCounter(theField,theCharCounter,maxChars)
{
	var strGuytyTemp = "";	
	var strGuytyContadorChar = 0;
	for (var i = 0; i < theField.value.length; i++)
	{
		var strChar = theField.value.substring(i, i + 1);
			strGuytyTemp += strChar;
			strGuytyContadorChar ++;
	}
	theCharCounter.value = maxChars - strGuytyTemp.length;	
}

function ValueTextCounter(value,theCharCounter,maxChars)
{
	var strGuytyTemp = "";	
	var strGuytyContadorChar = 0;
	for (var i = 0; i < value.length; i++)
	{
		var strChar = value.substring(i, i + 1);
			strGuytyTemp += strChar;
			strGuytyContadorChar ++;
	}
	theCharCounter = maxChars - strGuytyTemp.length;	
}

function chkBoxSwitchStatus(obj_chkbox, obj_target)
{
    if (document.getElementById(obj_chkbox).checked == true)
    {
        
    }
    else
    {
    
    }

}

function SwitchStatus(FormName,ElementName,Status)
{
    if (status == 'enable')
    {
        document.FormName.ElementName.disabled = false;
    }
    else if (Status == 'disable')
    {
        document.FormName.ElementName.disabled = true;
    }
}

function showColor(val) 
{
document.form1.txtIGT_ColorHex.value = val;
}

function menuGo(target,obj,restore){ //v3.0
eval(target+".location='"+obj.options[obj.selectedIndex].value+"'");
if (restore) obj.selectedIndex=0;
}

/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// onresize for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var cur_lyr;	// holds id of currently visible layer
function swapLayers(id) {
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}