//Disable right click script 
function clickIE() {if (document.all) {(message);return false;}} 
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) { 
if (e.which==2||e.which==3) {(message);return false;}}} 
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} 
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} 
document.oncontextmenu=new Function("return false") 


<!--

var sponsor = 1;

function surfToSponsor()
{
// Within the quotation marks below, enter
// the URLs to which your three respective 
// banners will link.
   if (sponsor==1) window.location.href="http://www.taxmannsponsor1.com";
   if (sponsor==2) window.location.href="http://www.sponsor2.com";
   if (sponsor==3) window.location.href="http://www.sponsor3.com";
}

function changeSponsor()
{
// Set the first value to the number of
// banners (you can have as many banners as
// you want).
   if (++sponsor > 3)  sponsor = 1;
   document.images[0].src = "banner" + sponsor + ".gif";
// Set this value to the time between 
// rotations (1500 = 1.5 seconds)
   window.setTimeout('changeSponsor();',1500);

}
function OpenWindow(url,trg)
{
	var newWin = window.open(url,trg,"status=yes,toolbar=no,menubar=no,location=no,resizable=yes,titlebar=no,scrollbars=yes");
}
function check()
{
	var i;
	var no;
	i = 3;
	no = '0'+i;
	if(document.getElementById("dgridITax_ctl02_chkall").checked==true)
	{   
		while(document.getElementById("dgridITax_ctl"+no+"_chkbtn"))
		{
		    document.getElementById("dgridITax_ctl"+no+"_chkbtn").checked=true;
			i++;
			if(i<10) no='0'+i;
			else     no=i;
		}
	}
	else
	{
		while(document.getElementById("dgridITax_ctl"+no+"_chkbtn"))
		{
			document.getElementById("dgridITax_ctl"+no+"_chkbtn").checked=false;
			i++;
			if(i<10) no='0'+i;
			else     no=i;
		}
	}
}
function countcheck()
{
	var i;
	var no;
	i = 3;
	no = '0'+i;
	while(document.getElementById("dgridITax_ctl"+no+"_chkbtn"))
	{
	    if(document.getElementById("dgridITax_ctl"+no+"_chkbtn").checked==true)
	    {
	        return true;
	    }
		i++;
		if(i<10) no='0'+i;
		else     no=i;
	}
	alert("No item select in the list!");
	return false;
}
function countcheckcart()
{
	var i;
	var no;
	i = 2;
	no = '0'+i;
	while(document.getElementById("dgridITax_ctl"+no+"_chkbtn"))
	{
	    if(document.getElementById("dgridITax_ctl"+no+"_chkbtn").checked==true)
	    {
	        return true;
	    }
		i++;
		if(i<10) no='0'+i;
		else     no=i;
	}
	alert("No item select in the list!");
	return false;
}
function checkcart()
{
	var i;
	var no;
	i = 2;
	no = '0'+i;
	if(document.getElementById("dgridITax_ctl01_chkall").checked==true)
	{   
		while(document.getElementById("dgridITax_ctl"+no+"_chkbtn"))
		{
		    document.getElementById("dgridITax_ctl"+no+"_chkbtn").checked=true;
			i++;
			if(i<10) no='0'+i;
			else     no=i;
		}
	}
	else
	{
		while(document.getElementById("dgridITax_ctl"+no+"_chkbtn"))
		{
			document.getElementById("dgridITax_ctl"+no+"_chkbtn").checked=false;
			i++;
			if(i<10) no='0'+i;
			else     no=i;
		}
	}
}
function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends


//function GetCatID()
//    {   
//          var qStr=window.location.search;
//          qStr=qStr.substring(qStr.indexOf("pid=")+6,qStr.indexOf("&")-qStr.indexOf("pid=")-1)
//          return qStr;
//    }

function NumericOnly(keypr)
{
    var KeyCode;
    KeyCode=keypr.keyCode;
    if(KeyCode>=48 && KeyCode<=57)
        return true;
    else
        return false;
}

function PageQuery(q) {
if(q.length > 1) this.q = q.substring(1, q.length);
else this.q = null;
this.keyValuePairs = new Array();
if(q) {
for(var i=0; i < this.q.split("&").length; i++) {
this.keyValuePairs[i] = this.q.split("&")[i];
}
}
this.getKeyValuePairs = function() { return this.keyValuePairs; }
this.getValue = function(s) {
for(var j=0; j < this.keyValuePairs.length; j++) {
if(this.keyValuePairs[j].split("=")[0] == s)
return this.keyValuePairs[j].split("=")[1];
}
return false;
}
this.getParameters = function() {
var a = new Array(this.getLength());
for(var j=0; j < this.keyValuePairs.length; j++) {
a[j] = this.keyValuePairs[j].split("=")[0];
}
return a;
}
this.getLength = function() { return this.keyValuePairs.length; } 
}
function GetCatID(){
var key="pId";
var page = new PageQuery(window.location.search); 
    if (unescape(page.getValue(key))=="false")
    {   
        key="PId";
        if (unescape(page.getValue(key))=="false")
        {
            key="PID";
            return unescape(page.getValue(key));
        }
        else
        {
            return unescape(page.getValue(key));
        } 
    } 
    else
    {
        return unescape(page.getValue(key)); 
    }
}
////function GetCatID(){
////var key="pId";
////var page = new PageQuery(window.location.search); 
////return unescape(page.getValue(key)); 
////}

// -->

function SetFocus(textbox)
{
    if(window.event.Keycode==13)
    {
         window.document.getElementById(textbox).focus();
         return false;
    }
    
}

// for forcefully close window update user details
  var F5Key=false;
 function GetKeycode(e)
 {
 
	 var evt ;    
	 evt = window.event || e;
 	 evt=evt.keyCode || document.getElementById('ffKeyTrap');//evt.charCode;
	if(evt==116)
	 	F5Key=true;
	else 
		F5Key=false;
	 }
function logoutOpen(e)
   {
      if (F5Key==false){ 
         var evt ;    
          evt = window.event || e;
          if(!evt.clientY)
                var xmlhttp=CreatexmlHttp();
          else {
               clickY  = evt.clientY;
               altKey  = evt.altKey;
               keyCode = evt.keyCode;
               if (altKey == true )
                    var xmlhttp=CreatexmlHttp();
               else if(clickY < 0)
                    var xmlhttp=CreatexmlHttp();
               else 
                    return void(0);
              }
            }
          F5Key=false;
   }
function CreatexmlHttp()
  {
     var xmlhttp;
     try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}
     catch(e){
            try {
               xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
             catch(e1){
                    xmlhttp=null;}
             }
     if (!xmlhttp){
           if (typeof XMLHttpRequest != "undefined") 
                  xmlhttp = new XMLHttpRequest();
           else 
                  xmlhttp = null;
                  }
    if (xmlhttp){

           xmlhttp.open("GET","/servicetaxlaw/LogOut.aspx",false);
           xmlhttp.send();
                }
   else
          xmlhttp = null;
    return xmlhttp;       
}
