
constMaxItem=3;
var Pop;

function fnDispThis(active)
{
for (i=1; i < constMaxItem+1; i++)
	{
	if (i!=active)
		{
		document.all("sub"+i).style.display="NONE"
		}
	else
		{
		document.all("sub"+active).style.display="BLOCK"
		}
	}
}



function GetPath(aPath){	
	var DirS =new Array('/Funciones/','/Imagenes/','/img/','/Modules/','/Styles/');	
	var AP=new String(location.href);
	var PTO=new String(aPath);	
	var RPP;
	var PrP;
	var Parameters =new String('');	
	PrP=aPath.lastIndexOf('?');
	if (PrP !=-1){
	   PTO=aPath.slice(0,PrP);
	   Parameters=aPath.slice(PrP);}
	AP=AP.toLowerCase();	
	PTO=PTO.toLowerCase();		
	PTO=PTO.slice(1,PTO.length);	
	for (counter=0;counter<DirS.length;counter++){		
		var Directory=new String(DirS[counter]);		
		Directory=Directory.toLowerCase();			
		RPP=AP.lastIndexOf(Directory);	
		alert(AP + ' ' +Directory);	
		if (RPP > -1){ 
			AP=AP.slice(0,RPP);							
			return AP + PTO + Parameters;}}	
	if (RPP=-1)
		return AP}
function Activa(Elemento){
	//Elemento.src = "imagenes/" +Elemento.name +"_i.gif"
}
function DesActiva(Elemento){
	// Elemento.src = "imagenes/" +Elemento.name +".gif"
}

function OpenRegistro(){
		pt=new String(location.href);
	PrP=pt.lastIndexOf('?');
	if (PrP !=-1)
	   pt=pt.slice(0,PrP);

	PrP=pt.toLowerCase().lastIndexOf('default.asp');
	pt=pt.slice(0,PrP)+'Registro.asp';
	window.open(pt,'Registrese','width=400,height=400,top=100,left=100');  
	return false;}
	
function OpenPass(){
	pt=new String(location.href);
	PrP=pt.lastIndexOf('?');
	if (PrP !=-1)
	   pt=pt.slice(0,PrP);

	PrP=pt.toLowerCase().lastIndexOf('default.asp');
	pt=pt.slice(0,PrP)+'Pass.asp';
	window.open(pt,'Olvido','width=350,height=250,top=100,left=100');   
	return false;}

	
	function OpenCalendar(aObjectId, postBack, aPath, aControlType){	
	var txtName;
	var txtValue;		
	if (aControlType == 1){txtId=GetTxtId(aObjectId);	}
	else{	txtId=aObjectId;}	
	txtValue=Object(txtId).value	
	aPath=GetPath(aPath)+aPath;	
	Pop=window.open(aPath+"?id="+ txtId + "&selected="+txtValue+"&postBack="+postBack
	,'Calendar'	
	,'dependent=1,width=170,height=225,top=' + GetY(225) + ',left=' + GetX(170));			
	Pop.focus();	
	return false;}
	
	function SetDate(newDate,IdControl,postBack){	
	eval("opener.document.forms[0].elements['"+ IdControl + "'].value ='" + newDate + "';");		
	window.close();	
	if (postBack)
		__doPostBack('IdControl','');		
	return false;}
	
	function GetX(aWidth){	
    var xMax = screen.width;    	
    return  (xMax/2)-(aWidth/2);}
    
function GetY(aHeight){	
    var  yMax = screen.height;
    return  (yMax/2)-(aHeight/2);}
	
	function GetPath(aPath){	
	var DirS =new Array('/Java/','/DesktopModules/','/Opens/','/Styles/','/Images/','/img/','/Modulos/','/admin/');	
	var AP=new String(location.href);
	var PTO=new String(aPath);	
	var RPP;
	var PrP;
	PrP=AP.lastIndexOf('Default.aspx');
		if (PrP !=-1)
			AP=AP.slice(0,PrP);
	var Parameters =new String('');	
	PrP=aPath.lastIndexOf('?');
	if (PrP !=-1){
	   PTO=aPath.slice(0,PrP);
	   Parameters=aPath.slice(PrP);}
	AP=AP.toLowerCase();	
	PTO=PTO.toLowerCase();		
	PTO=PTO.slice(1,PTO.length);			
	for (counter=0;counter<DirS.length;counter++){		
		var Directory=new String(DirS[counter]);		
		Directory=Directory.toLowerCase();			
		RPP=AP.lastIndexOf(Directory);		
		if (RPP > -1){ 
			AP=AP.slice(0,RPP);							
			return AP + PTO + Parameters;}}	
	if (RPP=-1)
		return AP}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var NS4 = (document.layers) ? 1 : 0;
var IE4 = (document.all) ? 1 : 0;
var ver4 = (NS4 || IE4) ? 1 : 0;
function imprimir()
{
if (ver4) {if (window.print) window.print(); else if (window.top.contenido.print) window.top.contenido.print(); 	
else alert("Usted no dispone de un navegador que soporte dicha funcionalidad.\nPara Imprimir pulse Ctrl+P");}
else alert("Usted no dispone de un navegador que soporte dicha funcionalidad.\nPara Imprimir pulse Ctrl+P");}

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_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_findObj(n, d) { //v3.0
  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); 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];}
}

  var ZoomNo='1';
  function Zoomfotos(miurl,paramet){
  if (paramet == null){
      paramet='scrollbars=no,resizable=yes,width=600,height=600,screenX=100,screenY=100';}
  if (ZoomNo=='2')  {
      if (!frmZoom.closed) {
        frmZoom.close();
      }}
    else
    {
    ZoomNo='2';}
  frmZoom = open(miurl, "Zoom",paramet);
  if (frmZoom.opener == null) {frmZoom.opener = self;}
  }
  
  function Zoomfotos2(){
  
      paramet='scrollbars=no,resizable=yes,width=600,height=600,screenX=100,screenY=100';
  if (ZoomNo=='2')  {
      if (!frmZoom.closed) {
        frmZoom.close();
      }}
    else
    {
    ZoomNo='2';}
  frmZoom = open(document.fotox.src, "Zoom",paramet);
  if (frmZoom.opener == null) {frmZoom.opener = self;}
  }
  
   function Changefotos(miurl){
   var d=document; 
   if(d.fotox)
   {
   var str=miurl;
 
    d.fotox.src=miurl //str.replace(/ /, "%20");
   }
  }
  
  
 function Object(aName){			
	if (document.getElementById)
  		return  document.getElementById(aName);
	else if (document.all)
		return  document.all[aName];
	else if (document.layers)
   		return  document.layers[aName];} 
  
 


