function popup_home(loc)
{
	window.open(loc,'mundo','top=1,screeny=1,left=1,screenx=1,width=400,height=100,buttons=no,scrollbars=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no');
}

function popup_warning(tar)
{
	window.open('/home/popup/popup_warning.jhtml?tar='+tar,'nick','width=609,height=311');
}

function popup_warningxml()
{
	window.open('/home/popup/popup_warning.jhtml?tar=http://nick.uol.com.br','nick','width=609,height=311');
}

function popup_nickmovilxml()
{
	window.open('/home/nick_movil_popup/popup_warning.jhtml?tar=http://movil.mundonick.com/web/tusdatos.aspx','nick','width=609,height=311');
}

function popup_nino()
{
	window.open('/home/popup/popup_warning.jhtml?tar=http://www.ideastelcel.com','nick','width=609,height=311');
}

// funcion para fotogalerias
function fotogaleria (pathToXML)
{
	var searchText = String(pathToXML);
	
	for (var i=0; i < searchText.length; i++) {
		if (searchText.charAt(i) == '/') {
			var s1 = searchText.substr(0,i) + "%2F" + searchText.substr(i+1, searchText.length);
			searchText = s1;
		} else if (searchText.charAt(i) == '.') {
			var s1 = searchText.substr(0,i) + "%2E" + searchText.substr(i+1, searchText.length);
			searchText = s1;
		} else if (searchText.charAt(i) == '_') {
			var s1 = searchText.substr(0,i) + "%5F" + searchText.substr(i+1, searchText.length);
			searchText = s1;
		}
	} 
	
	window.open('/sitewide/fotogaleria/index.jhtml?xmlToLoad=' + searchText, null, 'width=770, height=505');
}

function newWindow(url,name,features){
	var newWin = window.open(url,name,features);
}

var popSelectCountry = "";
var posicionSup = 50; //posición del menú desde arriba
var tunIex 	= (navigator.appName == "Microsoft Internet Explorer")? true:false;
tunIex			= (tunIex && navigator.userAgent.indexOf('Opera')>=0)? false:tunIex;

function posicion(){
	var elementStyle 	= document.getElementById(popSelectCountry).style;
	var scrollarriba	= document.body.scrollTop;
	elementStyle.top 	= String(scrollarriba) + "px";
	elementStyle.left = "0px";
	elementStyle.height = "100%";
}
function initSelectCountry(elementId){
	popSelectCountry = elementId;
	var elementStyle = document.getElementById(elementId).style;
	if(tunIex){
		elementStyle.position				='absolute';
		popSelectCountry 						= elementId;
		posicion();
		onscroll 										= posicion;
		posicion();
	}else{
		elementStyle.position				=	"fixed";
		elementStyle.top 						= "0px";
		elementStyle.left 					= "0px"; 
		elementStyle.height 					= "100%";
	} 
	elementStyle.paddingTop 		= String(posicionSup) + "px";
	elementStyle.width 						= "100%"; 
	elementStyle.backgroundColor 	= "rgb(0, 0, 0)";
	elementStyle.textAlign 				= "center"; 
	elementStyle.zIndex 					= "99"; 
	changeOpac(70,elementId);
}

function showlayer(elementId)
{
	if(elementId != null)
	{
		var elementStyle = document.getElementById(elementId).style;
		elementStyle.display	= "block";
		var AS = String(escape(location.pathname));
	   AS = (AS == "/" || AS == "/index.jhtml")? "/home": AS;
	   var mymovie = new FlashObject("/sitewide/headerfooter/flash/countryChoice.swf", "countryChoice", "588", "319", "8", "#000000");
	   mymovie.addVariable	("AS", AS);
	   mymovie.addVariable	("version", 1);
	   mymovie.addVariable	("debver", 0);
	   mymovie.addVariable	("country", paramCountry);
	   mymovie.addVariable	("language",paramLang);
	   mymovie.addVariable	("region",paramRegion);
	   mymovie.addParam		("menu", "false");
	   mymovie.addParam		("scale","noscale");
	   mymovie.write		(elementId);
	   initSelectCountry(elementId);
	}
}

function closeLayer(elementId)
{
	document.getElementById(elementId).style.display	= "none";
	onscroll = null;
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

// Start Cookies
function galleta(selObj){ 

var $path = "/";
var $domain = ".mundonick.com";
//var $domain = "";
var $pais=(selObj.options[selObj.selectedIndex].value); 

$pais = $pais.split("|");


	if ($pais != null){

			SetCookie ("COUNTRY",  $pais[0]  , expdate, $path, $domain, false);
			SetCookie ("REGION", $pais[1] , expdate, $path, $domain, false);
			SetCookie ("LANG", $pais[2] , expdate, $path, $domain, false);
			document.location= page;
	}
}


function nick_cookie(params)
{
	var $path = "/";
	var $domain = ".mundonick.com";	
	var $pais=params; 	
	//var server_name = <java>out.print("\""+request.getServerName()+"\"");</java>;
	//alert(location.hostname);
	var server_name = location.hostname;
	$pais = $pais.split("|");
	
	
	if ($pais != null)
	{			
		SetCookie ("COUNTRY",  $pais[0]  , expdate, $path, $domain, false);
		SetCookie ("REGION", $pais[1] , expdate, $path, $domain, false);
		SetCookie ("LANG", $pais[2] , expdate, $path, $domain, false);
		
		if ( server_name == "mundonick.uol.com.br" && $pais[0] != "brazil" ){
			
			document.location="http://www.mundonick.com/sitewide/headerfooter/cookie_auto.jhtml?pais="+params+"&page="+page;
		}else{
			document.location= page;
		}
	}		 
}
// end Cookies

function MM_callJS(jsStr) { //v2.0
  	return eval(jsStr)
}


