﻿function OpenNewWindow(url,name,width,height,resizeAble,scrollbars)
{   var newWindow
	if (!newWindow || newWindow.closed)
	{
		newWindow=window.open(url,name,"height="+height+",width="+width+",toolbar=no,menubar=no,scrollbars="+scrollbars+",resizable="+resizeAble+", location=no,status=no;") 
		newWindow.focus();
	}
	else
	{
		newWindow.location=url;
		newWindow.focus();
	}
}
function OpenNewModalDialog(url,width,height,resizeAble)
{	
	var relVal;	
	//window.open(url)
	relVal=window.showModalDialog("ModalDialogContainer.aspx",url,"dialogWidth:"+width+"px;dialogHeight:"+height+"px;center:yes;help:no;resizable:"+resizeAble+";status:no;scroll:no")
	if(relVal=="reload")
		{
			window.location.href=window.location.href;
			window.location.reload(); 
		}
}

function OpenNewModelessDialog(url,width,height,resizeAble,enableScroll)
{	
	var relVal;	
	//window.open(url)
	relVal=window.showModelessDialog(url,"","dialogWidth:"+width+"px;dialogHeight:"+height+"px;center:yes;help:no;resizable:"+resizeAble+";status:no;scroll:"+enableScroll)
	if(relVal=="reload")
		{
			window.location.href=window.location.href;
			window.location.reload(); 
		}
}

function ShowOrHideElement(elementID,showStatusCss,hideStatusCss)
{
	try
	{
	
		var o=document.getElementById(elementID)
	   		if (o==null)return;
		
		if (o.style.display=="block"||o.className==showStatusCss)
		{
		
			if(hideStatusCss=="")
				o.style.display="none"
			else
				o.className=hideStatusCss
		}
		else
		{
			if(showStatusCss=="")
				o.style.display="block";
			else
				o.className=showStatusCss;
		}
	}
	catch(e){}	
}

