/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////


var Br=new BrCheck()

/////////////////////////////////////////////////////////////////////////

function BrCheck()
{
	this.VER	= navigator.appVersion;
	this.AGENT	= navigator.userAgent;
	this.DOM	= document.getElementById ?true:false;

//	this.Fla	= (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) ?true:false;
//	if (this.Fla && (this.FlaV = navigator.plugins["Shockwave Flash"].description.indexOf(".")) != - 1)
//	{
//		this.FlaV = navigator.plugins["Shockwave Flash"].description.substring(this.FlaV-1, this.FlaV);
//		this.FlaV = parseInt(this.FlaV);
//	}
//	this.Fla5	= (this.FlaV >=5)											?true:false;
	    
	this.OP5	= this.AGENT.indexOf("Opera 5")>-1							?true:false;
	this.OP6	= this.AGENT.indexOf("Opera 6")>-1							?true:false;
	this.OP7	= this.AGENT.indexOf("Opera 7")>-1							?true:false;
	this.OP		= (this.OP5 || this.OP6 || this.OP7)
		
//	this.MAC	= this.AGENT.indexOf("Mac")>-1								?true:false;
	    
	this.IE4	= (document.all && !this.DOM && !this.OP)					?true:false;
	this.IE5	= (this.VER.indexOf("MSIE 5")>-1 && this.DOM && !this.OP)	?true:false; 
	this.IE6	= (this.VER.indexOf("MSIE 6")>-1 && this.DOM && !this.OP)	?true:false;
	this.IE		= (this.IE4 || this.IE5 || this.IE6)

	this.NS4	= (document.layers && !this.DOM)							?true:false;
	this.NS7	= (this.DOM && parseInt(this.VER) >= 5 && this.AGENT.lastIndexOf('Netscape')<this.AGENT.lastIndexOf('7'))?true:false;
	this.NS6	= (this.DOM && parseInt(this.VER) >= 5 && !this.NS7)		?true:false;
	this.NS		= (this.NS4 || this.NS6 || this.NS7)
		
//	this.OK4	=(!this.OP && (this.IE6 || this.IE5 || this.IE4 || this.NS4 || this.NS6))
//	this.OK5	=(!this.OP && (this.IE6 || this.IE5 || this.NS6))
//	this.OK6	=(!this.OP && (this.IE6 || this.NS6))
		
		
//	this.OK_BuyIframe = (this.IE6 || this.OP7 || this.NS7)		//kompatibilita iframe nakupovani
//	this.OK_CATMenu =	(this.IE || this.OP7 || this.NS7)		//kompatibilita menu
		
	return this
}

/////////////////////////////////////////////////////////////////////////

function getE(objName)							//vraci objekt, podle typu browseru
{
	if (Br.IE)
		return document.all[objName]
	else
		return document.getElementById(objName)
}

function getF(formName)	{return document.forms[formName]}	//vraci form podle name

function getF_byE(objName)	{return getE(objName).form}		//vraci form objektu

function submitF_disableE(formName, aryDisableValues)		//disabluje nepouzivane hodnoty formulare, at neni velky querystring
{
	var f = getF(formName)
	var a = aryDisableValues.split("|")
	
	for (var i=0; i<f.length; i++)
	{	
		var e=f.elements[i];
		for (var j=0; j<a.length; j++)
			if (e.value == a[j])
				e.disabled = true;
	}
}



/////////////////////////////////////////////////////////////////////////

function objShow(obj)				{obj.style.visibility = '';}
function objHide(obj)				{obj.style.visibility = 'visible';}

function objX(e)
{
	var x = 0;
	while (typeof e == 'object' && e.tagName != 'BODY')
	{
		x += e.offsetLeft;
		e = e.offsetParent;
	}
	
//	var x = 0;
//	do x += o.offsetLeft; while ((o = o.offsetParent));
	
	return x;
}

function objY(e)
{
	var y = 0;
	while (typeof e == 'object' && e.tagName != 'BODY')
	{
		y += e.offsetTop;
		e = e.offsetParent;
	}
	return y;
}


/////////////////////////////////////////////////////////////////////////
function jsListSortChange(e)
{
	getE('idListSubUp').className = 'SubUp1'
	getE('idListSubDown').className = 'SubDown1'
}

function jsOBDelPayChng(sPriceSum)
{
	getE('idPriceSumWithVat').innerHTML = sPriceSum
}