/******************************************************************/
/*	                    		funciones.js	     			  */
/*               Autor: Alex cáceres - Diciembre - 2005           */
/******************************************************************/

function flash(url,w,h)
{
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='player' align='middle'>");
	document.write("<param name='allowScriptAccess' value='sameDomain' />");
	document.write("<param name='movie' value='"+url+"' /><param name='quality' value='high' /><param name='wmode' value='transparent'> <param name='bgcolor' value='#000000' /><embed src='"+url+"' quality='high' bgcolor='#000000' width='"+w+"' height='"+h+"' name='player' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>");

}

function video(movie)
{
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='320' height='300' id='player' align='middle'>");
	document.write("<param name='allowScriptAccess' value='sameDomain' />");
	document.write("<param name='FlashVars' value='movie="+movie+"'>");
	document.write("<param name='movie' value='../flash/player.swf' /><param name='quality' value='high' /><param name='wmode' value='transparent'><embed src='../flash/player.swf' quality='high' width='320' height='300' name='player' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>");

}

//Alex fullpopup 2.0 compatible mozilla
function fs(){
	url="flash.php";
	w=screen.width-20;
	h=screen.height-65;
	x=5;
	y=0;
	ventana=window.open(url,'duende','width='+w+',height='+h+',left='+x+',top='+y+',scrollbars=yes,resize=no,status=no');
	//la doy foco
	ventana.focus();

}
function home(){
	window.location.href("home.php");

}

function popUp(url,w,h){
	x=(screen.Width-w)/2;
	y=(screen.Height-h)/2;
	ventana=window.open(url,'duende','width='+w+',height='+h+',left='+x+',top='+y+',location=no,scrollbars=no,resize=no,status=no');
	//la doy foco
	ventana.focus();
	return false;
}

function vacio(){
	//para hacer pausa	
}
function redim(w,h){
		proporcion=w/h;
		//entonces para cada w h=w/proporcion;
		window.self.focus();
		//para hacerlo proporcional empiezo en w/100
		ini=w/100;
		for(i=ini;i<w;i+=3){
		  j=i/proporcion;
		  moveTo((screen.availWidth-i)/2,(screen.availHeight-j)/2);
		  
		  idInt=setInterval(vacio,1000);
		  resizeTo(i,j);
		}
		//finalizo
		resizeTo(w+10,h+55);
		clearInterval(idInt);
	}
	
function aPopUp(id){
		
		x=(screen.availWidth)/2;
		y=(screen.availHeight)/2;
		popup=window.open('../app/popup.php?url='+document.images[id].src,'popup','width=1,height=1,top='+y+',left='+x+',scrollbars=0,resizable=0,toolbar=0,location=0, status=1');
		popup.blur();
}

function popFotos(n){
		w=575;
		h=575;
		x=(screen.availWidth)/2;
		y=(screen.availHeight)/2;
		popup=window.open('../galeria/galeriafotos.php?n='+n,'popup','width=1,height=1,top='+y+',left='+x+',scrollbars=0,resizable=0,toolbar=0,location=0, status=1');
		popup.blur();
		proporcion=w/h;
		ini=w/100;
		for(i=ini;i<w;i+=10){
		  if(i>ini)
			popup.focus();
		  j=i/proporcion;
		  popup.moveTo((screen.availWidth-i)/2,(screen.availHeight-j)/2);
		  idInt=setInterval(vacio,1000);
		  popup.resizeTo(i,j);
		}
		popup.resizeTo(w+10,h+30);
		clearInterval(idInt);	
}

function popVideos(n){
		w=700;
		h=360;
		x=(screen.availWidth)/2;
		y=(screen.availHeight)/2;
		popup=window.open('../galeria/galeriavideos.php?n='+n,'popup','width=1,height=1,top='+y+',left='+x+',scrollbars=0,resizable=0,toolbar=0,location=0, status=1');
		popup.blur();
		
		proporcion=w/h;
		ini=w/100;
		for(i=ini;i<w;i+=10){
		  if(i>ini)
			popup.focus();
		  j=i/proporcion;
		  popup.moveTo((screen.availWidth-i)/2,(screen.availHeight-j)/2);
		  idInt=setInterval(vacio,1000);
		  popup.resizeTo(i,j);  	
		}
		popup.resizeTo(w+10,h+30);
		clearInterval(idInt);	
}

function destacado(dest){
		w=300;
		h=400;
		x=(screen.availWidth)/2;
		y=(screen.availHeight)/2;
		popup=window.open('destacados/destacado.php?dest='+dest,'popup','width=1,height=1,top='+y+',left='+x+',scrollbars=1,resizable=0,toolbar=0,location=0, status=1');
		popup.blur();
		
		proporcion=w/h;
		ini=w/100;
		for(i=ini;i<w;i+=10){
		  if(i>ini)
			popup.focus();
		  j=i/proporcion;
		  popup.moveTo((screen.availWidth-i)/2,(screen.availHeight-j)/2);
		  idInt=setInterval(vacio,1000);
		  popup.resizeTo(i,j);  	
		}
		popup.resizeTo(w+10,h+30);
		clearInterval(idInt);	
}

//Alex rollOver 2.0
function rollOver(id){
	on=document.getElementById(id).src;
	document.getElementById(id).src=on.replace(id,id+"on");
}

//Alex rollOut 2.0
function rollOut(id){
	off=document.getElementById(id).src;
	document.getElementById(id).src=off.replace(id+"on",id);
}

var aux;


if(document.location.href.indexOf("home.php")!=-1)
	aux="/";
else{
		aux="../";
}

function fotosOver(n){
	document.getElementById('fotos').src=aux+'galeria/img/fotos'+n+'.gif';
}

function fotosOut(){
	document.getElementById('fotos').src=aux+'galeria/img/fotos.gif';
}

function videosOver(n){
	document.getElementById('videos').src=aux+'galeria/img/videos'+n+'.gif';
}

function videosOut(){
	document.getElementById('videos').src=aux+'galeria/img/videos.gif';
}


