function getDateObject(dateString,dateSeperator)
{
	//This function return a date object after accepting 
	//a date string ans dateseparator as arguments
	var curValue=dateString;
	var sepChar=dateSeperator;
	var curPos=0;
	var cDate,cMonth,cYear;

	//extract day portion
	curPos=dateString.indexOf(sepChar);
	cDate=dateString.substring(0,curPos);
	
	//extract month portion				
	endPos=dateString.indexOf(sepChar,curPos+1);			
	cMonth=dateString.substring(curPos+1,endPos);

	//extract year portion				
	curPos=endPos;
	endPos=curPos+5;			
	cYear=curValue.substring(curPos+1,endPos);
	
	//Create Date Object
	dtObject=new Date(cYear,cMonth,cDate);	
	return dtObject;
}





/*	2ND WAY OF CREATING, READING AND DELETING COOKIES	*/
//
//  Cookie Functions -- "Night of the Living Cookie" Version (25-Jul-96)
//
//  Written by:  Bill Dortch, hIdaho Design <bdortch@hidaho.com>
//  The following functions are released to the public domain.
//
//  This version takes a more aggressive approach to deleting
//  cookies.  Previous versions set the expiration date to one
//  millisecond prior to the current time; however, this method
//  did not work in Netscape 2.02 (though it does in earlier and
//  later versions), resulting in "zombie" cookies that would not
//  die.  DeleteCookie now sets the expiration date to the earliest
//  usable date (one second into 1970), and sets the cookie's value
//  to null for good measure.
//
//  Also, this version adds optional path and domain parameters to
//  the DeleteCookie function.  If you specify a path and/or domain
//  when creating (setting) a cookie**, you must specify the same
//  path/domain when deleting it, or deletion will not occur.
//
//  The FixCookieDate function must now be called explicitly to
//  correct for the 2.x Mac date bug.  This function should be
//  called *once* after a Date object is created and before it
//  is passed (as an expiration date) to SetCookie.  Because the
//  Mac date bug affects all dates, not just those passed to
//  SetCookie, you might want to make it a habit to call
//  FixCookieDate any time you create a new Date object:
//
//    var theDate = new Date();
//    FixCookieDate (theDate);
//
//  Calling FixCookieDate has no effect on platforms other than
//  the Mac, so there is no need to determine the user's platform
//  prior to calling it.
//
//  This version also incorporates several minor coding improvements.
//
//  **Note that it is possible to set multiple cookies with the same
//  name but different (nested) paths.  For example:
//
//    SetCookie ("color","red",null,"/outer");
//    SetCookie ("color","blue",null,"/outer/inner");
//
//  However, GetCookie cannot distinguish between these and will return
//  the first cookie that matches a given name.  It is therefore
//  recommended that you *not* use the same name for cookies with
//  different paths.  (Bear in mind that there is *always* a path
//  associated with a cookie; if you don't explicitly specify one,
//  the path of the setting document is used.)
//  
//  Revision History:
//
//    "Toss Your Cookies" Version (22-Mar-96)
//      - Added FixCookieDate() function to correct for Mac date bug
//
//    "Second Helping" Version (21-Jan-96)
//      - Added path, domain and secure parameters to SetCookie
//      - Replaced home-rolled encode/decode functions with Netscape's
//        new (then) escape and unescape functions
//
//    "Free Cookies" Version (December 95)
//
//
//  For information on the significance of cookie parameters, and
//  and on cookies in general, please refer to the official cookie
//  spec, at:
//
//      http://www.netscape.com/newsref/std/cookie_spec.html    
//
//******************************************************************
//
// "Internal" function to return the decoded value of a cookie
//
function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}
//
//  Function to correct for 2.x Mac date bug.  Call this function to
//  fix a date object prior to passing it to SetCookie.
//  IMPORTANT:  This function should only be called *once* for
//  any given date object!  See example at the end of this document.
//
function FixCookieDate (date) {
  var base = new Date(0);
  var skew = base.getTime(); // dawn of (Unix) time - should be 0
  if (skew > 0)  // Except on the Mac - ahead of its time
    date.setTime (date.getTime() - skew);
}
//
//  Function to return the value of the cookie specified by "name".
//    name - String object containing the cookie name.
//    returns - String object containing the cookie value, or null if
//      the cookie does not exist.
//
function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}
//
//  Function to create or update a cookie.
//    name - String object containing the cookie name.
//    value - String object containing the cookie value.  May contain
//      any valid string characters.
//    [expires] - Date object containing the expiration data of the cookie.  If
//      omitted or null, expires the cookie at the end of the current session.
//    [path] - String object indicating the path for which the cookie is valid.
//      If omitted or null, uses the path of the calling document.
//    [domain] - String object indicating the domain for which the cookie is
//      valid.  If omitted or null, uses the domain of the calling document.
//    [secure] - Boolean (true/false) value indicating whether cookie transmission
//      requires a secure channel (HTTPS).  
//
//  The first two parameters are required.  The others, if supplied, must
//  be passed in the order listed above.  To omit an unused optional field,
//  use null as a place holder.  For example, to call SetCookie using name,
//  value and path, you would code:
//
//      SetCookie ("myCookieName", "myCookieValue", null, "/");
//
//  Note that trailing omitted parameters do not require a placeholder.
//
//  To set a secure cookie for path "/myPath", that expires after the
//  current session, you might code:
//
//      SetCookie (myCookieVar, cookieValueVar, null, "/myPath", null, true);
//
function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

