	
	
	if(Hoffset=="")
	{
		var Hoffset=400 //Enter buttons' offset from right edge of window (adjust depending on images width)
		var Voffset=200 //Enter buttons' offset from bottom edge of window (adjust depending on images height)
	}
	
	var thespeed=3 //Enter scroll speed in integer (Advised: 1-3)
	
	var ieNOTopera=document.all&&navigator.userAgent.indexOf("Opera")==-1
	var myspeed=0
	
	var ieHoffset_extra=document.all? 15 : 0
/*
	var cross_obj=document.all? document.all.staticbuttons : document.getElementById? document.getElementById("staticbuttons") : document.staticbuttons
*/


function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function positionit(tmpobj,tmpHoffset,tmpVoffset)
{
	if(tmpHoffset>0)
		Hoffset=tmpHoffset;
	
	if(tmpVoffset>0)
		Voffset=tmpVoffset;
		
	var cross_obj=tmpobj;
	
	var dsocleft=document.all? iecompattest().scrollLeft : pageXOffset
	var dsoctop=document.all? iecompattest().scrollTop : pageYOffset
	var window_width=ieNOTopera? iecompattest().clientWidth+ieHoffset_extra : window.innerWidth+ieHoffset_extra
	var window_height=ieNOTopera? iecompattest().clientHeight : window.innerHeight
	
	
	if (document.all||document.getElementById)
	{
		//cross_obj.style.left=parseInt(dsocleft)+parseInt(window_width)-Hoffset+"px"
		//cross_obj.style.top=dsoctop+parseInt(window_height)-Voffset+"px"
		
		cross_obj.style.left=parseInt(window_width/2)-Hoffset+"px"
		cross_obj.style.top=dsoctop+parseInt(window_height/2)-Voffset+"px"
		
	}
	else if (document.layers)
	{
		//cross_obj.left=dsocleft+window_width-Hoffset
		//cross_obj.top=dsoctop+window_height-Voffset
		
		cross_obj.left=(window_width/2)-Hoffset
		cross_obj.top=dsoctop+(window_height/2)-Voffset
	}
	
}


function scrollwindow(){
window.scrollBy(0,myspeed)
}

function initializeIT(tmpobject,tmpHoffset,tmpVoffset)
{
	positionit(tmpobject,tmpHoffset,tmpVoffset)
	if (myspeed!=0)
	{
		scrollwindow()
	}
}

function grayOut(vis, options) 
{  
	// Pass true to gray out screen, false to ungray  
	// options are optional.  This is a JSON object with the following (optional) properties  
	// opacity:0-100         
	// Lower number = less grayout higher = more of a blackout   
	// zindex: #   // HTML elements with a higher zindex appear on top of the gray out  
	// bgcolor: (#xxxxxx)   // Standard RGB Hex color code 
	// grayOut(true, {'zindex':'50', 'bgcolor':'#0000FF', 'opacity':'70'});  
	// Because options is JSON opacity/zindex/bgcolor are all optional and can appear  
	// in any order.  Pass only the properties you need to set.  
	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');           
		tnode.style.position='absolute';
		tnode.style.top='0px';
		tnode.style.left='0px'; 
		tnode.style.overflow='hidden';
		tnode.style.display='none'; 
		tnode.id='darkenScreenObject';
		tbody.appendChild(tnode); 
		dark=document.getElementById('darkenScreenObject');
	}
	
	if (vis) 
	{
		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%';
		}  
		
		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';  
	}
}


<!-- Popup Coading -->

function popupshow_product(tmpdivname,tmpHoffset,tmpVoffset)
{
	grayOut(true); 
	
	document.getElementById(tmpdivname).style.display="inline";
	
	//var tmppopupdiv=eval('document.getElementById("'+tmpdivname+'_pop")');
	//tmppopupdiv.style.display="inline";
	
	setInterval("initializeIT(document.getElementById('"+tmpdivname+"'),"+tmpHoffset+","+tmpVoffset+")",20)
	
	//grayOut(false); 
	return false;
}
function popuphide_product(tmpdivname)
{
	document.getElementById(tmpdivname).style.display="none";
	//var tmppopupdiv=eval('document.getElementById("'+tmpdivname+'_pop")')
	//tmppopupdiv.style.display="none";
	
	setInterval("initializeIT(document.getElementById('"+tmpdivname+"'))",20)
	grayOut(false); 
	return false;
}

function popupshow(tmpdivname,tmpHoffset,tmpVoffset)
{
	grayOut(true); 
	
	document.getElementById(tmpdivname).style.display="inline";
	
	var tmppopupdiv=eval('document.getElementById("'+tmpdivname+'_pop")');
	tmppopupdiv.style.display="inline";
	
	//setInterval("initializeIT(document.getElementById('"+tmpdivname+"'),"+tmpHoffset+","+tmpVoffset+")",20)
	
	
		var left = (screen.width/2)-(tmpHoffset/2);
		var top = (screen.height/2)-(tmpVoffset/2);
		//alert(left+"=="+top);
		setInterval("initializeIT(document.getElementById('"+tmpdivname+"'),"+left+","+top+")",20);
	
	//grayOut(false); 
	return false;
}
	
function popuphide(tmpdivname)
{
	document.getElementById(tmpdivname).style.display="none";
	var tmppopupdiv=eval('document.getElementById("'+tmpdivname+'_pop")')
	tmppopupdiv.style.display="none";
	
	setInterval("initializeIT(document.getElementById('"+tmpdivname+"'))",20)
	grayOut(false); 
	return false;
}

function popupshowmap(tmpdivname,tmpHoffset,tmpVoffset)
{
	
	grayOut(true); 
	
	setInterval("initializeIT(document.getElementById('"+tmpdivname+"'),"+tmpHoffset+","+tmpVoffset+")",20)
	document.getElementById(tmpdivname).style.display="inline";

	return false;
}
