var ancho = espacioh();

function espacioh(){
	var espacio = 0;
	if (screen.width>800) {
		espacio=(screen.width-796)/2;
	}
	//alert(espacio);
	return espacio;
}

function dibuja_espaciov()
{
	if (screen.height > 600)
	{
		document.write ("<tr><td height='68' colspan='3'><img width='1' src='images/shim.gif' height='68'></td></tr>")
	}
}

function dibuja_espacioh()
{
	
	if (screen.width > 800)
	{
		document.write ("<td bgcolor='#EBEBEB' width='"+ancho+"'><img src='images/shim.gif' width='100' height='1'></td>")
	}
}

function ocultar_menu(){
		//ocultar('menu1')
		//ocultar('menu2')
		//ocultar('menu3')
		//ocultar('menu4')
		//ocultar('protector')
		if (ie){
			menu_1.style.color='#656565';
      mnugroup1.bgColor = "#FFFFFF";
      img_triang_1.src = 'images/shim.gif';
      img_flecha_1.src = 'images/flechaLila.gif';
      menu_2.style.color='#656565';
      mnugroup2.bgColor = "#FFFFFF";
      img_triang_2.src = 'images/shim.gif';
      img_flecha_2.src = 'images/flechaAzul.gif';
      menu_3.style.color='#656565';
      mnugroup3.bgColor = "#FFFFFF";
      img_triang_3.src = 'images/shim.gif';
      img_flecha_3.src = 'images/flechaAzul1.gif';
      menu_4.style.color='#656565';
      mnugroup4.bgColor = "#FFFFFF";
      img_triang_4.src = 'images/shim.gif';
      img_flecha_4.src = 'images/flechaVerde1.gif';
      menu_5.style.color='#656565';
      mnugroup5.bgColor = "#FFFFFF";
      img_triang_5.src = 'images/shim.gif';
      img_flecha_5.src = 'images/flechaVerde2.gif';
      menu_6.style.color='#656565';
      mnugroup6.bgColor = "#FFFFFF";
      img_triang_6.src = 'images/shim.gif';
      img_flecha_6.src = 'images/flechaNar.gif';
      menu_7.style.color='#656565';
      mnugroup7.bgColor = "#FFFFFF";
      img_triang_7.src = 'images/shim.gif';
      img_flecha_7.src = 'images/flechaRosa.gif';
      menu_8.style.color='#656565';
      mnugroup8.bgColor = "#FFFFFF";
      img_triang_8.src = 'images/shim.gif';
      img_flecha_8.src = 'images/flechaRoja.gif';
      menu_9.style.color='#656565';
      mnugroup9.bgColor = "#FFFFFF";
      img_triang_9.src = 'images/shim.gif';
      img_flecha_9.src = 'images/flechaVerde3.gif';
      menu_10.style.color='#656565';
      mnugroup10.bgColor = "#FFFFFF";
      img_triang_10.src = 'images/shim.gif';
      img_flecha_10.src = 'images/flechaVerde4.gif';
      menu_11.style.color='#656565';
      mnugroup11.bgColor = "#FFFFFF";
      img_triang_11.src = 'images/shim.gif';
      img_flecha_11.src = 'images/flechaCaqui.gif';
      menu_12.style.color='#656565';
      mnugroup12.bgColor = "#FFFFFF";
      img_triang_12.src = 'images/shim.gif';
      img_flecha_12.src = 'images/flechaNar.gif';
      menu_13.style.color='#656565';
      mnugroup13.bgColor = "#FFFFFF";
		  img_triang_13.src = 'images/shim.gif';
      img_flecha_13.src = 'images/flechaNarF.gif';
      }
	}

function mostrar_1() {
  ocultar_menu();
	if (ie){
    img_triang_1.src = 'images/triang_1.gif';
    img_flecha_1.src = 'images/flechaLilaI.gif';
    menu_1.style.color='#FFFFFF';
    mnugroup1.bgColor = "#9F77EE";
  }

}

function mostrar_2() {
  ocultar_menu();
  if (ie){
    img_triang_2.src = 'images/triang_2.gif';
    img_flecha_2.src = 'images/flechaAzulI.gif';
    menu_2.style.color='#FFFFFF';
    mnugroup2.bgColor = "#687DD7";
  }
}

function mostrar_3() {
  ocultar_menu();
  if (ie){
    img_triang_3.src = 'images/triang_3.gif';
    img_flecha_3.src = 'images/flechaAzul1I.gif';
    menu_3.style.color='#000000';
    mnugroup3.bgColor = "#00B3C8";
  }
}

function mostrar_4() {
  ocultar_menu();
  if (ie){
    img_triang_4.src = 'images/triang_4.gif';
    img_flecha_4.src = 'images/flechaVerde1I.gif';
    menu_4.style.color='#FFFFFF';
    mnugroup4.bgColor = "#27AE6A";
  }
}

function mostrar_5() {
  ocultar_menu();
  if (ie){
    img_triang_5.src = 'images/triang_5.gif';
    img_flecha_5.src = 'images/flechaVerde2I.gif';
    menu_5.style.color='#000000';
    mnugroup5.bgColor = "#A3D65A";
  }
}

function mostrar_6() {
  ocultar_menu();
  if (ie){
    img_triang_6.src = 'images/triang_12.gif';
    img_flecha_6.src = 'images/flechaNarI.gif';
    menu_6.style.color='#000000';
    mnugroup6.bgColor = "#FFC000";
  }
}

