// JavaScript Document
var direction=0;
function scrollProductNavi()
	{
	if(document.getElementById('productNavi') && document.getElementById('productNaviContainer'))
		{
		if((typeof document.getElementById('productNavi').offsetHeight)=="number")
			{
			if(document.getElementById('productNavi').offsetHeight > document.getElementById('productNaviContainer').offsetHeight)
				{
				//hide scrollbars
				document.getElementById('productNaviContainer').style.overflow="hidden";
				//add scroll buttons
				var scrollDown=document.createElement("img");
				scrollDown.src="shared/images/scroll_down.gif";
				scrollDown.id="scrollDown";
				scrollDown.style.position="absolute";
				scrollDown.style.top="455px";
				scrollDown.style.left="138px";
				scrollDown.style.cursor="pointer";
				scrollDown.onmousedown=new Function("direction=-2;scrollIt()");
				scrollDown.onmouseup=new Function("direction=0;");
				document.getElementById('mainContainer').appendChild(scrollDown);
				
				var scrollUp=document.createElement("img");
				scrollUp.src="shared/images/scroll_up.gif";
				scrollUp.id="scrollDown";
				scrollUp.style.position="absolute";
				scrollUp.style.top="158px";
				scrollUp.style.left="138px";
				scrollUp.style.cursor="pointer";
				scrollUp.onmousedown=new Function("direction=2;scrollIt()");
				scrollUp.onmouseup=new Function("direction=0;");
				document.getElementById('mainContainer').appendChild(scrollUp);	
				}
			else
				{
				//hide scrollbars
				document.getElementById('productNaviContainer').style.overflow="hidden";	
				}
			
			}
		}
	}
	
function scrollIt()
	{
	var top=parseInt(document.getElementById("productNavi").style.top)+direction;
	if(direction && direction>0)
		{
		if(top<=0)
			{
			document.getElementById("productNavi").style.top=top+"px";	
			window.setTimeout("scrollIt()",20);	
			}
		}
	if(direction && direction<0)
		{
		var maxscroll=document.getElementById('productNavi').offsetHeight-document.getElementById('productNaviContainer').offsetHeight;
		if(Math.abs(top)<maxscroll)
			{
			document.getElementById("productNavi").style.top=top+"px";	
			window.setTimeout("scrollIt()",20);	
			}
		}
	}


function setPosition(height)
	{
	if(window.innerHeight)
		{
		var avail_height=parseInt(window.innerHeight);
		var avail_width=parseInt(window.innerWidth);
		}
	else
		{
		var avail_height=parseInt(document.body.offsetHeight);
		var avail_width=parseInt(document.body.offsetWidth);
		}
	var padTop=(avail_height-height)/2;
	
	document.getElementsByTagName("body")[0].style.height=height+"px";
	document.getElementsByTagName("body")[0].style.paddingTop=padTop+"px";
	}
	
function insertFlash()
	{
	if(document.getElementsByTagName("object").length>0)
		{
		for(var i=0;i<document.getElementsByTagName("object").length;i++)
			{
			var tmpNode=document.createElement("div");
			tmpNode.appendChild(document.getElementsByTagName("object")[i].cloneNode(true));	
			var parNode=document.getElementsByTagName("object")[i].parentNode;
			parNode.removeChild(document.getElementsByTagName("object")[i]);
			parNode.innerHTML+=tmpNode.innerHTML;
			}
		}
	/*
	if(entry_id)
		{
		src=src+'?entry_id='+entry_id;	
		}
	str='<object id=\"'+object_id+'\" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'">';
    str+='<param name="movie" value="'+src+'" />';
    str+='<param name="quality" value="high" />';
	str+='<embed src="'+src+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>';
	str+='</object>';
	if(document.getElementById(object_id))
		{
		document.getElementById("mainContainer").removeChild(document.getElementById(object_id));	
		}
	document.getElementById("mainContainer").innerHTML+=str;
	*/
	}
	

var active_elem;
var check=0;
function showSubMenu(elem)
	{
	hideSubMenu();
	if(elem && elem.nextSibling && elem.nextSibling.nodeName=="UL")
		{
		elem.nextSibling.style.display="block";	
		active_elem=elem.nextSibling;
		}
	}
	
function hideMe(elem)
	{
	if(elem)
		{
		window.setTimeout(hideSubMenu,1000);	
		}
	}
	
function hideSubMenu()
	{
	if(active_elem && active_elem.style && check==0)
		{
		active_elem.style.display="none";	
		}
	}
	
// JavaScript Document
function init()
	{
	if(window.XMLHttpRequest) 
		{
		var xmlHTTP = new XMLHttpRequest();
		} 
	else if(window.ActiveXObject) 
			{
			var xmlHTTP = new ActiveXObject("Microsoft.XMLHTTP");
			}	
	if(xmlHTTP)
		{
		return xmlHTTP;	
		}
	else
		{
		return false;	
		}
	}
	
function makeRequest(src_file,method,vars)
	{
	if(xmlHTTP=init())
		{
		var postvars=vars;
		xmlHTTP.open(method,src_file,true);
		xmlHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		xmlHTTP.send(postvars);
		xmlHTTP.onreadystatechange=function()
			{
			if(xmlHTTP.readyState==4)
				{
				//alert(xmlHTTP.responseText);
				}
			}
		}	
	}
	
	

	



