var isIE=(window.navigator.appName.indexOf("Internet Explorer")!=-1?true:false);
var DisplayTR="block";
if (isIE==false)
{
	DisplayTR="table-row";
	HTMLElement.prototype.contains=function (Element) {
		if (Element==this) return true;
		if (Element==null) return false;
		return this.contains(Element.parentNode);
	};
}

function FindPositionX(Element)
{
	var CurentLeft=0;
	if (Element==null) return CurentLeft;
	if (Element.offsetParent)
	{
		while (Element.offsetParent)
		{
			CurentLeft+=Element.offsetLeft;
			Element=Element.offsetParent;
		}
	}
	else
		if (Element.x)
			CurentLeft+=Element.x;
	return CurentLeft;
}

function FindPositionY(Element)
{
	var CurentTop=0;
	if (Element==null) return CurentTop;
	if (Element.offsetParent)
	{
		while (Element.offsetParent)
		{
			CurentTop+=Element.offsetTop;
			Element=Element.offsetParent;
		}
	}
	else
		if (Element.y)
			CurentTop+=Element.y;
	return CurentTop;
}

function OnMouseOverRow(evt,Row)
{
}

function OnMouseOutRow(evt,Row)
{
}

var HintMode=null;
function ShowItemHint(evt,Row)
{
}

function HideItemHint(evt,Hint)
{
}

function OpenGalleryWindow(Portal,Path,Provider,TargetControl,Value)
{
	var DataProvider=window.open(Path+"?portal="+Portal+"&target="+TargetControl+"&provider="+Provider+(Value!=undefined?"&value="+encodeURI(Value):""),"DataProvider","width=700,height=600,toolbars=0,resizable=1");
	DataProvider.focus();	
	return false;
}

function fpost(FilterParams)
{
	document.getElementById("FilterParams").value=FilterParams.replace(/\./g,";");
	var ID=document.getElementById("ProductListPageID").value;
	if (document.forms[0].action.indexOf("alias")!=-1)
		document.forms[0].action="http://"+document.forms[0].action.substr(document.forms[0].action.lastIndexOf("?alias=")+7)+"/tabid/"+ID+"/Default.aspx";
	else
		if (document.forms[0].action.indexOf("tabid")!=-1)
			document.forms[0].action=document.forms[0].action.replace(/tabid\/\d+/,"tabid/"+ID);
		else
			document.forms[0].action=document.forms[0].action.substr(0,document.forms[0].action.lastIndexOf("/")+1)+"tabid/"+ID+"/default.aspx";
	if (document.getElementsByName("__VIEWSTATE")[0])
		document.getElementsByName("__VIEWSTATE")[0].name="__NOVIEWSTATE";
	if (document.getElementsByName("__EVENTTARGET")[0])
		document.getElementsByName("__EVENTTARGET")[0].name="__NOEVENTTARGET";
	if (document.getElementsByName("__EVENTARGUMENT")[0])
		document.getElementsByName("__EVENTARGUMENT")[0].name="__NOEVENTARGUMENT";
	document.forms[0].submit();
}