function mostrar_7() {
  ocultar_menu();
  if (ie){
    img_triang_7.src = 'images/triang_7.gif';
    img_flecha_7.src = 'images/flechaRosaI.gif';
    menu_7.style.color='#000000';
    mnugroup7.bgColor = "#E78676";
  }
}

function mostrar_8() {
  ocultar_menu();
  if (ie){
    img_triang_8.src = 'images/triang_8.gif';
    img_flecha_8.src = 'images/flechaRojaI.gif';
    menu_8.style.color='#FFFFFF';
    mnugroup8.bgColor = "#C6240A";
  }
}

function mostrar_9() {
  ocultar_menu();
  if (ie){
    img_triang_9.src = 'images/triang_9.gif';
    img_flecha_9.src = 'images/flechaVerde3I.gif';
    menu_9.style.color='#000000';
    mnugroup9.bgColor = "#93B06A";
  }
}

function mostrar_10() {
  ocultar_menu();
  if (ie){
    img_triang_10.src = 'images/triang_10.gif';
    img_flecha_10.src = 'images/flechaVerde4I.gif';
    menu_10.style.color='#FFFFFF';
    mnugroup10.bgColor = "#4D6C21";
  }
}

function mostrar_11() {
  ocultar_menu();
  if (ie){
    img_triang_11.src = 'images/triang_11.gif';
    img_flecha_11.src = 'images/flechaCaquiI.gif';
    menu_11.style.color='#FFFFFF';
    mnugroup11.bgColor = "#C0A546";
  }
}

function mostrar_12() {
  ocultar_menu();
  if (ie){
    img_triang_12.src = 'images/triang_12.gif';
    img_flecha_12.src = 'images/flechaNarI.gif';
    menu_12.style.color='#000000';
    mnugroup12.bgColor = "#FFC600";
    
  }
}

function mostrar_13() {
  ocultar_menu();
  if (ie){
    img_triang_13.src = 'images/triang_13.gif';
    img_flecha_13.src = 'images/flechaNarFI.gif';
    menu_13.style.color='#FFFFFF';
    mnugroup13.bgColor = "#E16B23";
  }
}

function openPopUp(url, title, width, height, scrollbars, fullscreen, resizable, directories, status, menubar, location, toolbar) {
  window.open(url, title, 'resizable='+resizable+', toolbar='+toolbar+', location='+location+', directories='+directories+', status='+status+', menubar='+menubar+', scrollbars='+scrollbars+', width='+width+', height='+height+', fullscreen='+fullscreen);
}

function openPopUp1(url, title, width, height) {
  window.open(url, title, 'resizable=0, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, width='+width+', height='+height+', fullscreen=0');
}

function mailcorrecto(mail) {
	var c1,c2,c3,c4,c5,c6,cf;
	var len,i,error;
		len = mail.length;
		if (len==0) {
			return 0;
		} else {
			i=0;
			c1 = mail.charAt(i);
			cf = mail.charAt(len-1);
			i++;
			if (c1=='@' || c1=='.' || c1==' ' || cf=='@' || cf=='.' || cf==' ') {
				error=0; 
			} else {	
				while (i<len && c2!='@' && c2!=' ') {
					c2 = mail.charAt(i);
					i++;
				}
				if (c2!='@') error=0; 
				else {
					c3 = mail.charAt(i);
					i++;
					if (c3=='@' || c3=='.' || c3==' ') {
						error=0; 
					} else {
						while (i<len && c4!='.' && c4!='@' && c4!=' ') {
							c4 = mail.charAt(i);
							i++;
						}	
						if (c4!='.') error=0; 
						else {
							c5 = mail.charAt(i);
							if (c5!='.' && c5!='@' && c5!=' ') {
								while (i<len && c6!='.' && c6!='@' && c6!=' ') {
									c6 = mail.charAt(i);
									i++;
								}	
								if (c6=='@' || c6==' ') {
									error=0; 
								} else {
									error=1; 
								}
							} else error=0; 
						}
					}
				}	
			}
			return error;
		}	
}

function abre_PopUp(url, width, height) {
  window.open(url,'','width='+(width+20)+', height='+(height+30))
}

function writeObjFlash (file, width, height, bgcolor, mode, name) { document.write ("<OBJECT id='"+name+"' name='"+name + "' codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 height=" + height + " width=" + width + " classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000><PARAM NAME='FlashVars' VALUE=''><PARAM NAME='Movie' VALUE='" + file + "'><PARAM NAME='Src' VALUE='" + file + "'><PARAM NAME='WMode' VALUE='" + mode + "'><PARAM NAME='Play' VALUE='-1'><PARAM NAME='Loop' VALUE='-1'><PARAM NAME='Quality' VALUE='High'><PARAM NAME='SAlign' VALUE=''><PARAM NAME='Menu' VALUE='0'><PARAM NAME='Base' VALUE=''><PARAM NAME='AllowScriptAccess' VALUE='0'><PARAM NAME='Scale' VALUE='ShowAll'><PARAM NAME='DeviceFont' VALUE='0'><PARAM NAME='EmbedMovie' VALUE='0'><PARAM NAME='BGColor' VALUE='" + bgcolor +"'><PARAM NAME='SWRemote' VALUE=''><PARAM NAME='MovieData' VALUE=''><PARAM NAME='SeamlessTabbing' VALUE='1'><PARAM NAME='Profile' VALUE='0'><PARAM NAME='ProfileAddress' VALUE=''><PARAM NAME='ProfilePort' VALUE='0'><embed src='" + file + "' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" + width + "' height='" + height +"'></embed></OBJECT>"); }
