// 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 isDateValid(dateStr) {
    if(dateStr == null || dateStr.length < 6) return false;
    var dateParts = dateStr.split('/');
    if(dateParts.length != 3) return false;
    var month = Number(dateParts[0]);
    if(!isFinite(month)) return false;
    var day = Number(dateParts[1]);
    if(!isFinite(day)) return false;
    var year = Number(dateParts[2]);
    if(!isFinite(year)) return false;
    if(month < 1 || month > 12) return false;
    if(year < 0) return false;
    var dateOK = true;
    switch(month) {
        case 1:
        case 3:
        case 5:
        case 7:
        case 8:
        case 10:
        case 12:
            if(day < 1 || day > 31) dateOK = false;
            break;
        case 4:
        case 6:
        case 9:
        case 11:
            if(day < 1 || day > 30) dateOK = false;
            break;
        case 2:
            if(year % 4 == 0) {
                if(day < 1 || day > 29) dateOK = false;
            } else {
                if(day < 1 || day > 28) dateOK = false;
            }
            break;
        default:
            dateOK = false;
    }
    return dateOK;
}
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 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
	}
} 
