

function OpenWin(url,scrollbars)
{
		window.status = "";
		strFeatures = "top=57,left=200,width=400,height=300,toolbar=no,menubar=no,location=no,scrollbars=" +scrollbars+ ",directories=no";
		newWin = window.open (url, "_blank", strFeatures);
		return false;
}

function OpenWinSize(url,scrollbars)
{
		window.status = "";
		strFeatures = "top=57,left=200,width=600,height=450,toolbar=no,menubar=no,location=no,scrollbars=" +scrollbars+ ",directories=no";
		newWin = window.open (url, "_blank", strFeatures);
		return false;
}

function OpenNewWin(url,scrollbars,width,height)
{
		window.status = "";
		strFeatures = "top=57,left=200,width=" + width + ",height="  + height + ",toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=" +scrollbars+ ",directories=no";
		newWin = window.open (url, "_blank", strFeatures);
		return false;
}

function OpenRadWin(url,scrollbars,width,height)
{
            var oWnd = radopen(url, "RadWindow1" );
            oWnd.center();
            return false;
}

function OpenEditWin(url) {

    window.status = "";
    strFeatures = "top=0,left=0,width=" + window.screen.width + ",height=" + window.screen.height + ",toolbar=no,menubar=no,location=no,scrollbars=no,directories=no";
    newWin = window.open(url, "_blank", strFeatures);
    return false;
}

function toUnicode(str)
{
		var rExp = "/&#([0-9]+);/gi";
		//try
		//{
			return str.replace(rExp, function (str, n){return String.fromCharCode(n);});
		//}
		//catch(e)
		//{
		//	return "Your browser does not support required version of Javascript.";
		//}    
}

function makeLink(){
if(document.all)
window.external.AddFavorite(url,title)
}

function makeLinkURL(url, title){
	
	window.external.AddFavorite(url,title)
}

		
function ShowWaitButton(btn)
{
    btn.value = "Please, wait...";
    btn.enabled = false;
}

function delConfirmBox()
	{
		if (confirm('Are you sure you want to delete this item?'))
		{
			return true;
		}
		else
			return false;
	}
	
	

	function doSwitch(which){
	for(i=1;i<=2;i++){
		var n = document.getElementById("contentoption"+i);
		var m = document.getElementById("hlink"+i);
		n.style.display="none";
		m.firstChild.className="";
	}	
	var n = document.getElementById("contentoption"+which);
	var m = document.getElementById("hlink"+which);
	n.style.display="block";
	m.firstChild.className="on";
}




function OpenHelpWin(subject)
{
	var url;
	
	switch (subject)
	{
		case "ORDERS": 
			url = "/help/viewCat.aspx?sub_cat_id=83";
			break;
			
		case "PORTALACCOUNT":
			url = "/help/viewCat.aspx?sub_cat_id=82";
			break;
		
		case "WORKFLOWS":
			url = "/help/viewCat.aspx?sub_cat_id=81";
			break;
		
		case "PORTALUSERTYPES":
			url = "/help/viewCat.aspx?sub_cat_id=80";
			break;
		
		case "PORTALS":
			url = "/help/viewCat.aspx?sub_cat_id=79";
			break;
			
		case "USERS":
			url = "/help/viewCat.aspx?sub_cat_id=84";
			break;
			
		case "USER":
				url = "/help/viewCat.aspx?sub_cat_id=85";
			break;
		
		case "CLIENT":
				url = "/help/viewCat.aspx?sub_cat_id=86";
			break;
		
		default:
			url = "/help/index.aspx";
	}
	
	window.open (url, "_blank");
	return false;
}


function clearText(formElement) 
{ 
       formElement.value = ""; 
} 
            
function resetText(formElement,str) 
{ 
   if(formElement.value == "") 
        formElement.value = str;
}