//  Function to delete a cookie. (Sets expiration date to start of epoch)
//    name -   String object containing the cookie name
//    path -   String object containing the path of the cookie to delete.  This MUST
//             be the same as the path used to create the cookie, or null/omitted if
//             no path was specified when creating the cookie.
//    domain - String object containing the domain of the cookie to delete.  This MUST
//             be the same as the domain used to create the cookie, or null/omitted if
//             no domain was specified when creating the cookie.
//
function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}
/*	2ND WAY OF CREATING, READING AND DELETING COOKIES	*/





/*	1ST WAY OF CREATING, READING AND DELETING COOKIES	*/
function createCookie(name,value,days) 
{
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) 
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) 
{
	createCookie(name,"",-1);
}
/*	1ST WAY OF CREATING, READING AND DELETING COOKIES	*/



/*		FUNCTION TO ADD A OPTION, REMOVE A OPTION OR CLEAR ALL OPTIONS FROM A SELECT LIST	*/

var ListUtil = new Object();
ListUtil.add = function (oListbox, sName, sValue) 
{
	var oOption = document.createElement("option");
	oOption.appendChild(document.createTextNode(sName));
	if (arguments.length == 3) 
	{
		oOption.setAttribute("value", sValue);
	}
	oListbox.appendChild(oOption);
}

ListUtil.remove = function (oListbox, iIndex) {
	oListbox.remove(iIndex);
}

ListUtil.clear = function (oListbox) 
{
	for (var i=oListbox.options.length-1; i >= 0; i--) 
	{
		ListUtil.remove(oListbox, i);
	}
}
/*		FUNCTION TO ADD A OPTION, REMOVE A OPTION OR CLEAR ALL OPTIONS FROM A SELECT LIST	*/












function focusbg(obj)
{
	 obj.style.backgroundColor='#FFFFDD';/*'#ffcc99';*/
	 obj.style.color='black';
}

function normalbg(obj)
{
	obj.style.backgroundColor='white';
	obj.style.color='black';
}

function textCounter(field, countfield, maxlimit) 
	{
		if (field.value.length > maxlimit)
		{ // if too long...trim it!
			field.value = field.value.substring(0, maxlimit);
		}
		// otherwise, update 'characters left' counter
		else 
		{
			countfield.value = maxlimit - field.value.length;
		}
	}


