/**
* Abre el popup de contacto
* @author	Federico Campo Piombi
* @version	1.0
* @since	22 May 2007
*/
function openContacto(){
	_openCustomPopup("images/top_contacto.jpg", "contacto.html", ":: 4 Fantásticos :: Contacto ::");
}


/**
* Abre el popup de Bases y Condiciones
* @author	Federico Campo Piombi
* @version	1.0
* @since	19 May 2007
*/
function openBases(){
	_openCustomPopup("images/top_byc.jpg", "bases.html", ":: 4 Fantásticos :: Bases y Condiciones ::");
}


/**
* Abre el popup de Registro a la promo
* @author	Federico Campo Piombi
* @version	1.0
* @since	19 May 2007
*/
function openRegistro(){
	_openCustomPopup("images/top_registro.jpg", "registro.html", ":: 4 Fantásticos :: Registro ::");
}


/**
* Abre un popup con los parametros especificados y retorna la referencia
* 
* @author	Federico Campo Piombi
* @version	1.0
* @since	05 May 2007
* 
* @param 	file (String) Nombre del archivo a abrir
* @param	width (Number) Ancho de la ventana
* @param	height (Number) Altura de la ventana
* @param	xpos (Number) posicion X de la ventana
* @param	ypos (Number) posicion Y de la ventana
* 
* @return	window
*/
function openWindow(file, width, height, xpos, ypos, scrollbars){
	var wnd = window.open(file,'','width=' +width+ ', height=' +height+ ', left=' +xpos+ ', right=' +ypos+ ', toolbar=0, status=0, menubar=0, scrollbars='+scrollbars);
	return wnd
};


/**
* Abre un popup estandar de la promo con los parametros de contenido y layout especificados
* 
* @author	Federico Campo Piombi
* @version	1.0
* @since	19 May 2007
* 
* @param 	image (String) Imagen que se utilizara en el top de la tabla
* @param	file (String) Contenido que se cargara en el IFrame
* @param	title (String) Titulo de la ventana
*/
function _openCustomPopup(image, file, title){
	var siteCenter = _getScreenCenter();
	var wndWidth = 425;
	var wndHeight = 600;
	var xpos = siteCenter.x - (wndWidth/2);
	var ypos = siteCenter.y - (wndHeight/2);
	var params = "?file=" + file + "&image=" + image + "&title=" + title;
	var wnd = openWindow("popup.html"+params, wndWidth, wndHeight, xpos, ypos, "no");
}


/**
* Calcula el centro de la pantalla y retorna un objeto con la posicion X e Y
* 
* @author	Federico Campo Piombi
* @version	1.0
* @since	05 May 2007
* 
* @return	Object
*/
function _getScreenCenter(){
	var point = {x:screen.width/2, y:screen.height/2};
	return point;
}