
// Standard Java Version 2.0


//----------------------------------------------- Browser Check ----------------------------------------------------------------------

  var agent = navigator.userAgent.toLowerCase();
  var name = navigator.appName.toLowerCase();
	
function ScaladoBrowserCHK() {
  

  this.major = parseInt(navigator.appVersion);
  this.minor = parseFloat(navigator.appVersion);


  this.ns  = ((agent.indexOf('mozilla')!=-1) && (agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1) && (agent.indexOf('opera')==-1) && (agent.indexOf('webtv')==-1) && (agent.indexOf('hotjava')==-1));
  this.ns4 = (this.ns && (this.major==4));
  this.ns6up = (this.ns && (this.major >= 5));
  this.ns7 = (this.ns6up && (agent.indexOf("7") !=-1));
  
  this.ie = ((agent.indexOf('msie') != -1) && (agent.indexOf('opera') ==-1));
  this.ie4 = (this.ie && (this.major == 4) && (agent.indexOf("msie 4")!=-1));
  this.ie4up = (this.ie  && (this.major >= 4));
  
  this.opera = (agent.indexOf('opera') != -1);
  
  this.win = ( (agent.indexOf('win')!=-1) || (agent.indexOf('16bit')!=-1));
  this.mac = (agent.indexOf('mac')!=-1); //if (this.mac && this.ie5up) this.js = 1.4;
  
  this.explorer = (this.win && this.ie4up != this.ie4);
  this.netscape = (this.ns4 || this.ns6up);

  this.java = (navigator.javaEnabled());	
  
}


browser = new ScaladoBrowserCHK();



// -------------------------------------- find Object -----------------------------------------------------------------------

function ScaladoObjects(layerName, textString){					// Finds all the object on the html page 

	var p,i,x;

  	if(!textString){ 
  		textString = document;
  	}
  	if((p = layerName.indexOf("?"))> 0 && parent.frames.length){

    		textString = parent.frames[layerName.substring(p+1)].document; layerName = layerName.substring(0,p);
  	}

  	if(!(x = textString[layerName]) && textString.all)			// netscape 4
  	
  		x = textString.all[layerName]; 
  	
  	for (i = 0; !x && i < textString.forms.length; i++) 
  	
  		x = textString.forms[i][layerName];
  		
  	for(i = 0; !x && textString.layers && i < textString.layers.length; i++) 
  	
  		x = ScaladoObjects(layerName,textString.layers[i].document);
	
  	if(!x && document.getElementById)					// netscape 6, explorer
  	
  		x = document.getElementById(layerName); return x;
	}
	

// ----------------------------------- Set TextToLayer -----------------------------------------------------------------


function setTextToLayer(layerName,x,text) {					// write text to layers
	
	var newText = '' + text + '';

  	if ((obj=ScaladoObjects(layerName))!=null) with (obj){
	    	if (document.layers){
	    	
	   		document.write(unescape(newText)); document.close();
		}
		
	    	else{ 
	    		innerHTML = unescape(newText);
		}
	}
}


// ----------------------------------- Set Text ----------------------------------------------------------------------

function setText(layer, text){											


if (browser.ns4){

	setTextToLayer(layer + '_ns4','',text);					// if Netscape 4
	
}else{

	setTextToLayer(layer,'',text);
	
}	
}


// ----------------------------------------- set Viewer ------------------------------------------------------------

var javaViewer = true;						
var flashViewer = false;

