////////////////////////////////////////
// media lib
////////////////////////////////////////
var mediaLibWindow

function medialib(id)
{
	pageURL = "/mediaLib.asp?id=" + id;

	mediaLibWindow = window.open(pageURL,"mediaLib","width=200,height=200");
	mediaLibWindow.focus();
}

function closeMediaLib()
{	if (window["mediaLibWindow"]!= null) { window["mediaLibWindow"].close(); }
}


////////////////////////////////////////
// side navigation op
////////////////////////////////////////

function exp(id)
{
	var box = document.getElementById("t"+id);
	if (box == null) return;

	var pls = document.getElementById("p"+id);
	if (pls == null) return
	

	if ((box.exp == "0")||(box.exp == null))
	{
		box.style.display = "block"
		pls.src = "/skin/minus.gif"
		box.exp = "1"
	}
	else
	{
		box.style.display = "none"	
		pls.src = "/skin/plus.gif"
		box.exp = "0"
	}
}

function exp2(id)
{
	var box = document.getElementById("t"+id);
	if (box == null) return;
	
	if (box.style.display == "none") exp(id)

}


function mv(id)
{
	if (id == clkID) return;

	var box = document.getElementById("d"+id);
	if (box == null) alert("notfound");

	switch(box.className)
	{
		case "mn":
			box.className = "ms"; break;
		case "n":
			box.className = "s"; break;
	}
}

function mu(id)
{
	if (id == clkID) return;
	
	var box = document.getElementById("d"+id);
	if (box == null) return;


	switch(box.className)
	{
		case "ms":
			box.className = "mn"; break;
		case "s":
			box.className = "n"; break;
	}
}

function clk(id)
{
	if (id == clkID) return;
	pageURL = "/czk/lang~hr~tID~" + id + "~prod.html"
	parent.location = pageURL	
}

function clk2(id)
{
	if (id == clkID) return;
	pageURL = "/czk/lang~hr~tID~" + id + "~prod2.html"
	parent.location = pageURL	
}


function isEmail(email)
{
	var regex = new RegExp("^[\._a-z0-9-]+@[\.a-z0-9-]+[\.]{1}[a-z]{2,4}$","gi");
    return regex.test(email);
}

////////////////////////////////////////
// head navigation ops
////////////////////////////////////////

//vertical nav
function vOv(id)
{
	obj = document.getElementById("V"+id)
	if (obj != null) obj.className = "vB2";
}

function vOu(id)
{
	obj = document.getElementById("V"+id)
	if (obj != null) obj.className = "vB1";
}

function vCl(link)
{
	document.location = link
}

//horizontal nav

function nOv(id)
{
	obj = document.getElementById("N"+id)
	if (obj != null) obj.className = "hA2";
}

function nOu(id)
{
	obj = document.getElementById("N"+id)
	if (obj != null) obj.className = "hA1";
}

function nOv2(id)
{
	obj = document.getElementById("N"+id)
	if (obj != null) obj.className = "hB2";
}

function nOu2(id)
{
	obj = document.getElementById("N"+id)
	if (obj != null) obj.className = "hB1";
}

function pOv(id,tp)
{
	if (tp==1)
	{
	//close submenu (if active)
		if (actID != 0)
		{
			obj = document.getElementById("S"+actID )
			if (obj != null) obj.style.display = "none";
		}
	
	//open submenu
		obj = document.getElementById("S"+id)
		if (obj != null)
		{
			obj.style.display = "inline";
		}
	
	//change classOld	
		if (actID != 0)
		{
			obj = document.getElementById("R"+actID )
			if (obj != null) obj.className = "navA1"
		}
		
	//change class
		obj = document.getElementById("R"+id)
		if (obj != null) obj.className = "navA2"
		
		actID = id
		ovID = id
	}
	
	if (tp==2)
	{
		if (act2ID != 0)
		{
			obj = document.getElementById("D"+act2ID )
			if (obj!=null) obj.className = "navB1"		
		}
	
		obj = document.getElementById("D"+id )
		if (obj != null) obj.className = "navB2"
	
		act2ID = id
		ovID = id
	}
	
	
}

function reportSide(a)
{
//should wait
	if ((document.frames["side"].load == null) || (document.frames["side"].load == 0)) return;
	document.frames["side"].prodPage(a);
}



////////////////////////////////////////
// cookies
////////////////////////////////////////

function SetPermCookie(name,value)
{
	var expdate = new Date ();
	FixCookieDate (expdate);
	expdate.setTime (expdate.getTime() + (8 * 24 * 60 * 60 * 1000)); // 8 * 24 hrs from now 
	
	SetCookie (name, value, expdate);
}

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function FixCookieDate (date) {
  var base = new Date(0);
  var skew = base.getTime(); // dawn of (Unix) time - should be 0
  if (skew > 0)  // Except on the Mac - ahead of its time
    date.setTime (date.getTime() - skew);
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +  "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

////////////////////
//new old navigation
////////////////////
function rowOver(ID,tip,x)
{
	var di = document.getElementById("R"+ID)
	if (di!=null)
	{ 
		clsName = di.className
		if (clsName.substr(clsName.length - 2) != "ov")
		{
			di.className = di.className + "ov"
		}
	}

	var de = document.getElementById("D" + ID)
	if (de!=null)
	{
		de.style.display = "inline"
	}
	
	if ((tip == 0)&&(x==-1))
	{
		a = document.getElementById("LI"+ID)
		if (a != null) a.src = "/skin/TL2L.gif"
		
		a = document.getElementById("RI"+ID)
		if (a != null) a.src = "/skin/TL2R.gif"
	}
	
}

function rowOut(ID,tip,x)
{
	var di = document.getElementById("R"+ID)
	if (di!=null)
	{ 
		clsName = di.className
		
		if (clsName.substr(clsName.length - 2) == "ov")
		{
			di.className = clsName.substr(0,clsName.length - 2)
		}
	}

	var de = document.getElementById("D" + ID)
	if (de!=null)
	{
		de.style.display = "none"
	}
	
	if ((tip == 0)&&(x==-1))
	{
		a = document.getElementById("LI"+ID)
		if (a != null) a.src = "/skin/TL1L.gif"
		
		a = document.getElementById("RI"+ID)
		if (a != null) a.src = "/skin/TL1R.gif"
	}
	

}

/////////////////
// vert nav dropdown
//////////////////
function vNavOv()
{
	var di = document.getElementById("vertNav")
	if (di!=null) di.style.display = "inline"
}

function vNavOu()
{
	var di = document.getElementById("vertNav")
	if (di!=null) di.style.display = "none"
}


function bxov(i)
{
	obj = document.getElementById("bx"+i)
	if (obj != null) obj.className = "bxov"
}

function bxou(i)
{
	obj = document.getElementById("bx"+i)
	if (obj != null) obj.className = "bxou"
}













 