// JScript source code
strDownloadURL = "test.asp";
var searchFor = "";	
var noInput= "Please include a word or phrase in your search.";
var searchlocale = "";
var isV5 = false;
var isIE = false;
if (parseInt(navigator.appVersion) >= 5) isV5 = true;
if (navigator.appVersion.indexOf("MSIE") != -1) isIE = true;

function MouseOutMenu(Item) {
	if (isV5) {
		var MenuItem = document.getElementById(Item);
		MenuItem.setAttribute("style", "");
	}
	eval(Item + ".style.borderColor = '#E7E7E7';");	
}
function MouseOverMenu(Item) {
	if (isV5) {
		var MenuItem = document.getElementById(Item);
		MenuItem.setAttribute("style", "border-width:2px;border-style:solid;border-color:#000080;");
	}
	eval(Item + ".style.borderColor = '#000080';");
}
function confirmSubmit()
{
	var agree=confirm("Are you sure you want to continue?  Please note that these changes cannot be undone!");
	if (agree)
		return true ;
	else
	return false ;
}

function redirect(){
	window.open("get_order_all.asp")						
}

function openWin( windowURL, windowName, windowFeatures ) { 
	return window.open( windowURL, windowName, windowFeatures ) ; 
} 

function something()
{	
	var agree=confirm("Are you sure you want to continue?  Please note that these changes cannot be undone!");
	if (agree)
		return true ;
	else
	return false ;
}

function newWindow(file,window) {
	msgWindow=open(file,window,'resizable=no,width=400,height=200');
	if (msgWindow.opener == null) msgWindow.opener = self;
}

function downloadToOnlineStorage(strProvider)
{
if(strProvider == "xdrive")
{
	var strXDriveRedirURL = '';
	strXDriveRedirURL += '/onlinestorage/redir_xdrive_download.asp';
	strXDriveRedirURL += ('?' + strDownloadURL);
	window.open(strXDriveRedirURL,'','toolbar=no,menubar=no,scrollbars=no,fullscreen=no,resizable=no,width=575,height=200');
}

}

function change(ID){
		window.location.href = "tax_edit.asp?ID=" + ID
}

function deleterate(ID){
		window.location.href = "tax_delete_confirm.asp?ID=" + ID	
}

function batchdelete() {
		if (window.confirm("Are you sure you want to continue? Deletions cannot be undone!")) 
			{  document.forms[0].Action.value = "Delete";
				document.forms[0].submit();
		} 
    }
    
function CCA(CB)
{
	if (CB.checked)
	{
		hL(CB);
		CB.className = "checkboxchecked";
	}
	else
	{
		dL(CB);
		CB.className = "checkbox";
	}
			
}
function hL(E)
{			
	while (E.tagName!="TR")
		{E=E.parentElement;}				
	E.className = "H";
}
	
function dL(E)
{
	while (E.tagName!="TR")
		{E=E.parentElement;}
	E.className = "";
}

function showImage(imageURL) {
    var theUrl = location.protocol + "//" + location.host + "/" + imageURL;
    var imageWindow = window.open(theUrl,"OnPointDevPopupImage","width=600,height=400,resizable=yes,scrollbars=yes,location=no,status=no,toolbar=no,menubar=no");
    imageWindow.focus();
}

function getClearText(strSrc) 
{
	//Insert HTML Strign, and Get clear String
	return  strSrc.replace( /<[^<|>]+?>/gi,'' );
}
function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}
function Ajexx(Container,ValSubmiter,URL,XMLType,ReturnType)
{
	//Container is Div obj which will hold data return by URL.//ValSubmitter is the object which required for assing value from Container
	//XMLType is for synchronies = True  of Asynchronies = False // ReturnType Whether it is for Readonly or Selectable. ReturnType (0=Readonly,1=Selectable)
	xmlHttp=GetXmlHttpObject(stateChanged)
	xmlHttp.open("GET", URL , XMLType) 
	xmlHttp.send(null) 
	function stateChanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{
				Container.style.display = 'block';
				Container.innerHTML=xmlHttp.responseText 
			} 
	} 	
	
	
}
function Validate(sId,eId)
{
	for(var i=sId;i<eId;i++)
	{
		if(document.getElementById(i).value == '')
		{
			alert(document.getElementById(i).title + ' should not be empty');
			document.getElementById(i).focus();
			return false;
		}
		if(i == eId)
		{
			return true;
		}
	}
}

function Validates(Prefix,sId,eId)
{
	for(var i=sId;i<eId;i++)
	{
		if(document.getElementById(Prefix+i).value == '')
		{
			alert(document.getElementById(Prefix+i).title + ' should not be empty');
			document.getElementById(Prefix+i).focus();
			return false;
		}
		if(i == eId)
		{
			return true;
		}
	}
}


function reloadCaptcha()
{
    document.getElementById("imgCaptcha").src = "/aspcaptcha.asp?p=" + new Date().getTime();
}
function setFocus(objId)
{
	document.getElementById(objId).focus();
}
function Radio_Validate(Obj,message)
{
		var counter;
		counter = 0
		for (var i=0; i < Obj.length; i++)
 		{
			if(Obj[i].checked == false)
			{
				counter = counter + 1
			}
		}
		if(counter == Obj.length)
		{
			alert(message);
			Obj[0].focus()
			return false;
		}
}
function numberOnly(e,txt)
{
	if ((!(e.keyCode >= 48 && e.keyCode <= 57)) && (!(e.keyCode == 46 )) && (!(e.keyCode == 13 )))
	{
		e.keyCode = 0;
		alert("This field only allow digit between 0 to 9");
	}
}																					
function GetXmlHttpObject(handler)
{ 
	var objXmlHttp=null
	if (navigator.userAgent.indexOf("Opera")>=0)
	{
		alert("This example doesn't work in Opera") 
		return 
	}
	if (navigator.userAgent.indexOf("MSIE")>=0)
	{ 
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
		{
		strName="Microsoft.XMLHTTP"
		} 
		try
		{ 
		objXmlHttp=new ActiveXObject(strName)
		objXmlHttp.onreadystatechange=handler 
		return objXmlHttp
		} 
		catch(e)
		{ 
		alert("Error. Scripting for ActiveX might be disabled") 
		return 
		} 
	} 
	if (navigator.userAgent.indexOf("Mozilla")>=0)
	{
	objXmlHttp=new XMLHttpRequest()
	objXmlHttp.onload=handler
	objXmlHttp.onerror=handler 
	return objXmlHttp
	}
} 


function modalWin(filename,name,width,heigth) 
{
	if (window.showModalDialog) 
	{
		window.showModalDialog(filename,name,"dialogWidth:"+width+"px;dialogHeight:"+heigth+"px");
	} 
	else 
	{
		window.open(filename,name,'height='+height+',width='+width+',toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes');
	}
} 

function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}

