/* ---------------------------------------------------
   Global variables:

   Values set to variables used by other functions
   afterwards.
   --------------------------------------------------- */

/* sIFR functionality:
   Used by sIFR to replace CSS classes with a specific SWF
   within the HTML code.

   Called by: Global
*/
var flashVideoPlayer;

if(typeof sIFR == "function") {
  // sIFR.replaceElement("#id name | .class name", named({sFlashSrc: "path/to/swf", sColor: "#color", sWmode: "transparent | opaque"}));


	sIFR.replaceElement(".ttl_shorts", named({sFlashSrc: "swf/Univers_57_Condensed.swf", sColor: "#2d2c2c", sWmode: "transparent" }));
	sIFR.replaceElement(".ttl_subscribe", named({sFlashSrc: "swf/Univers_67_CondensedBold.swf", sColor: "#ffffff", sWmode: "transparent" }));
	sIFR.replaceElement(".ttl_subscribesecond", named({sFlashSrc: "swf/Garamond_It.swf", sColor: "#ffffff", sWmode: "transparent" }));
	sIFR.replaceElement(".ttl_section", named({sFlashSrc: "swf/Univers_67_CondensedBold.swf", sColor: "#5f5f5f", sWmode: "transparent" }));



}

/*This script is for correct resolutions in 1024*768 End*/

// ||||||||||||||||||||||||||||||||||||||||||||||||||

function toggleRightMenu(id) {
	var i = 1;

	while(document.getElementById("rightmenu" + i) != undefined) {
		//if(i != id) {
			document.getElementById("rightmenu" + i).style.display = "none";
			document.getElementById("rightmenulink" + i).className = "";
		//}
		i++;
	}

	if(document.getElementById("rightmenu" + id).style.display == "none") {
		document.getElementById("rightmenu" + id).style.display = "block";
		document.getElementById("rightmenulink" + id).className = "rightmenuactive";
	}
	else {
		document.getElementById("rightmenu" + id).style.display = "none";
		document.getElementById("rightmenulink" + id).className = "";
	}

}

// ||||||||||||||||||||||||||||||||||||||||||||||||||

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

/*Nav Menu*/
var subnavlist = ["menu_empty","menu_personas","menu_empresas"];
var subnavitemlist = ["menu_item_home","menu_item_personas","menu_item_empresas"];
var subnavoff = -1;
var subnavdefault;

function toggleSubnav(id,state) {
	var i;

	if(state)
		for(i = 0; i < subnavlist.length; i++) {
			subnav = document.getElementById(subnavlist[i]);
			if(id != i)
				subnav.style.display = "none";
			else
				subnav.style.display = "block";
		}
	else {
		for(i = 0; i < subnavlist.length; i++) {
			subnav = document.getElementById(subnavlist[i]);
			if(id != 0)
				subnav.style.display = "none";
			else
				subnav.style.display = "block";
		}
		initSubnav(subnavdefault);
	}
}

function initSubnav(id) {
	if(subnavdefault > subnavoff) {
		toggleSubnav(id,true);
		MM_swapImage(subnavitemlist[id],'','images/' + subnavitemlist[id] + '_on.gif',1);
	}
	else
		toggleSubnav(0,true);
}

function  hidden_divs(ids)
 {
	if(ids == 1)
	 {
		document.getElementById("box_recipeslanding_cont_bottom_shrimp").style.display='block';
		document.getElementById("box_recipeslanding_cont_bottom_fish").style.display='none';
		document.getElementById("box_recipeslanding_cont_bottom_crab").style.display='none';
		document.getElementById("box_recipeslanding_cont_bottom_other").style.display='none';
	 }
	 else if(ids ==2)
	 {
 		document.getElementById("box_recipeslanding_cont_bottom_shrimp").style.display='none';
	    document.getElementById("box_recipeslanding_cont_bottom_fish").style.display='block';
		document.getElementById("box_recipeslanding_cont_bottom_crab").style.display='none';
		document.getElementById("box_recipeslanding_cont_bottom_other").style.display='none';
	 }
	 else if(ids ==3)
	 {
 		document.getElementById("box_recipeslanding_cont_bottom_shrimp").style.display='none';
	    document.getElementById("box_recipeslanding_cont_bottom_fish").style.display='none';
		document.getElementById("box_recipeslanding_cont_bottom_crab").style.display='block';
		document.getElementById("box_recipeslanding_cont_bottom_other").style.display='none';

	 }
	 else if(ids ==4)
	 {
 		document.getElementById("box_recipeslanding_cont_bottom_shrimp").style.display='none';
	    document.getElementById("box_recipeslanding_cont_bottom_fish").style.display='none';
		document.getElementById("box_recipeslanding_cont_bottom_crab").style.display='none';
		document.getElementById("box_recipeslanding_cont_bottom_other").style.display='block';

	 }
}
function LoadSWF(address,width,height,flashvars)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'" id="swfMenu">');
	document.write('<param name="movie" value="'+address+'" /><param name="FlashVars" value="section='+flashvars+'&wmode=transparent" /><param name="scale" value="noScale" /><param name="salign" value="LT" /><param name="quality" value="high"/><param name="menu" value="false" /><param name="wmode" value="transparent" /><embed src="'+address+'"  flashvars="section='+flashvars+'&wmode=transparent" quality="high" wmode=transparent pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" scale="noScale" salign="LT" name="swfMenu"></embed><noembed> <div align="center">Su navegador no dipone de una versión apropiada de flash player. <br> Puede obtenerla gratuitamente <a href="http://www.adobe.com/es/products/flashplayer/">aqui </a> </div> </noembed></object>');
}
function LoadSWF2(address,width,height,flashvars)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'" id="animnav">');
	document.write('<param name="movie" value="'+address+'" /><param name="FlashVars" value="section='+flashvars+'&wmode=transparent" /><param name="scale" value="noScale" /><param name="salign" value="LT" /><param name="quality" value="high"/><param name="menu" value="false" /><param name="wmode" value="transparent" /><embed src="'+address+'"  flashvars="section='+flashvars+'&wmode=transparent" quality="high" wmode=transparent pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" scale="noScale" salign="LT" name="animnav"></embed><noembed> <div align="center">Su navegador no dipone de una versión apropiada de flash player. <br> Puede obtenerla gratuitamente <a href="http://www.adobe.com/es/products/flashplayer/">aqui </a> </div> </noembed></object>');
}
function Loadvideo()
{
	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="343" height="310" align="middle" id="video">');
	document.write('<param name="allowScriptAccess" value="sameDomain" /><param name="salign" value="LT" /><param name="base" value="swf/videoplayer" /><param name="movie" value="swf/videoplayer/video.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed base="swf/videoplayer" src="swf/videoplayer/video.swf" quality="high" bgcolor="#ffffff" width="343" height="310" name="video" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed><noembed> <div align="center">Su navegador no dipone de una versión apropiada de flash player. <br> Puede obtenerla gratuitamente <a href="http://www.adobe.com/es/products/flashplayer/">aqui </a> </div> </noembed></object>');
}