function isNumeric(obj)
{
	var val = trimString(obj.value);
	var len = val.length;
	if (val.match(/^[0-9,]+$/))
	{
		for(j=0;j<=len;j=j+1)
		{
			if ((val.charAt(j)) == ".")
			{
				obj.value = val.replace('.','');
			}
		}
		return true;
	}
	else
	{
		return false;
	} 
}


function isName(obj)
{
	var val = trimString(obj.value);
	
	if (val.match(/^[a-zA-Z'' '.]+$/))
	{
		return true;
	}
	else
	{
		return false;
	} 
}

function isCompany(obj)
{
	var val = trimString(obj.value);
	
	if (val.match(/^[a-z0-9A-Z'' '-]+$/))
	{
		return true;
	}
	else
	{
		return false;
	} 
}

function isAddress(obj)
{
	var val = trimString(obj.value);
	if (val.match(/^[a-zA-Z0-9'' ',/.-]+$/))
	{
		return true;
	}
	else
	{
		return false;
	} 
}

// check to see if input is alphabetic
function isAlphabetic(obj)
{
	var val = trimString(obj.value);
	if (val.match(/^[a-zA-Z' ']+$/))
	{
		return true;
	}
	else
	{
		return false;
	} 
}



//… or whether the input string contains a combination of letters and numbers.

// check to see if input is alphanumeric
function isAlphaNumeric(obj)
{
	var val = trimString(obj.value);
	if (val.match(/^[a-zA-Z0-9' ']+$/))
	{
		return true;
	}
	else
	{
		return false;
	} 
}


function isMobile(obj)
{
	obj.value = trimString(obj.value);
	var mobile = obj.value;
	var moblen = obj.value.length;
	
	
	if (isNaN(mobile) == true)
	{
		alert("Invalid Mobile No."); 
		obj.focus();
		return false;
	}
	
	var iszero = mobile.charAt(0);
	//iszero = obj.value.charAt(0);
		//alert (iszero);
	if (iszero == 0)
	{
		obj.value = mobile.replace(iszero,'');
		obj.focus();
		//alert("SS");
		//return false;
	}
	
	for(j=0;j<=moblen;j=j+1)
	{
		if ((mobile.charAt(j)) == ".")
		{
			alert("Decimal not allowed!");
			//document.frmRegt.txtPin.value = "";
			obj.value = mobile.replace('.','');
			obj.focus();
			return false;
		}
	}
	
	if (moblen < 10)
	{
		alert("Mobile No. should be 10 digits long"); 
		obj.focus();
		return false;
	}
	return true;
}


function doBlink() {
  // Blink, Blink, Blink...
  var blink = document.all.tags("BLINK")
  for (var i=0; i < blink.length; i++)
    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
}

function startBlink() {
  // Make sure it is IE4
  if (document.all)
    setInterval("doBlink()",1000)
}


function capitalizeMe(obj) 
{
	singlespace(obj);
	
	var val = obj.value.toLowerCase();
	var newVal = '';
	val = val.split(' ');
	for(var c=0; c < val.length; c++) 
	{
		newVal += val[c].substring(0,1).toUpperCase() + val[c].substring(1,val[c].length) + ' ';
	}

	obj.value = trimString(newVal);
}


function singlespace(obj)
{
	var str = obj.value;
	//alert (str);
	//document.write(str+"<br/>")

	var regEx = new RegExp ('  ', 'gi') ;

	str = str.replace(regEx, ' ');
	obj.value = str;
	//alert (str);
	//document.write(str)
}



<!--
var win = null;
function winpopup(mypage,myname,w,h,pos,infocus,scrollbr)
{
	if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
	settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=" + scrollbr + ",location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=no";
	win = window.open(mypage,myname,settings);
	win.focus();
}
// -->

function popupwin(name,width,height,scrollbars)
{
	var w = width;
	var h = height;
	var t = (screen.height - h)/2
	var l = (screen.width - w)/2
	NewWin=window.open(''+name+'','NewWin','toolbar=no,status=no, width='+w+',height='+h+', scrollbars='+scrollbars+' ,left='+l+',top='+t+'');   
//return true;
}


function daysBetween(date1, date2) 
{
    var DSTAdjust = 0;
    // constants used for our calculations below
    oneMinute = 1000 * 60;
    var oneDay = oneMinute * 60 * 24;
    // equalize times in case date objects have them
    date1.setHours(0);
    date1.setMinutes(0);
    date1.setSeconds(0);
    date2.setHours(0);
    date2.setMinutes(0);
    date2.setSeconds(0);
    // take care of spans across Daylight Saving Time changes
    if (date2 > date1) {
        DSTAdjust = (date2.getTimezoneOffset( ) - date1.getTimezoneOffset( )) * oneMinute;
    } else {
        DSTAdjust = (date1.getTimezoneOffset( ) - date2.getTimezoneOffset( )) * oneMinute;    
    }
    var diff = Math.abs(date2.getTime( ) - date1.getTime( )) - DSTAdjust;
    return Math.ceil(diff/oneDay);
}



function DateDifference(dateA,dateB)
{
	var l1 = dateA.length;
	var l2 = dateB.length;
	if (l1 == 10)
	{
		var d1 = dateA.substr(0,2);
		var m1 = dateA.substr(3,2);
		var y1 = dateA.substr(6,4);
		//alert(d1 + ',' + m1 + ',' + y1);
		//dateA = m1 + '/' + d1 + '/' + y1
	}
	
	if (l2 == 10)
	{
		var d2 = dateB.substr(0,2);
		var m2 = dateB.substr(3,2);
		var y2 = dateB.substr(6,4);
		//alert(d1 + ',' + m1 + ',' + y1);
		//dateB = m2 + '/' + d2 + '/' + y2
	}
	//alert(dateA + ',' + dateB);
	var lwr_date = new Date(dateA);
	var gtr_date = new Date(dateB);
	
	//alert(lwr_date + ',' + gtr_date);
	
	var lwr_dateD = lwr_date.getDate();
	var lwr_dateM = lwr_date.getMonth();
	lwr_dateM++;
	var lwr_dateY = lwr_date.getFullYear();
	
	var gtr_dateD = gtr_date.getDate();
	var gtr_dateM = gtr_date.getMonth();
	gtr_dateM++;
	var gtr_dateY = gtr_date.getFullYear();
	
	//alert(lwr_dateD + '/' + lwr_dateM + '/' + lwr_dateY + ',' + gtr_dateD + '/' + gtr_dateM + '/' + gtr_dateY);
	if (gtr_dateY >= lwr_dateY)
	{
		//alert("year");
		//return true;
		if (gtr_dateY > lwr_dateY)
		{
			gtr_dateM = gtr_dateM + 12;
		}

		if (gtr_dateM >= lwr_dateM)
		{
			//alert("month");
			//return true;
			if (gtr_dateY > lwr_dateY)
			{
				gtr_dateD = gtr_dateD + 30;
			}
			
			if (gtr_dateD >= lwr_dateD)
			{
				//alert("day");
				return true;
			}
			else
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	else
	{
		return false;
	}
}

function getDateObject(dateString,dateSeperator)
{
	//This function return a date object after accepting 
	//a date string ans dateseparator as arguments
	var curValue=dateString;
	var sepChar=dateSeperator;
	var curPos=0;
	var cDate,cMonth,cYear;

	//extract day portion
	curPos=dateString.indexOf(sepChar);
	cDate=dateString.substring(0,curPos);
	
	//extract month portion				
	endPos=dateString.indexOf(sepChar,curPos+1);			
	cMonth=dateString.substring(curPos+1,endPos);

	//extract year portion				
	curPos=endPos;
	endPos=curPos+5;			
	cYear=curValue.substring(curPos+1,endPos);
	
	//Create Date Object
	dtObject=new Date(cYear,cMonth,cDate);	
	return dtObject;
}


/*
function DateDifference(varyear,varmonth,varday)
{
	
	var date1 = new Date (varyear,varmonth,varday);
	var curr_date = new Date();
	var date1D = date1.getDate();
	var date1M = date1.getMonth();
	var date1Y = date1.getFullYear();
	
	var curr_dateD = curr_date.getDate();
	var curr_dateM = curr_date.getMonth();
	var curr_dateY = curr_date.getFullYear();
	
	if (curr_dateY >= date1Y)
	{
		//alert("year");
		//return true;
		if (curr_dateY > date1Y)
		{
			curr_dateM = curr_dateM + 12;
		}

		if (curr_dateM >= date1M)
		{
			//alert("month");
			//return true;
			if (curr_dateY > date1Y)
			{
				curr_dateD = curr_dateD + 30;
			}
			
			if (curr_dateD >= date1D)
			{
				//alert("day");
				return true;
			}
			else
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	else
	{
		return false;
	}
}
*/
//This file stores all the common functions 

//Function to Validate Number
//Parameters: Takes 3 Parameteres
//		1 - The number to check
//		2 - Maximum number of digits allowed before decimal
//		3 - Maximum number of digits allowed after decimal

//To open window - on 8/2/2005 - yogesh
function trimString (str) 
{
	str = this != window? this : str;
	return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

function show(ele)
{
	var srcElement = document.getElementById(ele);
	if(srcElement != null) 
	{
		srcElement.style.display='block';
		return false;
	}
}

function hide(ele)
{
	var srcElement = document.getElementById(ele);
	if(srcElement != null) 
	{
	   srcElement.style.display= 'none';
		return false;
	}
}


function mywin(url) 
{
var newwin
newwin = window.open(url,'newwin');
}  
//To open window - End
function IsValidNumber(Num,precision,scale)
{
    var Number
    Number=trim(Num)
	if(trim(Number)=="")
		return false;
	
	//Check For Valid Number
	if (isNaN(Number)==true)    
		return false;
	
	//Check if More Than One Decimal 
	if(Number.split(".").length > 2) 
		return false;
		
	
	if(Number.indexOf(".") > 0)
	{
		//If the number contains decimal point
		if((Number.split(".")[0]).length > precision)
			return false;
		
		if((Number.split(".")[1]).length > scale)
			return false;	
		return true;
	}
	else
	{
		//If the number doesn't contain decimal point
		if(Number.length > precision)
			return false;
		else
			return true;
	}
	
}

//Function to Validate Percentage
//Parameters: Takes 3 Parameteres
//		1 - The number to check
//		2 - Maximum Number of digits before decimal
//		3 - Maximum Number of digits after decimal
function ValidPercent(dblNum,intDigitsBeforeDecimal,intDigitsAfterDecimal)
{  
       if (IsValidNumber(dblNum,intDigitsBeforeDecimal,intDigitsAfterDecimal) == true)
       {
			    if(dblNum<=0)
				   return false;
				else
					return true;				   
       }
       else
			return false;	
} 

//Function to Return the trimmed value passed as argument
//Parameters: Takes 1 Parameteres
//		1 - The value to trim
function trim(st) 
{
	var len = st.length;
	var begin = 0, end = len-1;
	while (st.charAt(begin) == " " && begin < len) 
	{
		begin++;
	}
	while (st.charAt(end) == " " && begin < end) 
	{
		end--;
	}
	return st.substring(begin, end+1);
}


//modification done and modified by Liju Mathew And Lakhnesh Pandey

//Function to Validate date
//Parameters: Takes 2 Parameteres
//		1 - The value to validate

function IsValidDate(strDate)
{
   
	//First Parameter is Date String
	//date Format Assumed is mm/dd/yyyy (Ex : 01/01/2000 is 1st Jan 2000)
	//date has only the seperators (/) or (-)
	var year,month,day,strSep,i;
	//strDate=trim(strDate)
	//assigning the seperator
	for(i=0;i<strDate.length;i++)
	   {
	    if(strDate.charAt(i)=="/" || strDate.charAt(i)=="-")
	    {
	     strSep=strDate.charAt(i)
	     break;
	    }
	   }  
  //Seperate Year,Month,Day
	day=strDate.split(strSep)[0];
	month=strDate.split(strSep)[1];
	year=strDate.split(strSep)[2];

	var months=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	
	//Check for Leap Year & Adjust The days in Feb accordingly
		if(year % 4 == 0)
		{
			months[1]=29;
		}

	    
	//Check for valid Numbers(Day,month,year)
	if(isNaN(day) || isNaN(month) || isNaN(year))
     {
		return false;
	     }
	//Added by yogesh 28-7-2004    
	//Check For Length of Date String   		
	 if(day.length == 2 || day.length == 1 )
	  {}
     else 
       return false;
                        
	 if(month.length == 2 || month.length == 1 )
	  {}
     else
       return false;
      
     if(year.length == 4)
      {}
     else
       return false;
     
       		     
     //code added by vidya
	 
	//Check for Valid Month
	if(month > 12 || month < 1)
{
		return false;
	
	}
	//Check For Valid Days
	if(day < 1 || day > months[month-1])
{
		return false;
	}	
		for(var i=1;i<=strDate.length;i++)
		{
			if(!((i==3) ||( i==6)))
			{
				num=strDate.substring(i,i-1)
	
				if(isNaN(num)==true)
				{	
					return false;
				}
			}
			if(((i==3) ||( i==6)))
			{
				if(strDate.substring(i,i-1)!= strSep) 
				{
				return false
				}
			}
			return true
		}
		
	//added by abhay for more accuracy
	if ((strDate.charAt(8) == "/") || (strDate.charAt(10) == "/"))
	{
		return false
	}
	
	
	//	end of ad's code
	
	//added here an another condition for seperator
	//Check For Seperators
	if ((strDate.charAt(2) == "/") && (strDate.charAt(5) == "/"))
	{
		return true
	}
	else
	{
		if ((strDate.charAt(2) == "-") || (strDate.charAt(5) == "-"))
		{
			return true;
		}
		else{

			return false;
}
	}

}


//Function to Validate Email
//Parameters: Takes 1 Parameteres
//		1 - The value to validate
	//email validation
	function emailValidation(entered)
	{
		var intCnt
		intCnt = 0;
		
		apos=entered.indexOf("@"); 
		dotpos=entered.lastIndexOf(".");
		lastpos=entered.length-1;
		if (apos < 1 || (dotpos-apos) < 2 || lastpos-dotpos > 3 || (lastpos-dotpos) < 2){
			return false
		}
		
		//no dots continuous
		if (entered.charAt(dotpos-1) == "."){
			return false
		}
		
		//counter for @
		for (var j=0; j<entered.length; j++){
			if (entered.charAt(j) == "@"){
				intCnt++;
			}
		}
		
		//only one @ allowed
		if (intCnt != 1){
			return false
		}
		
		//checking for speacial characters
		for (var i=0; i<entered.length; i++){
				//ascii from 33 to 45, 33- 45, 58-63, 123-126 are checked
			//if (((entered.charAt(i) >= "!") && (entered.charAt(i) <= "-")) ||
			
			if (((entered.charAt(i) >= "!") && (entered.charAt(i) < "-")) ||
			 ((entered.charAt(i) >= "[") && (entered.charAt(i) <= "^")) ||
			 ((entered.charAt(i) >= ":") && (entered.charAt(i) <= "?")) ||
			 ((entered.charAt(i) >= "{") && (entered.charAt(i) <= "~")) ) {
				return false
			}
		}
		
		return true
	} 

//Function to Clear all Fields of Form Passed as Parameter
//Parameters: Takes 1 Parametere
//			  The parameter is the form name whose fields are to be cleared
function fClearForm(formName)
{
	for(var i=0;i<formName.elements.length;i++)
	{
		if(formName.elements(i).type == "text" || formName.elements(i).type == "textarea")
			formName.elements(i).value="";
		else
		{
			if(formName.elements(i).type == "select-one")
				formName.elements(i).selectedIndex = 0;
			else
			{
				if(formName.elements(i).type == "radio" || formName.elements(i).type == "checkbox")
					formName.elements(i).checked = false;
			}
		}
	}
}

function checkPhone(value)
{
	for(var i = 0;i < value.length;i++)
	{
		if(!((value.charAt(i) >= "0" && value.charAt(i) <= "9") ||
			   (value.charAt(i) == "(" ) || 
			   (value.charAt(i) == ")") ||
			   (value.charAt(i) == "-") ||
			   (value.charAt(i) == " ") ||
			   (value.charAt(i) == ",") || 
			   (value.charAt(i) == " ")
			))
		{ 
			return false;
		}
	}
	return true;
}

function checkForAlphabets(value)
{
	for(var i = 0;i < value.length;i++)
	{
		if( !( (value.charAt(i) >= "A" && value.charAt(i) <= "Z") ||
			   (value.charAt(i) >= "a" && value.charAt(i) <= "z")
		     )
		  )
		{ 
			return false;
		}
	}
	return true;
}


/**************************************************************
 Split: Returns a zero-based, one-dimensional array containing 
        a specified number of substrings

 Parameters:
      Expression = String expression containing substrings and 
                   delimiters. If expression is a zero-length 
                   string(""), Split returns an empty array, 
                   that is, an array with no elements and no 
                   data.
      Delimiter  = String character used to identify substring 
                   limits. If delimiter is a zero-length 
                   string (""), a single-element array 
                   containing the entire expression string 
                   is returned.

 Returns: String
***************************************************************/
function Split(Expression, Delimiter)
{
	var temp = Expression;
	var a, b = 0;
	var array = new Array();

	if (Delimiter.length == 0)
	{
		array[0] = Expression;
		return (array);
	}

	if (Expression.length == '')
	{
		array[0] = Expression;
		return (array);
	}

	Delimiter = Delimiter.charAt(0);

	for (var i = 0; i < Expression.length; i++) 
	{
		a = temp.indexOf(Delimiter);
		if (a == -1)
		{
			array[i] = temp;
			break;
		}
		else
		{
			b = (b + a) + 1;
			var temp2 = temp.substring(0, a);
			array[i] = temp2;
			temp = Expression.substr(b, Expression.length - temp2.length);
		}
	}

	return (array);
}
// Added by yogesh
//      Comparing Current Date and User Date
// cday =current day
// uday =user day
function IsDateGreater(cday,cmonth,cyear,uday,umonth,uyear)
 {
   var cday = cday;
   var cmonth = cmonth;
   var cyear = cyear;
   var uday = uday;
   var umonth = umonth;
   var uyear = uyear;
   if ((1*(cyear)) <= (1*(uyear)))
    {
      if ((1*(cyear)) == (1*(uyear)))
        {
         
           if((1*(cmonth))<=(1*(umonth)))
            {
              if ((1*(cmonth)) == (1*(umonth)))
                {
                  if ((1*(cday)) <= (1*(uday)))
                    {
                      return true;
                    }
                  else
                    {
                      return false;
                    }  
                }
              else
                {
                  return true;
                }  
            }
          else
            {
              return false;
            }  
        }
      else
        {
          return true;
        }  
    }
   else
    {
      return false;
    } 
 }
 
 var win = null;
function NewWindow(mypage,myname,w,h,pos,infocus,scrollbr)
{
	if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
	settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=" + scrollbr + ",location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=no";
	win = window.open(mypage,myname,settings);
	win.focus();
}
