
// JavaScript ImageZoom Professional Java Version 2.0.7


//----------------------------------------------- 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.win = ( (agent.indexOf('win')!=-1) || (agent.indexOf('16bit')!=-1));
	  this.mac = (agent.indexOf('mac')!=-1);
	  this.macOsX = (this.mac && (agent.indexOf('mac os x')!= -1));
	  
	  
	  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.Omniweb = (agent.indexOf("omniweb") != -1);
	  this.iCab = (agent.indexOf("icab") != -1);
	  this.iCab2 = (this.iCab != this.macOsX);
	  this.iCab2up = (this.iCab && this.macOsX);
	  
	  this.winExplorer = (this.win && this.ie4up != this.ie4);
	  this.winNetscape = (this.ns4 || this.ns6up || this.iCab2 != this.macOsX);
	  this.macNetscape = (this.macOsX && this.ns4 || this.macOsX && this.ns6up || this.iCab2up);
	  
	  this.liveConnect = (this.winExplorer || this.winNetscape != this.macNetscape);
	  this.flash = (this.ns7 && this.macOsX);
	
	  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);
	
}	
}


// ------------------------------- isDone -----------------------------------------------------------

function isDone(){

	return document.ImageZoom.isDone();
	var value = document.ImageZoom.isDone();

		if (value == 1){

		}
		if (value == 0){
	
		}
}


// ------------------------------ zoomToTag ---------------------------------------------------------

function zoomToTag(string){

	document.ImageZoom.zoomToTag(string);

}

// ------------------------------ fadeToTag ---------------------------------------------------------

function fadeToTag(string){

	document.ImageZoom.fadeToTag(string);
}


// ------------------------------ setZoomMode --------------------------------------------------------

function setZoomMode(integer){

	document.ImageZoom.setZoomMode(integer);
}


// ------------------------------ setZoomTime ---------------------------------------------------------

function setZoomTime(integer){

	document.ImageZoom.setZoomTime(integer);
}


// ------------------------------ setStartView ---------------------------------------------------------

function setStartView(string){

	document.ImageZoom.setStartView(string);
}


// ------------------------------ setArrowStyle ---------------------------------------------------------

function setArrowStyle(integer){

	document.ImageZoom.setArrowStyle(integer);
}


// ------------------------------- setArrowSize ---------------------------------------------------------

function setArrowSize(integer){

if (!integer){

	document.ImageZoom.setArrowSize(3);
}
else{

	document.ImageZoom.setArrowSize(integer);
}
}


// ------------------------------- setArrowColor ---------------------------------------------------------

function setArrowColor(string){

	document.ImageZoom.setArrowColor(string);
}


// ------------------------------ setArrowThinColor -------------------------------------------------------

function setArrowThinColor(string){

  	document.ImageZoom.setArrowThinColor(string);
}


// ---------------------------- setMaskImage / setMaskAlpha ------------------------------------------------

function setMask(maskstring, alphastring){

  	document.ImageZoom.setMaskImage(maskstring);
	document.ImageZoom.setMaskAlpha(alphastring);

}


// ----------------------------------- enableMasks ---------------------------------------------------------

function enableMasks(){

	document.ImageZoom.enableMasks();
}


// ---------------------------------- disableMasks ---------------------------------------------------------

function disableMasks(){

	document.ImageZoom.disableMasks();
}


// -------------------------------- loadParametersEffect ------------------------------------------------------

function loadParametersEffect(string, effect){

	document.ImageZoom.loadParameters2(string, effect);
}


// -------------------------------- loadParametersEffectTag ------------------------------------------------------

function loadParametersEffectTag(filename, effect, tag){
		
	document.ImageZoom.loadParametersTag3(filename, effect, tag);
}


// -------------------------------- loadParametersDirection ---------------------------------------------------

function loadParametersDirection(string, effect, direction){

	document.ImageZoom.loadParameters3(string, effect, direction);
}


// -------------------------------- loadParametersDirectionTag ---------------------------------------------------

function loadParametersDirectionTag(filename, effect, direction, tag){
		
	document.ImageZoom.loadParametersTag4(filename, effect, direction, tag);

}


// ---------------------------------------- loadParameters --------------------------------------------------------


function loadParameters(file, effect, dir, tag) {
       
if (typeof dir == "undefined") {
	
	document.ImageZoom.loadParameters2(file, effect);
}
	
else if (typeof dir == "number") {

	if (typeof tag == "undefined") {
		
		document.ImageZoom.loadParameters3(file, effect, direction);
	}
	else {
		document.ImageZoom.loadParametersTag4(file, effect, direction, tag);         
	}
	}
	
else {
		document.ImageZoom.loadParametersTag3(file, effect, direction);
}
}


// ----------------------------------------- wait --------------------------------------------------------------

function wait(integer){

	document.ImageZoom.sleep(integer);
}


// ----------------------------------------- set Viewer ------------------------------------------------------------

var javaViewer = true;						// note only for function template
var flashViewer = false;

