function validateas2() {
	var Validar = new clsValidator();
	Validar.Longitud("cl_nombre", ">", 3, "");
	Validar.Longitud("cl_dir", ">", 3, "");
	Validar.Longitud("cl_ciu", ">", 2, "");
	Validar.Longitud("cl_cp", ">", 4, "");
	Validar.Longitud("cl_pro", ">", 3, "");
	Validar.Longitud("cl_pai", ">", 3, "");
	Validar.Entero("cl_tlf","");	
	Validar.Email("cl_mail", "");
	Validar.Longitud("cl_nac", ">", 3, "");
	Validar.Fecha("cl_fnac", "");
	Validar.Longitud("cl_dni", ">", 3, "");
	Validar.Longitud("cl_dnilugexp", ">", 3, "");
	Validar.Fecha("cl_dniexp", "");
	Validar.Fecha("cl_dnicad", "");
	Validar.Longitud("cl_carcond", ">", 0, "");
	Validar.Longitud("cl_carcondlugexp", ">", 3, "");
	Validar.Fecha("cl_carcondfexp", "");
	Validar.Fecha("cl_carcondcad", "");
	if (Validar.Validar()) document.as.submit(); 
}

function validateasb() {
	var Validar = new clsValidator();
	Validar.Longitud("cl_nombre", ">", 3, "");
	Validar.Longitud("cl_dir", ">", 3, "");
	Validar.Longitud("cl_ciu", ">", 2, "");
	Validar.Longitud("cl_cp", ">", 4, "");
	Validar.Longitud("cl_pro", ">", 3, "");
	Validar.Longitud("cl_pai", ">", 3, "");
	Validar.Entero("cl_tlf","");	
	Validar.Email("cl_mail", "");
/*	Validar.Longitud("cl_nac", ">", 3, "");
	Validar.Fecha("cl_fnac", "");
	Validar.Longitud("cl_dni", ">", 3, "");
	Validar.Longitud("cl_dnilugexp", ">", 3, "");
	Validar.Fecha("cl_dniexp", "");
	Validar.Fecha("cl_dnicad", "");
	Validar.Longitud("cl_carcond", ">", 0, "");
	Validar.Longitud("cl_carcondlugexp", ">", 3, "");
	Validar.Fecha("cl_carcondfexp", "");
	Validar.Fecha("cl_carcondcad", "");*/
	if (Validar.Validar()) document.as.submit(); 
}

function validateas4() {
	this.errorColor="#FFC1C1";													// color de error x defecto
	/*document.miFormulario.miCheck.checked
	var Validar = new clsValidator();
	Validar.Longitud("cl_nombre", ">", 3, "");
	Validar.Longitud("cl_dir", ">", 3, "");
	Validar.Longitud("cl_ciu", ">", 2, "");
	Validar.Longitud("cl_cp", ">", 4, "");
	Validar.Longitud("cl_pro", ">", 3, "");
	Validar.Longitud("cl_pai", ">", 3, "");
	Validar.Entero("cl_tlf","");	
	Validar.Email("cl_mail", "");
	Validar.Longitud("cl_nac", ">", 3, "");
	Validar.Fecha("cl_fnac", "");
	Validar.Longitud("cl_dni", ">", 3, "");
	Validar.Longitud("cl_dnilugexp", ">", 3, "");
	Validar.Fecha("cl_dniexp", "");
	Validar.Fecha("cl_dnicad", "");
	Validar.Longitud("cl_carcond", ">", 0, "");
	Validar.Longitud("cl_carcondlugexp", ">", 3, "");
	Validar.Fecha("cl_carcondfexp", "");
	Validar.Fecha("cl_carcondcad", "");*/
	if (document.terms.checkbox.checked == true) document.as.submit(); 
	else {
		document.terms.checkbox.style.backgroundColor=this.errorColor;
		document.getElementById("ayuda").style.backgroundColor=this.errorColor;
	}
}

function validatecon() 
{
	var Validar = new clsValidator();
	Validar.Longitud("co_name", ">", 4, "");
	Validar.Email("co_mail", "");
	Validar.Longitud("co_com", ">", 5, "");
	if (Validar.Validar()) document.contact.submit(); 
}

function enviar_as_back(pg){
	document.as.action=pg;
    document.as.submit();
}

function show_txt(thetext, whichdiv){
	if (ie) eval("document.all."+whichdiv).innerHTML=thetext;
	else if (ns6) document.getElementById(whichdiv).innerHTML=thetext;
}

function writeCookie(name, value, hours){
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}

