/*
function highlightFormElements()
{
    addFocusHandlers(document.getElementsByTagName("input"));
    addFocusHandlers(document.getElementsByTagName("textarea"))
}

function addFocusHandlers(A)
{
    for(i=0;i<A.length;i++)
    {
        if(A[i].type!="button" && A[i].type!="submit" && A[i].type!="reset" && A[i].type!="checkbox" && A[i].type!="radio")
        {
            if(!A[i].getAttribute("readonly") && !A[i].getAttribute("disabled"))
            {
                A[i].onfocus=function(){this.style.backgroundColor="#ffd";this.select()};
                A[i].onmouseover=function(){this.style.backgroundColor="#ffd"};
                A[i].onblur=function(){this.style.backgroundColor=""};
                A[i].onmouseout=function(){this.style.backgroundColor=""}
            }
        }
    }
}
function highlightTableRows(D)
{
    var A=null;
    var C=document.getElementById(D);
    var B=C.getElementsByTagName("tbody")[0];
    var E;
    if(B==null)
        {E=C.getElementsByTagName("tr")}
    else
        {E=B.getElementsByTagName("tr")}
    
    for(i=0;i<E.length;i++)
    {
        E[i].onmouseover=function(){A=this.className;this.className+=" over"};
        E[i].onmouseout=function(){this.className=A}
    }
}
*/

function InStr(strSearch, charSearchFor)
{
    for (i=0; i < strSearch.length; i++)
    {
          if (charSearchFor == Mid(strSearch, i, 1))
          {
                return i;
          }
    }
    return -1;
}


function testForObject(Id, Tag)
{
    var o = document.getElementById(Id);
    if (o)
    {
        if (Tag)
        {
            if (o.tagName.toLowerCase() == Tag.toLowerCase())
            {
                return o;
            }
        }
        else
        {
            return o;
        }
    }
    return null;
}



/*	****************************************	Get Selected Radio Button/Check Box (SINGLE / ARRAY)	****************************************	*/

function getSelectedRadio(buttonGroup) {
   // returns the array number of the selected radio button or -1 if no button is selected
   if (buttonGroup[0]) { // if the button group is an array (one button is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].checked) {
            return i
         }
      }
   } else {
      if (buttonGroup.checked) { return 0; } // if the one button is checked, return zero
   }
   // if we get to this point, no radio button is selected
   return -1;
} // Ends the "getSelectedRadio" function

function getSelectedRadioValue(buttonGroup) {
   // returns the value of the selected radio button or "" if no button is selected
   var i = getSelectedRadio(buttonGroup);
   if (i == -1) {
      return "";
   } else {
      if (buttonGroup[i]) { // Make sure the button group is an array (not just one button)
         return buttonGroup[i].value;
      } else { // The button group is just the one button, and it is checked
         return buttonGroup.value;
      }
   }
} // Ends the "getSelectedRadioValue" function

function getSelectedCheckbox(buttonGroup) {
   // Go through all the check boxes. return an array of all the ones
   // that are selected (their position numbers). if no boxes were checked,
   // returned array will be empty (length will be zero)
   var retArr = new Array();
   var lastElement = 0;
   if (buttonGroup[0]) { // if the button group is an array (one check box is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].checked) {
            retArr.length = lastElement;
            retArr[lastElement] = i;
            lastElement++;
         }
      }
   } else { // There is only one check box (it's not an array)
      if (buttonGroup.checked) { // if the one check box is checked
         retArr.length = lastElement;
         retArr[lastElement] = 0; // return zero as the only array value
      }
   }
   return retArr;
} // Ends the "getSelectedCheckbox" function

function getSelectedCheckboxValue(buttonGroup) {
   // return an array of values selected in the check box group. if no boxes
   // were checked, returned array will be empty (length will be zero)
   var retArr = new Array(); // set up empty array for the return values
   var selectedItems = getSelectedCheckbox(buttonGroup);
   if (selectedItems.length != 0) { // if there was something selected
      retArr.length = selectedItems.length;
      for (var i=0; i<selectedItems.length; i++) {
         if (buttonGroup[selectedItems[i]]) { // Make sure it's an array
            retArr[i] = buttonGroup[selectedItems[i]].value;
         } else { // It's not an array (there's just one check box and it's selected)
            retArr[i] = buttonGroup.value;// return that value
         }
      }
   }
   return retArr;
} // Ends the "getSelectedCheckBoxValue" function


<!--	****************************************	Get Selected Radio Button/Check Box (SINGLE / ARRAY)	****************************************	-->




function fnEmpty()
{

}

/*  *********       START => GET / SET / DELETE 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);
}


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 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='#ffd';
	 obj.style.color='black';
}

function normalbg(obj)
{
	obj.style.backgroundColor='white';
	obj.style.color='black';
}


function fnTextCounter(field, countfield, maxlimit) 
{
    //alert(field + "  ,  " + countfield + "  ,  " + maxlimit);
    var srcElement = field; //document.getElementById(field);
    var destElement = countfield; //document.getElementById(countfield);
    
    //alert(destElement.type);
    
    if ((+srcElement.value.length) > (+maxlimit))
    { // if too long...trim it!
        srcElement.value = srcElement.value.substring(0, maxlimit);
        destElement.value = (+maxlimit) - (+srcElement.value.length);
    }
    // otherwise, update 'characters left' counter
    else 
    {
        destElement.value = (+maxlimit) - (+srcElement.value.length);
    }
}

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 isAmount(obj)
{
    var iDot = 0;
	var val = trimString(obj.value);
	var len = val.length;
	if (val.match(/^[0-9,/.]+$/))
	{
	    for(j=0;j<len;j++)
		{
			if ((val.charAt(j)) == ".")
			{
				iDot++;
			}
		}
		
		if ((+iDot) > 1)
		{
		    return false;
		}
		else
		{
		    return true;
		}
	}
	else
	{
		return false;
	} 
}

function isNumeric(obj)
{
	var val = trimString(obj.value);
	var len = val.length;
	if (val.match(/^[0-9,]+$/))
	{
		for(j=0;j<len;j++)
		{
			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);
	
	if ((+iszero) == 0)
	{
		obj.value = mobile.replace(iszero,'');
		//alert("Do not precede Mobile No. with a Zero(0)!");
		obj.focus();
		return false;
	}
	
	if ((+iszero) != 9)
	{
		alert("Mobile No. should start with 9!");
		obj.focus();
		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()",2000)
}


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 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();
}
