
function GetXMLHTTP() //Creating the XMLHTTP object for AJAx functionality
{
	if(document.all)
	{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP")
	}
	else
	{
	 //   alert('in fire fox')
		xmlhttp = new XMLHttpRequest();
		//alert('after http request object creation in fire fox')
	}
	return xmlhttp
}				

function CallDatePopWithOutTimelien(obj,dblobj,obj3)
{
var DateVal = window.showModalDialog('../javascripts/calendarWithOutTime.htm','Calendar','help:no;dialogwidth:275px;dialogheight:250px;status:no;center:yes')
	if (typeof(DateVal)=="string")
	{
    var dt = new Date();
    var sysmonth = dt.getMonth()+1;
    var sysdate = dt.getDate();
    var sysyear = dt.getYear();
	var date;
    var month;
    var year;
       document.getElementById(obj3).innerHTML='';
     month = DateVal.substring (DateVal, DateVal.indexOf ("/"));
     date = DateVal.substring (DateVal.indexOf ("/")+1, DateVal.lastIndexOf ("/"));
     year = DateVal.substring (DateVal.lastIndexOf ("/")+1,10);
	 if(year<sysyear)
	  {
	    document.getElementById(obj).value = DateVal;
	    document.getElementById(dblobj).value = DateVal;
	  }
	  else if(year==sysyear)
	  {
	        if(month<sysmonth)
	        {
	        	document.getElementById(obj).value = DateVal;
	            document.getElementById(dblobj).value = DateVal;
	        }
	        else if(month==sysmonth)
	        {
	           if(date<=sysdate)
	            {
	                document.getElementById(obj).value = DateVal;
	                document.getElementById(dblobj).value = DateVal;
	            }
	            else
	            {
	                document.getElementById(obj3).innerHTML ='Future Dates are not accepted';
	            }
	        }
	        else
	        {
	         document.getElementById(obj3).innerHTML ='Future Dates are not accepted';
	        }
	    }
	   else
	   {
	    document.getElementById(obj3).innerHTML ='Future Dates are not accepted';
	   }
	}

}
function CallDatePopWithOutTime(obj,dblobj,obj3)
{

var DateVal = window.showModalDialog('../javascripts/calendarWithOutTime.htm','Calendar','help:no;dialogwidth:268px;dialogheight:255px;status:no;center:yes')
if (typeof(DateVal)=="string")
{
var dt = new Date();
var sysmonth = dt.getMonth()+1;
var sysdate = dt.getDate();
var sysyear = dt.getYear();
var date;
var month;
var year;
document.getElementById(obj3).innerHTML='';
month = DateVal.substring (DateVal, DateVal.indexOf ("/"));
date = DateVal.substring (DateVal.indexOf ("/")+1, DateVal.lastIndexOf ("/"));
year = DateVal.substring (DateVal.lastIndexOf ("/")+1,10);
if(year<sysyear)
{
document.getElementById(obj).value = DateVal;
document.getElementById(dblobj).value = DateVal;
}
else if(year==sysyear)
{
if(month<sysmonth)
{
document.getElementById(obj).value = DateVal;
document.getElementById(dblobj).value = DateVal;
}
else if(month==sysmonth)
{
if(date<=sysdate)
{
document.getElementById(obj).value = DateVal;
document.getElementById(dblobj).value = DateVal;
}
else
{
document.getElementById(obj3).innerHTML ='Future Dates are not accepted';
}
}
else
{
document.getElementById(obj3).innerHTML ='Future Dates are not accepted';
}
}
else
{
document.getElementById(obj3).innerHTML ='Future Dates are not accepted';
}
}

}
function ValidDate(obj_Id,Field_Name)
 {
  
    if(document.getElementById(obj_Id).value)
		{
		
			//validating for format
			var strDate =" "+document.getElementById(obj_Id).value+" ";
			var dateregex=/^[ ][*[0]?(\d{1,2})\/(\d{1,2})\/(\d{4})[ ]*$/;
			//-----\s{1,}[0]?(\d{1,2})\:[0]?(\d{1,2})\:[0]?(\d{1,2})\s[AP]{1,}[M]{1,}
			var match=strDate.match(dateregex);	
			 if(match)
			 {
			 var tmpdate=new Date(match[3],parseInt(match[1],10)-1,match[2]);
			 if(tmpdate.getFullYear()<="1800")
			  {return Field_Name +"(mm/dd/yyyy)" +"year should be greater 1800 " + ",";}
			 else
			   { return "";}  
			}
		}   
		  return  "";
   }  
function OnFocus()//for text box on foucs
{onfocus="javascript:this.style.backgroundColor='#F3F6FA'";}

function OnBlur()//for text box if focus is lost
{onblur="javascript:this.style.backgroundColor=''";}

function GETMETHOD(xmlobj,URL,handleresponse)  //here xmlobj is the xmlhttp object,handleresponse is the function to be called to handle the returned data from the server
{                                              //URL is the URL  
	if(xmlobj != null)
		{
		  if(document.all)
		  {
			xmlobj.open("POST", URL, true);
			xmlobj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		  }
		  else
		    {xmlobj.open("GET", URL, true); }	
		 	xmlobj.onreadystatechange = handleresponse;
			xmlobj.send(null);
		}		

}

 
/*
	For Assigning the retirved data to the Browser

*/
 function HttpResponseHandler(xmlobj,objError,GridLabel,Pages,NoItems) //xmlhttp is the XML object,Error Label Name,object to which the data is to be binded
		{
			if (xmlobj.readyState == 4)
			{  	  
				if(xmlobj.responseText.indexOf('notfound')==0)
					{
						document.getElementById(objError).innerHTML=NoItems;
						document.getElementById(GridLabel).innerHTML=''; 
					}
				else if(xmlobj.responseText.indexOf('deleteerror')==0)
					{
						document.getElementById(objError).innerHTML='There was an error in the deletion process.';
					}
				//if the Session Expires
				else if(xmlobj.responseText.indexOf('SessionExpire')==0)
						{  if (Pages=='Admin')
								{window.location='Signout.aspx';}
							else if(Pages=='User')
						         {window.location='../Signout.aspx';} 		
							
						}		
				else if(xmlobj.responseText!='')
					{ 
						document.getElementById(GridLabel).innerHTML=xmlobj.responseText;
						document.getElementById(objError).innerHTML='' //Once data is displayed
					}
				
				else
					{
						document.getElementById(objError).innerHTML='There was a error in the process.';
						document.getElementById(GridLabel).innerHTML=''
					}
								   		
			}
		}



/*
Table Check/UnCheck funcationalites
*/
function Check_UncheckAll() //Header
{ 
	//debugger
	var intLoop=0 ;
	while (document.getElementById('chk_' + intLoop)!=null)
			{document.getElementById('chk_' + intLoop).checked = document.getElementById('chk_header').checked; intLoop+=1;}
	}
	
/*
 For CHild items
*/

function Check_UncheckHeader() //Header
	{

		var intLoop = 0;
		var intCount = 0;
		var rowCount = 0;
		
		while (document.getElementById('chk_' + intLoop)!=null)
		{
				if(document.getElementById("chk_" + intLoop).checked)
				{intCount++;}
				rowCount++;
				intLoop+=1;
		}
		if(intCount == (rowCount))
		document.getElementById("chk_header").checked = true;
		else
		{ 
		document.getElementById("chk_header").checked = false;
		//alert("bye");
		}
		return false;
	}
                
                
	/*
		FOr list paging
		obj--ahrnext
		other --ahrprev
		list--listname
	*/
	var GloPaging=0;
	function Next(obj,other,list)
			{
				
				
				var temp=0;
				var count=0;
				if(document.getElementById(list)!=null)
				{
					var arrTable =document.getElementById(list).getElementsByTagName("TABLE");;
						
					while(arrTable[count]!=null)
					{
						arrTable[count].style.display='none';count+=1;
					}
					
					document.getElementById(obj).style.display='';
					document.getElementById(other).style.display='';
					var loopIndex = 1;
					if(arrTable.length > 0)
					{	
						var currentImageIndex;
						if(GloPaging == 0)
						{
							currentImageIndex = 0;
						}
						else
						{
							currentImageIndex = GloPaging;
						}
						
						 
						while (arrTable[currentImageIndex]!=null && loopIndex < 5)
						{
							arrTable[currentImageIndex].style.display='';
							loopIndex = loopIndex + 1;	
							GloPaging = GloPaging + 1;
							currentImageIndex = currentImageIndex + 1;
						}	
					}
					else
					{
						document.getElementById(obj).style.display='none';
						document.getElementById(other).style.display='none';
						GloPaging = 0;
					}
					
					
					if(GloPaging <= 4)
						{
							document.getElementById(obj).style.display='';
							document.getElementById(other).style.display='none';						
						}
					else	
					if(GloPaging >= arrTable.length - 1)
						{
							document.getElementById(obj).style.display='none';
							document.getElementById(other).style.display='';							
						}					
					else
						{						
							document.getElementById(obj).style.display='';
							document.getElementById(other).style.display='';
						}	
						
					if(arrTable.length <= 4 )
					{
						document.getElementById(obj).style.display='none';
						document.getElementById(other).style.display='none';
						GloPaging = 0;						
					}			
						
								
					/*count=GloPaging;		
					
					while (arrTable[count]!=null)
					{
						if (count<=(GloPaging+3))
						{arrTable[count].style.display='';temp+=1;}
													
						count+=1;
					}
						
					GloPaging+=4;
					if (GloPaging==arrTable.length)
					{
						document.getElementById(obj).style.display='none';
						document.getElementById(other).style.display='';  
						GloPaging-=1;
					}
					if (GloPaging >= arrTable.length)
					{
						document.getElementById(other).style.display='';
						document.getElementById(obj).style.display='none';
					}	
					if (GloPaging <= 4)
					{
						document.getElementById(other).style.display='none';
					}
					status = GloPaging;*/
				}
			}
			function Previous(obj,other,list)
				{
					
					
					var temp=0;
					var count=0;
					if(document.getElementById(list)!=null)
					{
			    		var arrTable =document.getElementById(list).getElementsByTagName("TABLE");;
							
						while(arrTable[count]!=null)
							{arrTable[count].style.display='none';count+=1;}
							
						document.getElementById(obj).style.display='';
						document.getElementById(other).style.display='';
						//Harish start
						var loopIndex = 1; 
						if(arrTable.length > 0)
						{	
							var currentImageIndex;
							if( (GloPaging + 1)>= arrTable.length)
							{
								if((arrTable.length%4 == 0) && (GloPaging == arrTable.length))
								{
									currentImageIndex =  GloPaging - 5;
								}
								else
								{
									currentImageIndex =  GloPaging - (arrTable.length%4) - 1;
								}
							}
							else
							{
								currentImageIndex = GloPaging - 5;
							}
							 
							while (arrTable[currentImageIndex]!=null && loopIndex < 5)
							{
								arrTable[currentImageIndex].style.display='';
								loopIndex = loopIndex + 1;	
								GloPaging = GloPaging - 1;
								currentImageIndex = currentImageIndex - 1;
							}	
						}
						else
						{
							document.getElementById(obj).style.display='none';
							document.getElementById(other).style.display='none';
							GloPaging = 0;
						}
						
						if(GloPaging <= 4)
						{
							document.getElementById(obj).style.display='none';
							document.getElementById(other).style.display='';						
						}
						else	
						if(GloPaging >= arrTable.length - 1)
							{
								document.getElementById(obj).style.display='';
								document.getElementById(other).style.display='none';							
							}					
						else
							{						
								document.getElementById(obj).style.display='';
								document.getElementById(other).style.display='';
							}
						
						
						
						// Harish End			
							//debugger	
						/*GloPaging -=4;	
						count=GloPaging + 3;		
							
						while ((arrTable[GloPaging]!=null) && (count>=(GloPaging)))
						{
							arrTable[count-4].style.display='';
							count-=1;
						}	
								
						if (GloPaging<=4)
						{
							document.getElementById(obj).style.display='none';
							document.getElementById(other).style.display='';
						}
						status = GloPaging;	*/
					}
				} 
	
	
	/*
			var boolPrevious = false;
			var GloPaging=0; //Global variable for paging
			
			 function Next(obj,other,list)
			    {
						
						var temp=0;
						var count=0;
					if(document.getElementById(list)!=null)
					{	
			    		var arrTable =document.getElementById(list).getElementsByTagName("TABLE");
							
						while(arrTable[count]!=null)
							{arrTable[count].style.display='none';count+=1;}
							
							document.getElementById(obj).style.display='';
							document.getElementById(other).style.display='';		

						
						if(GloPaging == 0 && boolPrevious)
						{
							GloPaging = GloPaging + 3;
						}
									
						count=GloPaging;		
						//debugger
						while (arrTable[count]!=null)
							{
								if (count<(GloPaging+3))
								{arrTable[count].style.display='';temp+=1;}
															
								count+=1;
							}
							
							GloPaging+=temp;
							if (GloPaging==arrTable.length)
								{
									document.getElementById(obj).style.display='none';
									document.getElementById(other).style.display='';  
									GloPaging-=1;
								}
							
						 if (GloPaging<4)
							{document.getElementById(other).style.display='none';}	
					}			
			}
			
		
	//	FOr list paging
	//	other--ahrnext
	//	obj --ahrprev
	//	list--listname
  
			  function Previous(obj,other,list)
				{
						boolPrevious = true;
						var temp=0;
						var count=0;
			    	
					if(document.getElementById(list)!=null)
					{		
			    	
			    	
			    		var arrTable =document.getElementById(list).getElementsByTagName("TABLE");
							
						while(arrTable[count]!=null)
							{arrTable[count].style.display='none';count+=1;}
							
						document.getElementById(obj).style.display='';
						document.getElementById(other).style.display='';			
						
						
						if(GloPaging == arrTable.length - 1)
						{
							GloPaging = GloPaging - ((GloPaging + 1) % 3);
						}  	
							
						count=GloPaging;
						
						while ((arrTable[GloPaging-temp]!=null) && (count<=arrTable.length))
							{
								if (count<(GloPaging+3))
								{arrTable[GloPaging-temp].style.display='';temp+=1;}
															
								count+=1;
							}
							
							GloPaging -=temp;
							
							if (GloPaging<=0)
								{
									document.getElementById(obj).style.display='none';
									document.getElementById(other).style.display='';  
									GloPaging=0;
								}
						}	
				}  
	*/
//Delete funcationality For the Table
 function GETIDS()
 {
	var intLoop=0;
	var strids='0';
	while (document.getElementById('chk_' + intLoop)!=null)
		{
			if(document.getElementById('chk_' + intLoop).checked)
				{
				if(document.getElementById('lblId_' + intLoop) !=null)
					{strids= document.getElementById('lblId_' + intLoop).innerHTML + ',' + strids; }
				}
			
			intLoop+=1;   
		}
	return strids; //string format of ids
 }




function ValidatePhone(p1,p2,p3)
{
	var valid=true
	if((p1.value.length!=3)||(p2.value.length!=3)||(p3.value.length!=4))
	 {
		valid=false
	 }
	 var i1=parseInt(p1.value)
	 var i2=parseInt(p1.value)
	 var i3=parseInt(p1.value)
	 if(!(i1 && i2 && i3))
	 {
		valid=false
	 }
	 return valid
} 

function ValidateZip(z)
{
	
	var valid=true
	if( (z.length!=5)&& (z.length!=6) )
	{
		valid=false
	}
	var i= parseInt(z)
	if(!i)
	{
		valid=false
	}
	return valid

}

//verifying the input whether it is ''
function TxtEntered(obj)
 {
	if(document.getElementById(obj) != null)
	{
		 if (document.getElementById(obj).value.replace(/^\s+|\s+$/,'')=='')
			{
				return false;
			}
		else
			{
				 return true;
			}
	}
	else
	{
		return false;
	}
     
 }
 
 //Validating the phone number length should be 10 to 12 digits
 
 function ValidatePhone(obj)
 {
	if(parseInt(document.getElementById(obj).value.replace(/^\s+|\s+$/, '').length) < 10)
		{return false;}
  else if(parseInt(document.getElementById(obj).value.replace(/^\s+|\s+$/, '').length) > 12)
		{return false;}	
 else return true;		
 
 
 }
 
 
  //if a checkbox group is selected
	function ChkSelected(obj)
	{ 
	   try
	     {
				var bo=false;
				
				var count=document.getElementById(obj).options.length;
					alert(count)
				var i;
				for (i=0;i<=count-1;i++)
					{
					if(document.getElementById(obj+'_'+i).checked)
						{bo=true;return bo;}
					}
					return bo
		}
	  catch(err)
		   					{
		   						return;
		   					} 
				
	}
 
 function ComboSelected(obj)
 {
  if (parseInt(document.getElementById(obj).value.replace(/^\s+|\s+$/, ''))==-1)
     {return false}
  else return true   
     
 }

 //if check box is checked
 function ChkChecked(obj)
 {
  if (document.getElementById(obj).checked)
     {return true}
  else return false   
     
 }


function ExpDate(textbox_id , x, y)
{
	/*
	var DateVal = window.showModalDialog('../Includes/calendar.htm','Calendar','dialogwidth:275px;dialogheight:308px;center:yes')
	if (typeof(DateVal)=="string")
	{	
	
		document.getElementById(obj).value = DateVal; //date of birth
	}
	*/

				var cal1 = new calendar2(document.getElementById(textbox_id));
				cal1.year_scroll = true;
				cal1.time_comp = false;
				cal1.x = x;
				cal1.y = y;
				cal1.popup();
}
function CheckDateFormat(obj_Id,Field_Name)
{
    if(document.getElementById(obj_Id).value)
		{
			
			//validating for format
			var strDate = document.getElementById(obj_Id).value;
			var dateregex=/^[ ]*[0]?(\d{1,2})\/(\d{1,2})\/(\d{4})[ ]*$/;
			var match=strDate.match(dateregex);	
			
			if (match)
				{
					var tmpdate=new Date(match[3],parseInt(match[1],10)-1,match[2]);
					if (tmpdate.getDate()==parseInt(match[2],10) && tmpdate.getFullYear()==parseInt(match[3],10) && (tmpdate.getMonth()+1)==parseInt(match[1],10))
						{return "";}//true
					else
						{return  Field_Name +" ex: 01/01/2000" + ",";} 
				}
			else{return Field_Name +" ex: 01/01/2000" + ","; } 	
					 		                            
		}
}


function ValidateEmail(mail)
	{
	var email
	var splitted = new Array()
	var valid=true
	email =Trim(mail);
		
		if (email.replace(/^\s+|\s+$/, '')=='')
			 {return false}
						   
	     splitted = email.match("^(.+)@(.+)$");

		if(splitted == null) 
			{return false}
		if (splitted.length==3)
		  {
			
			if(splitted[1]!= null)
				{
						var regexp_user=/^\'?[\w-_\.]*\'?$/;
						
						if(splitted[1].match(regexp_user) == null) 
							{valid=false}
				}

			if(splitted[2]!= null)
				{
						var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
							if(splitted[2].match(regexp_domain) == null) 
							{
									var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
										if(splitted[2].match(regexp_ip) == null)
	    									{valid=false}
							}
						
				}
		}
		else {valid=false;}	
	return valid
}

/*
 This function is Used for validating the File Upload format this is used only for image uploads

*/

function ValidateUploadFile(obj)
			{  
				
				try
				{
					var str="";	
					var index=document.getElementById(obj).value.lastIndexOf('.');
					var length=document.getElementById(obj).value.length;
					
					if(document.getElementById(obj).value.substring((index+1),length).toLowerCase() =='jpeg'.toLowerCase()){}
						else if(document.getElementById(obj).value.substring((index+1),length).toLowerCase()=='gif'.toLowerCase()){}
						else if(document.getElementById(obj).value.substring((index+1),length).toLowerCase()=='jpg'.toLowerCase()){}
						else if(document.getElementById(obj).value.substring((index+1),length).toLowerCase()=='bmp'.toLowerCase()){}
						//acceptable file format
						else
							{str +=' Cannot upload files of this format('+ document.getElementById(obj).value.substring((index+1),length) +'), ';}	
							
				}							
					catch(err)
						{}
				
				return str
			}


/*function Trim(s)
{
	while(s.substring(0,1)==' ')
	{
		s=s.substring(1,s.length);
	}
	return s
}*/

function ValidateCreditCard(cc)
{
	
	var valid=true
	if(cc.value.length!=16)
	{
		valid=false
	}
	var i= parseInt(cc.value)
	if(!i)
	{
		valid=false
	}
	return valid

}

/*function ValidateEmail(mail)
{

	var valid=true
	var v1=mail.split('@')
	if(v1.length!=2)

	{
		valid=false
	}
	else
	{ 
		var v2=v1[1].split('.')
		if(v2.length!=2)
		{
			valid=false
		} 
	}
	
	return valid

}*/
//For setting the Focus
function Focus(obj)
		{
			if(document.getElementById(obj)!=null)
				{document.getElementById(obj).focus();}
		}
		
		




function calonkey(e)
			{
				  var Keyval;
					  Keyval=window.event?window.event.keyCode:e.which;
			
				if (Keyval == 13)
				{
					//cal(obj)
				}
				else 
				{				
					if (Keyval == 39)
					{window.event?window.event.keyCode=null:e.preventDefault();}					
				}
			}
			
function calonkeyInt32(e)
			{
				//according to the browser
			  var Keyval;
			  //alert(e.which)
			  Keyval=window.event?window.event.keyCode:e.which;
			   
			  			
				if ((Keyval == 13)||(Keyval == 8))
				{//cal(obj)
				}
				else if (Keyval == 39)
					{window.event?window.event.keyCode=null:e.preventDefault();}	
				else
				{
					if (!((Keyval >= 48) && (Keyval <= 57))) 
					{window.event?window.event.keyCode = null:e.preventDefault();}
				}				
			}	
function KeyNull(e)
          {
            var Keyval;
			Keyval=window.event?window.event.keyCode:e.which;
			window.event?window.event.keyCode=null:e.preventDefault();
          }

function AllowFloat(e,obj)
	{
		  var Keyval;
			  Keyval=window.event?window.event.keyCode:e.which;
		if (Keyval == 13)
		{
			//do nothing
		}
		else
		{	
			if (!((Keyval >= 48) && (Keyval <= 57))) 
			{
				if (!(Keyval == 46))
				{window.event?window.event.keyCode = null:e.preventDefault();}
				else if (Keyval == 46)
				{
					if (document.getElementById(obj).value.lastIndexOf(".") > -1)
					{window.event?window.event.keyCode = null:e.preventDefault();}
				}
			}
		}
	}

function AllowFloat1(obj)
	{
	  
		  var Keyval;
			  Keyval=window.event.keyCode;
			debugger;
		if (Keyval == 13)
		{
			//do nothing
		}
		else if (Keyval == 45)
		{
			//do nothing
		}
		
		else
		{	
			if (!((Keyval >= 48) && (Keyval <= 57))) 
			{
				if (!(Keyval == 46))
				{window.event.keyCode = null}
				
				else if (Keyval == 46)
				{
					if (document.getElementById(obj).value.lastIndexOf(".") > -1)
					{window.event.keyCode = null}
				}
			}
		}
	}


function calonkeyDouble(e)
{
	 var Keyval;
		Keyval=window.event?window.event.keyCode:e.which;
		
	if (Keyval == 13)
	{
		//cal(obj)
	}
	else if (Keyval == 39)
		{window.event?window.event.keyCode = null:e.preventDefault();}	
	else
	{
		if (!((Keyval >= 48) && (Keyval <= 57))) 
		{
			if (!(Keyval == 46))
			{window.event?window.event.keyCode = null:e.preventDefault();}
			else if (Keyval == 46)
			{
				/*if (document.getElementById(obj).value.lastIndexOf(".") > 0)
				{
					window.event.keyCode = null;
				}*/
			}
		}
	}				
}	
			
function calonkeydate(e)
{
	 var Keyval;
		Keyval=window.event?window.event.keyCode:e.which;
		
	if (Keyval == 13 || Keyval == 47)
	{
		/*if(txtvalue.lastIndexOf("/") > 6)
		{
			window.event.keyCode = null
		}*/
	}
	else if (!Keyval == 32)
		{window.event?window.event.keyCode = null:e.preventDefault();}	
	else
	{	
		if (!((Keyval >= 48) && (Keyval <= 58))) 
		{window.event?window.event.keyCode = null:e.preventDefault();}
	}
}

function calonkeydatetime(e)
{
	 var Keyval;
		Keyval=window.event?window.event.keyCode:e.which;
		
	if (Keyval == 13)
	{window.event?window.event.keyCode = null:e.preventDefault();}
	else
	{
		 if(Keyval == 32)
		{
			//accept :
		}
		else
		{
			 if(Keyval == 47)
			{
				//accept '/'
			}
			else
			{
				if (!((Keyval >= 48) && (Keyval <= 58)))
				{window.event?window.event.keyCode = null:e.preventDefault();//accept only numeric
				}
			}	
		}
	}
	
}
function GetOffSetTop(obj)
	{
		var initialTop = obj.offsetTop;
		obj = obj.parentNode;
		while(obj && obj.tagName != "BODY")
		{
			if(obj.tagName != "Div" && obj.tagName != "FORM")
			{
				initialTop += obj.offsetTop;
			}
			obj = obj.parentNode;
		}
		return initialTop;
	}
		
	function GetOffSetLeft(obj)
	{
		var initialLeft = obj.offsetLeft;
		obj = obj.parentNode;
		while(obj && obj.tagName != "BODY")
		{
			if(obj.tagName != "Div" && obj.tagName != "FORM")
			{
				initialLeft += obj.offsetLeft;
			}
			obj = obj.parentNode;
		}
		return initialLeft;
	}
	//-----------------------Scrolling
	


//var detect = navigator.userAgent.toLowerCase();
//var browser,thestring;

//if (checkIt('msie'))
//{browser = "Internet Explorer";}
//else if (!checkIt('compatible'))
//{browser = "Netscape Navigator";}
//else browser = "An unknown browser";

//function checkIt(string)
//{ 
//	place = detect.indexOf(string) + 1;
//	thestring = string;
//	return place;
//}


//function noScrollIE()
//{document.body.scroll="no";}
//function scrollIE()
//{document.body.scroll="yes";}
//function noScrollNS()
//{
//	document.width= window.innerWidth;
//	document.height=window.innerHeight;
//}
//function scrollNS()
//{
//	document.width=1000;
//	document.height=1000;
//}

//function removeScrollBars()
//{ 
//    if (browser = "Internet Explorer")
//    {noScrollIE();}
//    else if (browser = "Netscape Navigator")
//    {noScrollNS();}
//}

	
	
	
	//-----------------Scrolling
	
	
		
function Trim(TRIM_VALUE){
if(TRIM_VALUE.length < 1){
return"";
}
TRIM_VALUE = RTrim(TRIM_VALUE);
TRIM_VALUE = LTrim(TRIM_VALUE);
if(TRIM_VALUE==""){
return "";
}
else{
return TRIM_VALUE;
}
} //End Function

function RTrim(VALUE){
var w_space = String.fromCharCode(32);
var v_length = VALUE.length;
var strTemp = "";
if(v_length < 0){
return"";
}
var iTemp = v_length -1;

while(iTemp > -1){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(0,iTemp +1);
break;
}
iTemp = iTemp-1;

} //End While
return strTemp;

} //End Function

function LTrim(VALUE){
var w_space = String.fromCharCode(32);
if(v_length < 1){
return"";
}
var v_length = VALUE.length;
var strTemp = "";

var iTemp = 0;

while(iTemp < v_length){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(iTemp,v_length);
break;
}
iTemp = iTemp + 1;
} //End While
return strTemp;
} //End Function


