// JavaScript Document

function jObj( ObjID ){
	if (document.getElementById) { return(document.getElementById( ObjID )); }	// IE5, IE6, IE7, NetScape6, Opera, Firefox
	else { if (document.all) {return(document.all[ ObjID ]); }                  // puto IE4, y algo de IE5
		   else { BrVersion = parseInt(navigator.appVersion);							
	       		if ((navigator.appName.indexOf('Netscape')!=-1)&&(BrVersion==4)) { return (document.layers[ ObjID ]); }
		 	}  // puto NetScape4
	} 
}

function jPty( ObjID, Parametro, Valor  ){
		Obj= jObj( ObjID );
		eval( "Obj."+ Parametro +"='"+ Valor +"'" );
}

function jCss( ObjID, Parametro, Valor  ){
		Obj= jObj( ObjID );
		eval( "Obj.style."+ Parametro +"='"+ Valor +"'" );
}

function jCssW( ObjID, Parametro ){
		Obj= jObj( ObjID ); Pty="";
		eval( "Pty=Obj.style."+Parametro );
		return Pty;
}

function  jGET( name ){
		name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
		var regexS = "[\\?&]"+name+"=([^&#]*)";
		var regex = new RegExp( regexS );
		var results = regex.exec( window.location.href );
		if( results == null ) return "";  else  return results[1];
}

function jEXT(fname) { 
		 if( fname.length == 0 ) return ""; 
		 var dot = fname.lastindexOf("."); 
		 if( dot == -1 ) return ""; 
		 var extension = fname.substr(dot,fname.length); 
		 return extension; 
} 


function jDivOn(ObjID){
	Obj = jObj(ObjID);
	Obj.style.display ="block";
}

function jDivOff(ObjID){
	Obj = jObj(ObjID);
	Obj.style.display ="none";
}

function jPageWidth() {
	return window.innerWidth!=null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body!=null ? document.body.clientWidth : null;
} 

function jPageHeight() {
	return  window.innerHeight!=null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body!=null? document.body.clientHeight : null;
} 

function jPosLeft() {
	 return typeof window.pageXOffset!='undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;
} 

function jPosTop() {
	 return typeof window.pageYOffset!='undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
} 

function jPosRight() {
	 return jsPosLeft()+jsPageWidth();
} 

function jPosBottom() {
	return jsPosTop()+jsPageHeight();
}