var popUpWin=0;
function popUpWindow(URLStr, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left=180,top=120,screenX=180,screenY=120');
}

function Show_(lletra) {
    document.all.srv_a.style.visibility = 'hidden';
    document.all.srv_b.style.visibility = 'hidden';
    document.all.srv_c.style.visibility = 'hidden';
    document.all.srv_d.style.visibility = 'hidden';
    document.all.srv_e.style.visibility = 'hidden';
    document.all.srv_f.style.visibility = 'hidden';
	document.getElementById("srv_"+lletra).style.visibility = 'visible';
}

function ShowHide(id, visibility) {
    obj = document.getElementsByTagName("div");
    obj[id].style.visibility = visibility;
}
/////


var linktext=new Array()
	linktext[0]="first page"
	linktext[1]="previous page"
	linktext[2]="next page"
	linktext[3]="last page"

var ns6=document.getElementById&&!document.all
var ie=document.all


function hide_txt(whichdiv){
	if (ie) eval("document.all."+whichdiv).innerHTML=' '
	else if (ns6) document.getElementById(whichdiv).innerHTML=' '
}


var ns4 = (document.layers)?true:false 
var ie4 = (document.all)?true:false 

function overTD(td,color){td.bgColor=color;} 

function outTD(td,color){td.style.cursor='default';td.bgColor=color;} 

function clickTD(td){td.children.tags('A')[0].click();} 

function redirect(){
var indice = document.busca.empresas.selectedIndex 
var valor = document.busca.empresas.options[indice].value 
window.location='fra_listado.php?select='+valor
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf('#')!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function mOvr(src,clrOver) {
  if (ie4) {
     if (!src.contains(event.fromElement)) {
        src.style.cursor = 'hand';
      	 src.bgColor = clrOver;
     }
  }
}
function mOut(src,clrIn) {
  if (ie4) {
     if (!src.contains(event.toElement)) {
        src.style.cursor = 'default';
      	 src.bgColor = clrIn;
     }
  }
}

function printPage() { print(document); }

function messageWindowfm(title, msg) {
  var width="300", height="125";
  var left = (screen.width/2) - width/2;
  var top = (screen.height/2) - height/2;
  var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
  var msgWindow = window.open("","msgWindow", styleStr);
  var head = '<head><title>'+title+'</title><link href=\'../../img/stil.css\' rel=\'stylesheet\' type=\'text/css\'></head>';
  var body = '<center>'+msg+'<br><p><form><input type="button" value="   Ok   " onClick="self.close()"></form>';
  msgWindow.document.write(head + body);
}

function messageWindow(title, msg) {
  var width="300", height="125";
  var left = (screen.width/2) - width/2;
  var top = (screen.height/2) - height/2;
  var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
  var msgWindow = window.open("","msgWindow", styleStr);
  var heads = '<head><title>'+title+'</title><link href=\'../img/stil.css\' rel=\'stylesheet\' type=\'text/css\'></head>';
  var body = '<center>'+msg+'<br><p><form><input type="button" value="   Ok   " onClick="self.close()"></form>';
  msgWindow.document.write(head + body);
}


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 openFullscreen(page) {
var yes = 1;
var no = 0;

var menubar = no;      // The File, Edit, View Menus
var scrollbars = no;   // Horizontal and vertical scrollbars
var locationbar = no;  // The location box with the site URL
var directories = no;  // the \"What's New\", \"What Cool\" links
var resizable = no;    // Can the window be resized?
var statusbar = no;    // Status bar (with \"Document: Done\")
var toolbar = no;      // Back, Forward, Home, Stop toolbar

windowprops = "width=" + (screen.width-10) + ",height=" + (screen.height-50) + ",top=0,left=0";

windowprops += (menubar ? ",menubars" : "") +
(scrollbars ? ",scrollbars" : "") +
(locationbar ? ",location" : "") +
(directories ? ",directories" : "") +
(resizable ? ",resizable" : "") +
(statusbar ? ",status" : "") +
(toolbar ? ",toolbar" : "");

window.open(page, 'fullPopup', windowprops);
}

var txt = "";
function movein(which,html){
	if (document.getElementById){
		txt = document.getElementById("imatge").innerHTML;
		document.getElementById("imatge").innerHTML=html;
		}
	else{
		boxdescription.innerHTML=html;}
}
function moveout(which){
	if (document.getElementById){
		document.getElementById("imatge").innerHTML=txt;}
	else{
		boxdescription.innerHTML='&nbsp;';}
}