
/* Funciones utilizadas en el sitio Web Corporativo de SERVEX - Servicios Externalizados, S.A. */

function aplicaestilos() {
	app=navigator.appName;
	agent=navigator.userAgent
	verStr=navigator.appVersion;
	version = parseFloat(verStr);
	<!--alert ('Navegador: ' + app + '\nAgente: ' + agent + '\nVersión: ' + verStr + '\nNúmero de versión: ' + version);
	
	<!-- Localización de las hojas de estilo y asignación según familia y versión de navegador.
	cssNN = "css/estilos_nn.css";
	cssN6 = "css/estilos_nn.css";
	cssIE = "css/estilos_ie.css";
	
	if (app.indexOf('Netscape') != -1) {
		if (version < 5) {
			<!--alert ('Soy un antiguo Netscape Navigator, como por ejemplo un 4.51');
	    	document.write("<link rel='stylesheet' href='" + ajusteruta + cssNN + "' type='text/css'>");
		}
		else if (version >= 5) {
			<!--alert ('Soy uno de los nuevos Netscape, como por ejemplo un 6 o 7');
	    	document.write("<link rel='stylesheet' href='" + ajusteruta + cssN6 + "' type='text/css'>");
		}
	}
	else if (app.indexOf('Microsoft') != -1) {
		if 	(agent.indexOf('MSIE 4') != -1) {
			<!--alert ('Soy un Internet Explorer 4 de Microsoft');
			document.write("<link rel='stylesheet' href='" + ajusteruta + cssIE + "' type='text/css'>");
		}
		else if (agent.indexOf('MSIE 5') != -1) {
			<!--alert ('Soy un Internet Explorer 5 de Microsoft');
			document.write("<link rel='stylesheet' href='" + ajusteruta + cssIE + "' type='text/css'>");
		}
		else if (agent.indexOf('MSIE 6') != -1) {
			<!--alert ('Soy un Internet Explorer 6 de Microsoft');
			document.write("<link rel='stylesheet' href='" + ajusteruta + cssIE + "' type='text/css'>");
		}
		else {
			<!--alert ('Soy un Internet Explorer de Microsoft');
			document.write("<link rel='stylesheet' href='" + ajusteruta + cssIE + "' type='text/css'>");
		}
	}
	else {
		<!--alert ('No se que familia de Navegador soy');
	    document.write("<link rel='stylesheet' href='" + tmt_css_IE + "' type='text/css'>");  	
	}
}	


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_controlShockwave(objStr,x,cmdName,frameNum) { //v3.0
  var obj=MM_findObj(objStr);
  if (obj) eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?frameNum:'')+')');
}


function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}


function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


var FDK_loaded=false;
function FDK_goToFrame(ID,frameNum) {
	loc = eval("window.document."+ID);
	frameNum = (parseInt(frameNum));
	if (navigator.appName.indexOf ("Microsoft") !=-1) {
		TFrames = (parseInt(loc.TotalFrames));
	}
	else  {
		TFrames = (parseInt(loc.TotalFrames()));
	}
	if (frameNum <= TFrames) {
		if (!FDK_loaded) {
			while (!FDK_loaded) {
				if(loc.PercentLoaded() == 100)  {
					loc.GotoFrame(frameNum);
					FDK_loaded = true;
				}
			}
		}
		else  {
			loc.GotoFrame(frameNum);
		}
	}
	else {
		alert("Flash Scripting Error: The jump frame you specified is greater than the total number of fames in the Flash movie. Choose a lesser value.");
	}
}

function FDK_playFlash(ID) {
	loc = eval("window.document."+ID);
	if (!FDK_loaded) {
		while (!FDK_loaded) {
			if(loc.PercentLoaded() == 100)  {
				loc.Play();
				FDK_loaded = true;
			}
		}
	}
	else  {
		loc.Play();
	}
}

// Guardar cookie.
function setCookie(name, value, expires) {
document.cookie = name + "=" + escape(value) + "; path=/" +
((expires == null) ? "" : "; expires=" + expires.toGMTString());
}

// Leer cookie.
function getCookie(name){
var cname = name + "=";               
var dc = document.cookie;             
    if (dc.length > 0) {              
    begin = dc.indexOf(cname);       
        if (begin != -1) {           
        begin += cname.length;       
        end = dc.indexOf(";", begin);
            if (end == -1) end = dc.length;
            return unescape(dc.substring(begin, end));
        } 
    }
return null;
}

// Borrar cookie.
function delCookie(name) {
document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT" +  "; path=/";
}

