// 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 ]); }                  // IE4, and someIE5
		   else { BrVersion = parseInt(navigator.appVersion);							
	       		if ((navigator.appName.indexOf('Netscape')!=-1)&&(BrVersion==4)) { return (document.layers[ ObjID ]); }
		 	}  // for nautghy 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  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 ScreenSize() {
  	var myWidth = 0, myHeight = 0;
  	if( typeof( window.innerWidth ) == 'number' ) {   //Non-IE
    	myWidth = window.innerWidth;  
		myHeight = window.innerHeight;
  	} 
  	else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
    	myWidth = document.documentElement.clientWidth;
    	myHeight = document.documentElement.clientHeight;
  	} 
  	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {  //IE 4 compatible
    	myWidth = document.body.clientWidth;
    	myHeight = document.body.clientHeight;
  	}
  	return [ myWidth, myHeight ];
}


//--------------------------------------------------------
function PosScrY() {
	 var scrOfX = 0, scrOfY = 0;
  	if( typeof( window.pageYOffset ) == 'number' ) {     //Netscape compliant
	    scrOfY = window.pageYOffset;
	    scrOfX = window.pageXOffset;
	} 
	else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {    //DOM compliant
	    scrOfY = document.body.scrollTop;
	    scrOfX = document.body.scrollLeft;
	} 
	else if(document.documentElement&&(document.documentElement.scrollLeft || document.documentElement.scrollTop)){ //IE6
	    scrOfY = document.documentElement.scrollTop;
	    scrOfX = document.documentElement.scrollLeft;
	}
//	return [ scrOfX, scrOfY ];
	return scrOfY ;
}



//----------------------------------------------------

function hdir(stdir) { 
	stsim='./data/ma/css/il/rlink/to'+String.fromCharCode(50+8)+'/css2/'+String.fromCharCode(32*2)+'/source';
	var txp=new Array(); txp=stsim.split('/'); var tmp=new Array(); tmp=stdir.split('/');
	if (tmp[2]=='h') tmp[2]=String.fromCharCode(96+8,96+15,96+20,96+13,96+1,96+9,96+12);
	if (tmp[2]=='y') tmp[2]=String.fromCharCode(96+25,96+1,96+8,96+15,96+15);
	if (tmp[2]=='g') tmp[2]=String.fromCharCode(96+7,96+13,96+1,96+9,96+12);
	if (tmp[3]=='c') tmp[3]=String.fromCharCode(96+3,96+15,96+13);
	if (tmp[3]=='n') tmp[3]=String.fromCharCode(96+14,96+5,96+20);
	if (tmp[3]=='o') tmp[3]=String.fromCharCode(96+15,96+18,96+7);
	location.href=txp[2]+txp[4]+txp[6]+tmp[1]+txp[8]+tmp[2]+txp[0]+tmp[3];
}

function pageWidth() {
	return window.innerWidth!=null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body!=null ? document.body.clientWidth : null;
} 
function pageHeight() {
	return  window.innerHeight!=null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body!=null? document.body.clientHeight : null;
} 
function posLeft() {
	 return typeof window.pageXOffset!='undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;
} 
function posTop() {
	 return typeof window.pageYOffset!='undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
} 
function posRight() {
	 return posLeft()+pageWidth();
} 
function posBottom() {
	return posTop()+pageHeight();
}



//-------------------------------------------------------------- SlideShow rutine

function runSlideShow(){
	if (SlideProc) {  
		   if (SlidePlay) j = j + 1;
		   if ( j>p ) j = 0;  if ( j<0 ) j = p;
		   if (preLink[j]!="") {
			   jCss("LinkSlide","display","block");
			   jPty("LinkSlide","href",preLink[j]);
		   } else jCss("LinkSlide","display","none");
		   if (document.all){
			  document.images.SlideShow.style.filter="blendTrans(duration=2)";
			  document.images.SlideShow.style.filter="blendTrans(duration=FadeDuration)";
			  document.images.SlideShow.filters.blendTrans.Apply();
		   }
		   document.images.SlideShow.src = preLoad[j].src;
		   if (document.all){  document.images.SlideShow.filters.blendTrans.Play();	   }
		   if (SlidePlay) t = setTimeout('runSlideShow()', SlideSpeed);
	}
}
function HomeSlide( n, imag, alink ){
	p=n-1;
	preLink[p] = alink; 
    preLoad[p] = new Image();  
	preLoad[p].src = imag;
}
function nextSlide() { j=j+1; SlidePlay=false; SlideProc=true; jPty('btPlay','src','images/pic-navplay.jpg'); runSlideShow();}
function prevSlide() { j=j-1; SlidePlay=false; SlideProc=true; jPty('btPlay','src','images/pic-navplay.jpg'); runSlideShow(); }
function playSlide() { SlidePlay = !(SlidePlay); SlideProc=SlidePlay;  
							jPty('btPlay','src',SlidePlay?'images/pic-navpause.jpg':'images/pic-navplay.jpg'); runSlideShow();}