/*Preloader images*/

var arrayim1 = new Array();
var arrayim2 = new Array();
var arreglo;
function precargar(){
var array1 = new Array("../images/btn_search_advanced_recipes_off.gif","../images/btn_search_advanced_recipes_on.gif");
var array2 = new Array("../images/btn_more_recipes.gif","../images/btn_more_recipes_on.gif");
for(i=0;i<array1.length;++i){
arrayim1[i] = new Image()
arrayim1[i].src = array1[i]
arrayim2[i] = new Image()
arrayim2[i].src = array2[i]
}
arreglo = new Array(arrayim1,arrayim2);
}
// activa la imagen onmouseover
function rollOn(id){
num= parseInt(id);
image = document.getElementById(id);
image.src = arreglo[num-1][1].src;
}
function rollOff(id){
num= parseInt(id);
image = document.getElementById(id);
image.src = arreglo[num-1][0].src;
}




function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function moreSize(id)
{
	var ie = navigator.appName.indexOf("Microsoft") != -1;
	flashVideoPlayer = (ie) ? window['swfMenu'] : document['swfMenu'];

	document.getElementById(id).style.width='745px';
	document.getElementById(id).style.height='150px';
	document.getElementById(id).style.zIndex= '100';
	document.getElementById("cont_left").style.zIndex= '2';
	flashVideoPlayer.height = '210px'
	//alert(flashVideoPlayer.height)
}

function lessSize(id)
{
	var ie = navigator.appName.indexOf("Microsoft") != -1;
	flashVideoPlayer = (ie) ? window['swfMenu'] : document['swfMenu'];

	document.getElementById(id).style.width='745px';
	document.getElementById(id).style.height='100px';
	document.getElementById(id).style.zIndex= '2';
	document.getElementById("cont_left").style.zIndex= '100';
	flashVideoPlayer.height = '93px'
	//alert(flashVideoPlayer.height)
}
//----------
function moreSize2(id)
{
	var ie = navigator.appName.indexOf("Microsoft") != -1;
	flashVideoPlayer = (ie) ? window['swfMenu'] : document['swfMenu'];

	document.getElementById(id).style.width='745px';
	document.getElementById(id).style.height='90px';
	document.getElementById(id).style.zIndex= '100';
	document.getElementById("cont_main").style.zIndex= '2';
	flashVideoPlayer.height = '210px'
}

function lessSize2(id)
{
	var ie = navigator.appName.indexOf("Microsoft") != -1;
	flashVideoPlayer = (ie) ? window['swfMenu'] : document['swfMenu'];

	document.getElementById(id).style.width='745px';
	document.getElementById(id).style.height='90px';
	document.getElementById(id).style.zIndex= '2';
	document.getElementById("cont_main").style.zIndex= '100';
	flashVideoPlayer.height = '93px'
}
//----------

function initialize() {
	var ie = navigator.appName.indexOf("Microsoft") != -1;
	flashVideoPlayer = (ie) ? window['swfMenu'] : document['swfMenu'];
	flashVideoPlayer.height = '95px'
}
//-----
function initialize2() {
	var ie = navigator.appName.indexOf("Microsoft") != -1;
	flashVideoPlayer = (ie) ? window['swfMenu'] : document['swfMenu'];
	document.getElementById("cont_header").style.zIndex= '2';
	document.getElementById("cont_main").style.zIndex= '100';
	flashVideoPlayer.height = '93px'
}
//-----
function onRollOutDiv() {
	var ie = navigator.appName.indexOf("Microsoft") != -1;
	flashVideoPlayer = (ie) ? window['swfMenu'] : document['swfMenu'];

}

function submitForm(){
	document.form1.submit();
}

function closeWindow(){
	window.close();
}

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}