function grayOut(vis, options) {  
	var options = options || {};   
	var zindex = options.zindex || 50;  
	var opacity = options.opacity || 70;  
	var opaque = (opacity / 100);  
	var bgcolor = options.bgcolor || '#000000';  
	var dark=document.getElementById('darkenScreenObject');  
	if (!dark) 
		{    
			var tbody = document.getElementsByTagName("body")[0];    
			var tnode = document.createElement('div');           			// Create the layer.        
			tnode.style.position='absolute';                 				// Position absolutely        
			tnode.style.top='0px';                           				// In the top        
			tnode.style.left='0px';                          				// Left corner of the page        
			tnode.style.overflow='hidden';                   				// Try to avoid making scroll bars                    
			tnode.style.display='none';                      				// Start out Hidden        
			tnode.id='darkenScreenObject';                   				// Name it so we can find it later  			
			tbody.appendChild(tnode);                            			// Add it to the web page    
			dark=document.getElementById('darkenScreenObject');  			// Get the object.  
		}  
	if (vis) 
		{    
			// Calculate the page width and height     
			if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) 
			{        
				var pageWidth = document.body.scrollWidth+'px';        
				var pageHeight = document.body.scrollHeight+'px';    
			} 
			else if( document.body.offsetWidth ) 
			{      
				var pageWidth = document.body.offsetWidth+'px';      
				var pageHeight = document.body.offsetHeight+'px';    
			} 
			else 
			{       
				var pageWidth='100%';       
				var pageHeight='100%';    
			}       
				//set the shader to cover the entire page and make it visible.    
				dark.style.opacity=opaque;                          
				dark.style.MozOpacity=opaque;                       
				dark.style.filter='alpha(opacity='+opacity+')';     
				dark.style.zIndex=zindex;            
				dark.style.backgroundColor=bgcolor;      
				dark.style.width= pageWidth;    
				dark.style.height= pageHeight;    
				dark.style.display='block';                            
			} 
			else 
			{     
				dark.style.display='none';  
			}
		}

	
	function loadFlash(strId,source){
		var el= document.getElementById(strId);
		//el.style.display='block'
		el.src = source;
		el.style.display = el.style.display !=="none" ? "none" : "block";
		el.focus();
		el.style.display='block'
		el.style.left="30px"
	//	e1.style.opacity=opaque; 
		//el.style.left='300 px';
		//el.style.top='300 px';
	}
	function unloadFlash(strId){
		var el= document.getElementById(strId);
		//el.style.display='block'
		//el.style.display = el.style.display !=="none" ? "none" : "block";
		//el.focus();
		el.style.display='none'
	//	e1.style.opacity=opaque; 
		//el.style.left='300 px';
		//el.style.top='300 px';
	}
	
	function CLose(){
	//Window.close();
	//alert('close')
	}

	
// for older flash version.	
var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

	function iecompattest(){
		return (document.compatMode!="BackCompat")? document.documentElement : document.body
	}
	
	function drag_drop(e){
		if (ie5&&dragapproved&&event.button==1){
			document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx+"px"
			document.getElementById("dwindow").style.top=tempy+event.clientY-offsety+"px"
		}
		else if (ns6&&dragapproved){
			document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx+"px"
			document.getElementById("dwindow").style.top=tempy+e.clientY-offsety+"px"
		}
	}
	
	function initializedrag(e){
		offsetx=ie5? event.clientX : e.clientX
		offsety=ie5? event.clientY : e.clientY
		//document.getElementById("dwindowcontent").style.display="none" //extra
		tempx=parseInt(document.getElementById("dwindow").style.left)
		tempy=parseInt(document.getElementById("dwindow").style.top)
		
		dragapproved=true
		document.getElementById("dwindow").onmousemove=drag_drop
	}
		
	function loadwindow(url,width,height){
		//var isbn = document.getElementById("isbn").value;
		//url=url+'?isbn='+isbn;
		if (!ie5&&!ns6)
			window.open(url,"","width=width,height=height,scrollbars=1")
		else {
			document.getElementById("dwindow").style.display=''
			document.getElementById("dwindow").style.width=initialwidth=width+"px"
			document.getElementById("dwindow").style.height=initialheight=height+"px"
			document.getElementById("dwindow").style.left="30px"
			document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+30+"px" : iecompattest().scrollTop*1+30+"px"
			document.getElementById("cframe").src=url
		}
	}
	
	function closeit(){
		document.getElementById("dwindow").style.display="none"
	}
	
	function stopdrag(){
		dragapproved=false;
		document.getElementById("dwindow").onmousemove=null;
		document.getElementById("dwindowcontent").style.display="" //extra
	}
// flash older version -end 	
