function pop_up(pagina,ancho,alto,id){
var Left = (screen.width-ancho)/2;var Top = (screen.height-alto)/2;var p = 'no'
var opciones='toolbar='+p+',location='+p+',directories='+p+',status='+p+',menubar='+p+',scrollbars=yes,resizable='+p+',width='+ancho+',height='+alto+',top='+Top+',left='+Left+'';popup = window.open(pagina+'?id='+id,"ventana",opciones);popup.focus();
}




/****************************************************************************************************************************************************************/
//var camp_salt = 99; 
//var camp_int = '';
//var camp_sum = -1;
//var camp_index = 0
//var camp_vel = 10; Velocidad de transicion
//var camp_time = 10; Tiempo de latencia del banner

function change_pub(object,x,div){
	pub_salt = 99;
	pub_sum = -1;
	if(x > 1)
		pub_int = window.setInterval("fader_pub(\'"+object+"\',"+x+",\'"+div+"\')",50);
	else
		document.getElementById(div+"_1").style.display = 'block';
}

function fader_pub(object,x,div){
	o = object;
	object =  document.getElementById(object);
	if(pub_salt < 0 ){
		pub_sum = 1;
		if(pub_index >= x)
			pub_index = 1;
		else
			pub_index = pub_index + 1;
		for(k=1;k<=x;k++){
			document.getElementById(div+"_"+k).style.display = 'none';
		}
		document.getElementById(div+"_"+pub_index).style.display = 'block';
	}
	pub_salt = pub_salt + pub_vel*pub_sum;
	if(pub_salt >= 100){
		clearInterval(pub_int);
		setTimeout("change_pub(\'"+o+"\',"+x+",\'"+div+"\')",(pub_time*1000))
		
	}
	object.style.opacity = (pub_salt/100);
    object.style.filter = "alpha(opacity=" + pub_salt + ")"; 
}



function change_pubg(object,x,div){
	camp_salt = 99;
	camp_sum = -1;
	if(x > 1)
		camp_int = setInterval("fader_pubg(\'"+object+"\',"+x+",\'"+div+"\')",50);
	else
		document.getElementById(div+"_1").style.display = 'block';
}

function fader_pubg(object,x,div){
	o = object;
	object =  document.getElementById(object);
	if(camp_salt < 0 ){
		camp_sum = 1;
		if(camp_index >= x)
			camp_index = 1;
		else
			camp_index = camp_index + 1;
		for(k=1;k<=x;k++){
			document.getElementById(div+"_"+k).style.display = 'none';
		}
		document.getElementById(div+"_"+camp_index).style.display = 'block';
	}
	camp_salt = camp_salt + camp_vel*camp_sum;
	if(camp_salt >= 100){
		clearInterval(camp_int);
		setTimeout("change_pubg(\'"+o+"\',"+x+",\'"+div+"\')",(camp_time*1000))
		
	}
	object.style.opacity = (camp_salt/100);
    object.style.filter = "alpha(opacity=" + camp_salt + ")"; 
}