// JavaScript Document
/*********************************IMAGE ZOOM*****************************************///width="200" height="200" class="black_overlay" align="middle" <DIV align="center" style="width:'+width+'px; height:'+hit+'px; top:'+zoom_top+'px; left:'+zoom_left+'px;padding:10px;border: 10px solid #CCCCCC; background-postion:center; background-repeat:no-repeat;z-index:100; cursor:pointer; " onclick="hide();"><img src="'+sText+'" align="middle" /></div>

//
var window_Width,window_Height,zoom_Left,zoom_Top,img_Width,img_Height,zoom_Image_width,zoom_Image_height,zoom_actual_Top,width_inc_Value,height_inc_Value,i,zoom_State;
zoom_Image_width=0;
zoom_Image_height=0;
i=5;
function initial_State(){
	zoom_Image_width=0;
	zoom_Image_height=0;
	i=5;
	zoom_Left=0;
	zoom_Top=0;
	img_Width=0;
	img_Height=0;
	zoom_actual_Top=0;
	width_inc_Value=0;
	height_inc_Value=0;
	zoom_State=0;
}
function visible(sText) {
	initial_State();
	window_Width=document.body.clientWidth;
	window_Height=document.body.clientHeight;
	
	zoom_Left=window_Width/2;
	zoom_Top=window_Height/2;	

var ID="MyLayer";
var parentID="Null";
var zoom_Image =new Image();
zoom_Image.src=sText;
img_Width=zoom_Image.width;
img_Height=zoom_Image.height;

zoom_actual_Top=(window_Height-img_Height)/2;
width_inc_Value=img_Width/i;
height_inc_Value=img_Height/i;

sText='<DIV id="zoom" align="center" style="border: 2px solid #000000; cursor:pointer; background-color:white;" onclick="hide();"><img id="zoom_Image" name="zoom_Image" src="'+sText+'" align="middle"/></div>';
document.getElementById("MyLayer").style.display='block';

if (document.layers) {
   var oLayer;
   if(parentID){
     oLayer = eval('document.' + parentID + '.document.' + ID + '.document');
   }else{
     oLayer = document.layers[ID].document;
   }
   oLayer.open();
   oLayer.write(sText);
   oLayer.close();
}
else if (parseInt(navigator.appVersion)>=5&&navigator.appName=="Netscape"){
  	document.getElementById(ID).innerHTML = sText;
	if(zoom_State==0)
		zoom_In(); 	
}
 else if (document.all){
		document.all[ID].innerHTML = sText;
		if(zoom_State==0)
			zoom_In(); 		
	 }
}

function zoom_In(){	
	if(zoom_Image_width<img_Width)
		zoom_Image_width=zoom_Image_width+width_inc_Value;	
	else
		zoom_Image_width=img_Width
		
	if(zoom_Image_height<img_Height){
		zoom_Image_height=zoom_Image_height+height_inc_Value;
		zoom_Top=zoom_Top-(height_inc_Value/2);
	}
	else if(zoom_Top<=zoom_actual_Top){
		zoom_Image_height=img_Height;
		zoom_Top=zoom_actual_Top;
	}
	document.getElementById("zoom").style.width=zoom_Image_width+"px";
	document.getElementById("zoom").style.height=zoom_Image_height+"px";
	document.getElementById("zoom_Image").style.width=zoom_Image_width+"px";
    document.getElementById("zoom_Image").style.height=zoom_Image_height+"px";
	document.getElementById("MyLayer").style.top=zoom_Top+"px";/**/
	if(zoom_Top!=zoom_actual_Top){
		setTimeout("zoom_In()",0.01);
	}
	zom_State=1;
}
function zoom_Out()
{
	i=i-1;
		zoom_Image_width=zoom_Image_width-width_inc_Value;	
		zoom_Image_height=zoom_Image_height-height_inc_Value;
		zoom_Top=zoom_Top+(height_inc_Value/2);
		
		document.getElementById("zoom").style.width=zoom_Image_width+"px";
		document.getElementById("zoom").style.height=zoom_Image_height+"px";
		document.getElementById("zoom_Image").style.width=zoom_Image_width+"px";
		document.getElementById("zoom_Image").style.height=zoom_Image_height+"px";
		document.getElementById("MyLayer").style.top=zoom_Top+"px";
		if(i>0)
			setTimeout("zoom_Out()",.01);	
		else if(i<=0){
			initial_State();
			document.getElementById("zoom").style.display='none';
			document.getElementById("zoom_Image").style.display='none';
			document.getElementById("MyLayer").style.display='none'
		}	
		
}
function hide(){		
	zoom_Out();
}
function status(){
	if((document.getElementById("MyLayer").style.display)=="block"){ 
		document.getElementById("MyLayer").style.display='none'
	}
}
/************************************************************************************/

