// 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 jDivOn(ObjID){
	Obj = jObj(ObjID);
	Obj.style.display ="block";
}


function jDivOff(ObjID){
	Obj = jObj(ObjID);
	Obj.style.display ="none";
}


function jWrtDear(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 jScrSize() {
  	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 jPosMouseXY(ev){
	if(ev.pageX || ev.pageY) return {x:ev.pageX, y:ev.pageY }; 
	return { x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
		y:ev.clientY + document.body.scrollTop  - document.body.clientTop };
}
//-----------------------------------------------------------

function jPosScrY() {
	 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 locales ----------------------
//-------------------------------------------------------------------------------------------------

function jBtnOver(obj){
	Obj = jObj(obj);
	jCss(obj,'backgroundImage','url(images/bgn-introbtnover.png)');
}

function jBtnUp(obj){
	Obj = jObj(obj);
	jCss(obj,'backgroundImage','url(images/bgn-introbtn.png)');
}

function jDescrOn(ds,txt,ev){   
	Obj = jObj('ds');
	Ob2 = jObj('DescTxt');
	ev = ev || window.event;
	var mPos = jPosMouseXY(ev);
	Obj.style.left=mPos.x-265+"px";
	Obj.style.top = mPos.y-122 +"px";
	Obj.style.display ="block";
	Obj.style.zIndex="100";
	Obj.style.backgroundImage ="url(images/bgn-ballon.png)";
	Ob2.innerHTML = txt;
}
function fnDescrOff(){   
	jDivOff('DescImg');
}



//-----------------------------------------------------------  validations

function checkForm() {
    var why = "";
//	alert( document.BigForma.email.value );
 //   why += isEmail(document.BigForma.email.value);
 //   why += isPhone(document.BigForma.phone.value);
 //   why += isEmpty(document.BigForma.first.value);
  //  why += isEmpty(document.BigForma.last.value);
  //  why += isEmpty(document.BigForma.status.value);
  //  why += isEmpty(document.BigForma.sexo.value);
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}



//-------------------------------------------------------------- non-empty textbox

function isEmpty(strng) { 
var error = "";
  if (strng.length == 0) {
     error = "The mandatory text area has not been filled in.\n";
  }
return error;	  
}


//------------------------------------------------------------ exactly one radio button is chosen

function checkRadio(checkvalue) {
var error = "";
   if (!(checkvalue)) {
       error = "Please check a radio button.\n";
    }
return error;
}

//-------------------------------------------------------------- valid selector from dropdown list

function checkDropdown(choice) {
var error = "";
    if (choice == 0) {
    error = "You didn't choose an option from the drop-down list.\n";
    }    
return error;
}


//-------------------------------------------------------------- SlideShow rutine

function runSlideShow(){

   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)";
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.SlideShow.filters.blendTrans.Apply();
      document.images.SlideShow2.style.filter="blendTrans(duration=2)";
      document.images.SlideShow2.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow2.filters.blendTrans.Apply();
   }
   document.images.SlideShow.src = preLoad[j].src;
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play();
  
   }
   j = j + 1;
   if (j > (p-1)) j=0;
   t = setTimeout('runSlideShow()', slideShowSpeed);
}

