 function openWinPriv(){
	if (document.all)
	{
		var w = 800 - 10;
		var h = 600 - 57;
	}
	else if (document.layers)
	{
		var w = 800 - 10;
		var h = 600 - 57;
	}
	else
	{
		//asume netscape 6
		var w = 800 - 5;
		var h = 600 - 53;
	}
	link = "http://www.citibank.com/privacy/privacy.htm";
	winprops = "height=" + h + ",width=" + w + ",top=0,left=0,scrollbars=yes,resizable=no,toolbar=no,status=yes,menubar=no";
	win = window.open(link, "", winprops)
 }
 function launchPopup(url,title,params){
	
		win = window.open(url, title, params);
	}
 function OpenWin(pais,prod, idio){
 if (document.all)
  {
   var w = 800 - 10;
   var h = 600 - 57;
  }
  else if (document.layers)
  {
   var w = 800 - 10;
   var h = 600 - 57;
  }
  else
  {
   //asume netscape 6
   var w = 800 - 5;
   var h = 600 - 53;
  }
 link = "https://lacb-dis1.citibank.com/esales/";
  winprops = "height=" + h + ",width=" + w + ",top=0,left=0,scrollbars=no,resizable=no,toolbar=no,status=yes,menubar=no";
  ///AGREGADO PARA PROBAR
  ///winprops ="";
  if (idio != null)
   win = window.open(link+"global/index.jsp?pais="+ pais +"&prod=" + prod + "&idioma=" + idio, "", winprops)
  else
   win = window.open(link+"global/index.jsp?pais="+ pais +"&prod=" + prod, "", winprops)
 }

 function openContactForm(){
 	OpenPop("/ids/gohttpsbind.cgi?/us/geb/contactus/main_ct.htm",750,450,"center","center","menubar=0,resizable=0,location=1,status=0,scrollbars=1","Contact_us")		
 }

 function openSurveyForm(){
 	OpenPop("/ids/gohttpsbind.cgi?/us/geb/survey/survey.htm",750,450,"center","center","menubar=0,resizable=0,location=1,status=0,scrollbars=1","Contact_us")		
 }

function pop(URL,w,h){
 		window.open(URL,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width="+ w +", height="+ h +" ");    	
}

//==================================
//Funcion gen?rica para abrir ventanas

	function OpenPop(url,w,h,t,l,param,name)
	{
	//param - Valores para personalizar la ventana.
	var loc = url // URL a mostrar.
	pais = 'citigold'; // Pa?s origen.
	var ancho = w; // Ancho de la ventana.
	var alto = h; // Alto de la ventana.
	var NameW = name; //Nombre de la ventana.
	var arriba = t; //Define el lugar de posisi?n de la ventana en alto.
	var costado = l; //Define el lugar de posisi?n de la ventana en ancho.
	
	var left = Number(screen.width);
	var top = Number(screen.height);

	switch(t){

		case "top":top = 0;break;
		case "center":top = top/2 - (h/2);break;
		case "bottom":top = (top - h) - 90;break;
		default:if(!t){top = 0;}
			 	else{top = arriba;}
				break;
	}

	switch(l){

		case "left":left = 0;break;
		case "center":left = left/2 - (w/2);break;
		case "right":left = (left - w) - 30;break;
		default:if(!l){left = 0;}
		        else{left = costado;}
		        break;
	}

	if(!NameW){NameN = pais+"Pop";}
	if (!param){param = "scrollbars=auto,resizable=yes";}


	/*if(String(loc).indexOf("http://")==-1 && String(loc).indexOf("https://")==-1){
		if (String(location.href).indexOf('WORKAREA')!=-1 || String(location.href).indexOf('STAGING')!=-1){loc = '/'+loc;}
		else {loc = '/'+pais+'/'+loc;}
	}*/

	eval("window.open(loc,'"+NameW+"','width="+ancho+",height="+alto+",top="+top+",left="+left+","+param+"')");

	}


function changeColor(color,objColor){
	objColor.background = color;
}

function changeColorText(color,objColor){
	objColor.color = color;
}

function ChangeLocation(url){
	if (url != "") location.href = url;
}

function getObjPosition(obj){
	ctl = obj;//document.getElementById(id);
	
	aTag = ctl;
	leftpos = 0;
	toppos = 0;
	do {
		aTag = aTag.offsetParent;
		leftpos	+= aTag.offsetLeft;
		toppos += aTag.offsetTop;
	} while(aTag.tagName!="BODY");

	var left =	ctl.offsetLeft	+ leftpos;
	var top =   ctl.offsetTop +	toppos + ctl.offsetHeight + 2;
	position = new Object();
	position.left = leftpos + 165;
	position.top = toppos + 20;
	return position;
}

var netscape = (navigator.appName.indexOf("Netscape") >= 0 && parseFloat(navigator.appVersion) >= 4) ? true : false;
function HideLayer(layer) { if (netscape) document[layer].visibility = "hide"; if (explorer) document.all[layer].style.visibility = "hidden"; }
function ShowLayer(layer,tdObj) {
	pos = getObjPosition(tdObj);
	objLay = document.getElementById(layer);
	objLay.style.left = pos.left - 776;
	if (netscape) document[layer].visibility = "show"; 
	if (explorer) document.all[layer].style.visibility = "visible";
}

function CambiarClass(src,newClass) {
  src.className = newClass;
}
