/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="local" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById) //DynamicDrive.com change
{ 
	document.write('<style type="text/css">\n')
	document.write('.submenu{display: none;}\n')
	document.write('</style>\n')
}

function SwitchMenu(obj)
{
	if(document.getElementById)
	{
		var el = document.getElementById(obj);
		var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(el.style.display != "block") //DynamicDrive.com change
		{ 
			for (var i=0; i<ar.length; i++)
			{
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}
		else
		{
			el.style.display = "none";
		}
	}
}

function get_cookie(Name)
{ 
	var search = Name + "="
	var returnvalue = "";
	if (document.cookie.length > 0)
	{
		offset = document.cookie.indexOf(search)
		if (offset != -1)
		{ 
			offset += search.length
			end = document.cookie.indexOf(";", offset);
			if (end == -1) 
				end = document.cookie.length;
			returnvalue=unescape(document.cookie.substring(offset, end))
		}
	}
	return returnvalue;
}

function onloadfunction()
{
	if (persistmenu=="yes")
	{
		var cookiename = (persisttype == "sitewide") ? "switchmenu" : window.location.pathname;
		var cookievalue = get_cookie(cookiename);
		var cookiepagevalue = get_cookie("PATHNAME");
		if (cookievalue!="" && cookiepagevalue == window.location.pathname )
			document.getElementById(cookievalue).style.display="block";
	}
}

function savemenustate()
{
	var inc=1, blockid="";
	while (document.getElementById("sub"+inc))
	{
		if (document.getElementById("sub"+inc).style.display=="block")
		{
			blockid="sub"+inc
			break
		}
	inc++
	}
	var cookiename = (persisttype == "sitewide") ? "switchmenu" : window.location.pathname;
	var cookievalue = (persisttype == "sitewide") ? blockid + ";path=/" : blockid;
	document.cookie=cookiename+"="+cookievalue
	document.cookie="PATHNAME"+"="+window.location.pathname
}

if (window.addEventListener)
	window.addEventListener("load", onloadfunction, false);
else if (window.attachEvent)
	window.attachEvent("onload", onloadfunction);
else if (document.getElementById)
	window.onload=onloadfunction;

if (persistmenu=="yes" && document.getElementById)
	window.onunload=savemenustate;
	
function Flash()
{
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	return bFlashPlugin;
}

function DimenzijaInfoToolTip(OnOff, PodskupinaId, Lang)
{
	/***********************************************
	* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
	* This notice MUST stay intact for legal use
	* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
	***********************************************/

	var offsetxpoint=-60 //Customize x offset of tooltip
	var offsetypoint=20 //Customize y offset of tooltip
	var ie=document.all
	var ns6=document.getElementById && !document.all
	var enabletip=false
	if (ie||ns6)
	var tipobj=document.all? document.all["DimenzijaInfoToolTip"] : document.getElementById? document.getElementById("DimenzijaInfoToolTip") : ""
	
	var opcija1 = "Dimenzije: XxYxZ (cm)<br>Npr.: 200x100x50<br><br>X - dolžina<br>Y - širina<br>Z - višina";
	var opcija2 = "Dimenzije: XxYxZ (cm)<br>Npr.: 200x100x50<br><br>X - širina<br>Y - globina<br>Z - višina";
	var opcija3 = "Dimenzije: XxYxZ (cm)<br>Npr.: 200x100x50<br><br>X - dolžina<br>Y - globina<br>Z - višina";
	var opcija4 = "Dimenzije: X1/X2xYxZ (cm)<br>Npr.: 200/300x100x50<br><br>X1 - dolžina 1 (osnovna)<br>X2 - dolžina 2 (raztegnjena)<br>Y - širina<br>Z - višina";
	var opcija5 = "Dimenzije: X1/X2/X3xYxZ (cm)<br>Npr.: 400/300/200x100x50<br><br>X1 - dolžina 1 (trosed)<br>X2 - dolžina 2 (dvosed)<br>X3 - dolžina 3 (enosed)<br>Y - globina<br>Z - višina";
	var opcija6 = "Dimenzije: X1xX2xYxZ (cm)<br>Npr.: 300x200x100x50<br><br>X1 - dolžina 1<br>X2 - dolžina 2<br>Y - globina<br>Z - višina";
	
	if ( Lang == "EN" )
	{
		opcija1 = "Dimension: XxYxZ (cm)<br>Example: 200x100x50<br><br>X - length<br>Y - width<br>Z - height";
		opcija2 = "Dimension: XxYxZ (cm)<br>Example: 200x100x50<br><br>X - width<br>Y - depth<br>Z - height";
		opcija3 = "Dimension: XxYxZ (cm)<br>Example: 200x100x50<br><br>X - length<br>Y - depth<br>Z - height";
		opcija4 = "Dimension: X1/X2xYxZ (cm)<br>Example: 200/300x100x50<br><br>X1 - length 1 (basic)<br>X2 - length 2 (extention)<br>Y - width<br>Z - height";
		opcija5 = "Dimension: X1/X2/X3xYxZ (cm)<br>Example: 400/300/200x100x50<br><br>X1 - length 1 (threeseater)<br>X2 - length 2 (twoseater)<br>X3 - length 3 (oneseater)<br>Y - depth<br>Z - height";
		opcija6 = "Dimension: X1xX2xYxZ (cm)<br>Example: 300x200x100x50<br><br>X1 - length 1<br>X2 - length 2<br>Y - depth<br>Z - height";		
	}
	
	var thetext = "<table width=100% border=0 cellspacing=0 cellpadding=2>";
	
	if ( PodskupinaId == 1 )
	{
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija1 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
		thetext += "<tr><td colspan=2><img src=\"Images/pix-vijola.gif\" width=100% height=1></td></tr>"
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija4 + "</td><td width=35%><img src=\"Images/legenda-x1x2yz.gif\"></td></tr>"	
	}
	else if ( PodskupinaId == 2 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija2 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 3 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija6 + "</td><td width=35%><img src=\"Images/legenda-x1x2yz-kotna.gif\"></td></tr>"
	else if ( PodskupinaId == 4 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija2 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 5 )
	{
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija5 + "</td><td width=35%><img src=\"Images/legenda-x1x2x3yz.gif\"></td></tr>"
		thetext += "<tr><td colspan=2><img src=\"Images/pix-vijola.gif\" width=100% height=1></td></tr>"
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija6 + "</td><td width=35%><img src=\"Images/legenda-x1x2yz-kotna.gif\"></td></tr>"
	}
	else if ( PodskupinaId == 6 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija2 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 7 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija3 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 8 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija2 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 9 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija1 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 10 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija1 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 11 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija1 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 12 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija1 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 13 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija1 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 14 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija2 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 15 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija2 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 16 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija2 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 17 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija2 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 18 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija2 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 19 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija2 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 20 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija2 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
	else if ( PodskupinaId == 21 )
		thetext += "<tr><td width=65% class=\"DimenzijaInfoToolTipTabela\">" + opcija2 + "</td><td width=35%><img src=\"Images/legenda-xyz.gif\"></td></tr>"
		
	thetext += "</table>";
			
	if ( OnOff == "on" )
		ddrivetip(thetext);
	else
		hideddrivetip();
		
	function ietruebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}

	function ddrivetip(thetext, thecolor, thewidth){
	if (ns6||ie){
	if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
	if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
	tipobj.innerHTML=thetext
	enabletip=true
	return false
	}
	}

	function positiontip(e){
	if (enabletip){
	var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
	var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
	//Find out how close the mouse is to the corner of the window
	var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
	var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

	var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

	//if the horizontal distance isn't enough to accomodate the width of the context menu
	if (rightedge<tipobj.offsetWidth)
	//move the horizontal position of the menu to the left by it's width
	tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
	else if (curX<leftedge)
	tipobj.style.left="5px"
	else
	//position the horizontal position of the menu where the mouse is positioned
	tipobj.style.left=curX+offsetxpoint+"px"

	//same concept with the vertical position
	if (bottomedge<tipobj.offsetHeight)
	tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
	else
	tipobj.style.top=curY+offsetypoint+"px"
	tipobj.style.visibility="visible"
	}
	}

	function hideddrivetip(){
	if (ns6||ie){
	enabletip=false
	tipobj.style.visibility="hidden"
	tipobj.style.left="-1000px"
	tipobj.style.backgroundColor=''
	tipobj.style.width=''
	}
	}

	document.onmousemove=positiontip
}
