
//-- AGREGAR A FAVORITOS
/*
function bookmark(){ 
	if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>="4.0")) { 
    	var url="http://www.JuegosPop.com/"; 
		var titulo = "JuegosPop.com - Juegos, Juegos Online Gratis";
		window.external.AddFavorite(url,titulo); 
   } 
   else { 
      if(navigator.appName == "Netscape") 
         alert ("Presiona CTRL-D para agregar a JuegosPop.com a tus Favoritos! \n Usa las teclas de Manzana-D en tu Mac!"); 
   } 
}*/

//*****************************
function bookmark(){
	var url = "http://www.juegospop.com/"
	var titulo = "JuegosPop.com - Juegos, Juegos Online Gratis"
	if (navigator.appName == "Netscape") {
		window.sidebar.addPanel(titulo, url, '')
	}else{
		window.external.AddFavorite(url,titulo)
	}
}

//*****************************

//-- AGREGAR JUEGO A FAVORITOS
function bookmarkGame(gameurl,gametitle){ 
	if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>="4.0")) { 
//    	var theurl = "<?=$_url?>/juegos/<?=$_lnk_juego?>.html"; 
//		var thetitle = "<?=$_juego?> - JuegosPop.com";
		window.external.AddFavorite(gameurl,gametitle);
   } 
   else { 
      if(navigator.appName == "Netscape") 
         alert ("Presiona CTRL-D para agregar el juego a tus Favoritos! \n Usa las teclas de Manzana-D en tu Mac!"); 
   } 
}

//-- HACER PAGINA DE INICIO
//*********************************************************
function inicio()
{
   document.body.style.behavior='url(#default#homepage)';
   document.body.setHomePage("http://www.juegospop.com/");
}


// -- GAME ZOOM
//*********************************************************
function GameZoom(sz) {
	thegame = document.getElementById("JuegoPop");
	if (sz==1) {
		gnw = thegame.width*1.1;
		gnh = thegame.height*1.1;
	}else{
		gnw = thegame.width*0.9;
		gnh = thegame.height*0.9;
	}
	thegame.width = gnw+"px";
	thegame.height = gnh+"px";
	
}


// -- CONTADOR DE CARACTERES
//*********************************************************
function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit)
		field.value = field.value.substring(0, maxlimit);
	else 
		countfield.value = maxlimit - field.value.length;
}


// -- INTERCAMBIOS
//*********************************************************
function intecambios(interweb){
//	interweb = 'intercambios.html';
	coordenada_x = (screen.width) ? (screen.width- 500)/2 : 0;
	coordenada_y = (screen.height) ? (screen.height- 600)/2 : 0;
	window.open(interweb, 'interpop', 'top=' + coordenada_y +',left=' + coordenada_x + ',width=500,height=500,directories=no,menubar=no,location=no,resizable=no,status=no,toolbar=no,scrollbars=yes');
}


// -- POLITICA DE PRIVACIDAD
//*********************************************************
function politicas(politicasweb){
//	politicasweb = 'politicas.html';
	coordenada_x = (screen.width) ? (screen.width- 500)/2 : 0;
	coordenada_y = (screen.height) ? (screen.height- 600)/2 : 0;
	window.open(politicasweb, 'politicapop', 'top=' + coordenada_y +',left=' + coordenada_x + ',width=500,height=500,directories=no,menubar=no,location=no,resizable=no,status=no,toolbar=no,scrollbars=yes');
}


// -- CONTACTO
//*********************************************************
function contacto(contactoweb){
//	contactoweb = 'contacto.php';
	coordenada_x = (screen.width) ? (screen.width- 480)/2 : 0;
	coordenada_y = (screen.height) ? (screen.height- 470)/2 : 0;
	window.open(contactoweb, 'contacta', 'top=' + coordenada_y +',left=' + coordenada_x + ',width=480,height=470,directories=no,menubar=no,location=no,resizable=no,status=no,toolbar=no,scrollbars=no');
}


// -- VALIDACION DE LA FORMA DE INTERCAMBIOS
// *****************************************************
function intregistro(form){

	var fieldnames = new Array (2)
	fieldnames[0] = "- Nombre de tu sitio"
	fieldnames[1] = "- URL"
	var onoff=0
	var alertboxnames = ""
	
	var fields = new Array (2)
	fields[0] = form.intweb.value.length
	fields[1] = form.inturlto.value.length

	for (var i=0; i < fields.length; i++){
		if(fields[i] == 0){
			alertboxnames = alertboxnames + fieldnames[i] + "\n ";
			onoff ++;
		}
	}
	if (onoff == 0){
		return true
	}else{
		if (onoff == 1){
			var catness = alertboxnames.substring (0, alertboxnames.indexOf("\n "));
			alert ("Por favor ingresa los siguientes datos: \r\n " + catness);
		}else{
			var catness = alertboxnames.substring (0, alertboxnames.length-2)
			alert ("Por favor ingresa los siguientes datos: \r\n " + catness);
		}
		return false
	}
}
