<!--
<!-- //
function gNulAlNumSplKeys(pKeyType)
{
	/*Function that allows only Alpahabets,Numbers 
	This is to be called 
	in the "KeyPress" event of a Text control."this" 
	reference is to be passed.	*/
	
	/* pKeyType  - 1 (Only Alphabets) and some special character  "white space - / ,'"
	   pKeyType  - 2 (Only Numeric)
	   pKeyType  - 3 (For Alphanumeric)
	   pKeyType  - 4 (For Email)
	   pKeyType -  5 (For Phone) */
	
	//alert(window.event.keyCode);
	// Variable to store the value of "KeyCode".
	pNumKeyCode = window.event.keyCode;
	
	// Check if the "KeyCode" is from "A" to "Z".
	if((pNumKeyCode > 64 && pNumKeyCode < 91) && (pKeyType == 1 || pKeyType == 3 || pKeyType == 4))
	{
		window.status ="Done";
		window.event.keyCode = pNumKeyCode; 
	}
	// Check if the "KeyCode" is from "a" to "z".
	else if((pNumKeyCode > 96 && pNumKeyCode < 123) && (pKeyType == 1 || pKeyType == 3 || pKeyType == 4))
	{
		window.status = "Done";
		window.event.keyCode = pNumKeyCode; 
	}
	// Check if the "KeyCode" is from "0" to "9".
	else if((pNumKeyCode > 47 && pNumKeyCode < 58) && (pKeyType == 2 || pKeyType == 3 || pKeyType == 4 || pKeyType == 5))
	{
		window.status ="Done";
		window.event.keyCode = pNumKeyCode; 
	}
	// Check if the "KeyCode" is  "()-"
	else if(((pNumKeyCode == 40) || (pNumKeyCode == 41) || (pNumKeyCode == 45)) && (pKeyType == 5))
	{
		window.status ="Done";
		window.event.keyCode = pNumKeyCode; 
	}
	// Check if the "Keycode" is "white space - / '"
	else if((pNumKeyCode == 32 || pNumKeyCode == 47 || pNumKeyCode == 45 || pNumKeyCode == 39 || pNumKeyCode == 44) && (pKeyType == 1 || pKeyType == 3))
	{
		window.status ="Done";
		window.event.keyCode = pNumKeyCode; 
	}
	// Check if the "KeyCode" is "@._"
	else if(((pNumKeyCode == 64) || (pNumKeyCode == 46) || (pNumKeyCode == 95)) && (pKeyType == 4))
	{
		window.status ="Done";
		window.event.keyCode = pNumKeyCode; 
	}
	// Check if the "KeyCode" is anyother character, mentioned above.
	else 
	{
		window.status = "Invalid Character."
		window.event.keyCode = 0; 
	}
}
/* ----------------------------------------------------------------------------------------- */

	function isproper(string)
	{
	   if (!string) return false;
	   var ichars = "*|,\":<>[]{}`\';()@&$#%";
	
	   for (var i = 0; i < string.length; i++) {
		  if (ichars.indexOf(string.charAt(i)) != -1)
			 return false;
	   }
	   return true;
	}
	
	function isproperText(string)
	{
	   if (!string) return false;
	   var ichars = "~!*^|+-?,\":<>[]{}`\/;()@&$#%=";
	
	   for (var i = 0; i < string.length; i++) {
		  if (ichars.indexOf(string.charAt(i)) != -1)
			 return false;
	   }
	   return true;
	}
	
	//valid email check
	function isvalidemail(pmemail)
	{
		return !(pmemail == "" || pmemail.indexOf('@',1) == -1 || pmemail.indexOf('.',3) == -1)
	}

	//restriction of textarea entry
	var ctextlength	
	ctextlength = 2000;
	
	function cremainingcharacters(pmessage,pmessagecount)
	{
		if (pmessage.value.length > ctextlength)
		{
			pmessage.value = pmessage.value.substring(0,(ctextlength))
			pmessage.blur()
			top.alert("maximum length for a message (" + ctextlength + ") has been reached.  please shorten your message and try again.")
			rc = false
		}
		else
		{
			rc = true
		}
		pmessagecount.value = ctextlength - (pmessage.value.length)
		return rc
	}
	

	/***********************************************************
	// function to allow the character up to the given character
	***********************************************************/
	function allowedCharacter(vObject, vAllowedLength)
	{
		/****************************
		// vObject 			= text area control name
		// vAllowedLength 	= Length of character should be in text area
		****************************/
		
		// Check whether the character entered in the text area is greater then the given Allowed length
		if (trim(vObject.value).length > vAllowedLength)
		{
			// Cut the remaining character which exceeds the Allowed length
			vObject.value = vObject.value.substring(0,(vAllowedLength));
			return false;	// return value
		}
		return true;	// return value
	} //#-- close of allowedCharacter(vObject, vAllowedLength)


	// website entry validation
	function isvalidurl(pmurl)
	{
		var vstr = new string
		var visvalid
		var vlen
		pmurl = pmurl.toLowerCase()
		vstr = "1234567890qwertyuiopasdfghjklzxcvbnm_./-"
		visvalid = true
		for (vloop=0;vloop<=pmurl.length;vloop++)
		{
			symbol =  pmurl.substr(vloop,1)
			if (vstr.indexOf(symbol,1) < 0)
			{
				visvalid = false
				return(visvalid)				
				break;
			}
		}
		return(visvalid)
	}
	function setfocus(pmcontrol)
	{
		if(pmcontrol.disabled == false)
			pmcontrol.focus();
	}
	function trim(str)
	{
			return str.replace( /^ +/, "" ).replace( / +$/, "" );
	}
	
	
	// Common window open function
	// Example - comm_window_open('album_info.php?album_id=21', 'album_info', 220, 400, 'no', 150, 200);
	function comm_window_open(open_page, page_name, pg_height, pg_width, pg_scroll, pg_top, pg_left)
	{
		var d = new Date();
		d = Date.parse(d);
		window.open(open_page,page_name+d, "height="+pg_height+",width="+pg_width+",scrollbars="+pg_scroll+",top="+pg_top+",left="+pg_left);
	}
	
 
/*******************************************************
// Function to Check whether regular expression supported
*******************************************************/
	function isRegExpSupported()
	{
		//#-- are regular expressions supported?
			if (window.RegExp)
			{
				//#-- assign expression
					var vTempStr = "a";
					var vTempReg = new RegExp(vTempStr);
				
				//#-- return status
					return (vTempReg.test(vTempStr));
			}
		
		//#-- return status
			return (false);
	} //#-- close of isRegExpSupported()


	/**********************************************************************
	// Function to Check for valid email. User can check multiple email ids
	**********************************************************************/
	function isEmailMulti(pmStr, pmMultiple)
	{
		/*********************************************************************************
		// @pmStr = String contain email
		// @pmMultiple = TURE or FALSE. Whether this email string contains multiple emails
		*********************************************************************************/
		vResValidate = false;
		if (pmMultiple)
		{
			pmStr     = trim(pmStr).replace(/;/g, ',');
			aEmailIds = trim(pmStr).split(",");
			vResValidate = true;
			for(vLoopEmail = 0; vLoopEmail < aEmailIds.length; vLoopEmail++)
			{
				vEmail  = trim(aEmailIds[vLoopEmail]);
				vEmail  = vEmail.replace(";", ','); 
				vEmail  = vEmail.replace(/\r\n|\r|\n/g, ''); 
				vEmail  = vEmail.replace(/\r\n/g,'');
				vEmail  = vEmail.replace(/\r/g,'');
				vEmail  = vEmail.replace(/\n/g,'');
				vEmail	= trim(vEmail);
				if(vEmail != "") 
				{
					if(!isEmail(vEmail))
					{
						vResValidate = false;
						break ;
					}
				}
			}
		}
		else vResValidate = isEmail(pmStr)	
		return vResValidate;
	} //#-- close of isEmail()
	
	/***************************************************************************************************
	// Function to Check for valid email with name. User can check multiple email ids with names entered
	***************************************************************************************************/
	function isEmailMultiWithName(pmStr, pmMultiple)
	{
		/*********************************************************************************
		// @pmStr = String contain email
		// @pmMultiple = TURE or FALSE. Whether this email string contains multiple emails
		*********************************************************************************/
		vResValidate = false;
		if (pmMultiple)
		{
			aEmailIds = pmStr.split(",")
			vResValidate = true;
			for(vLoopEmail = 0; vLoopEmail < aEmailIds.length; vLoopEmail++)
			{
				aData = aEmailIds[vLoopEmail].split("(");
				vEmail = aData[0];
				vName = typeof(aData[1]) != 'undefined' ? aData[1].replace(")","") : "";

				if (!isEmail(vEmail) || !isPersonName(vName))
				{
					vResValidate = false;
					break ;
				}
			}
		}
		else 
		{
			aData = pmStr.split("(");
			vEmail = aData[0];
			vName = typeof(aData[1]) != 'undefined' ? aData[1].replace(")","") : "";
			
			vResValidate = isEmail(vEmail) && isPersonName(vName);
		}
		return vResValidate;
	} //#-- close of isEmail()
	 
	function isEmail(pmStr)
	{
		/******************************
		// @pmStr = String contain email
		******************************/
		var str = pmStr.toUpperCase();
		var com = 'COM';
		var lcom=str.indexOf(com);
		pmStr  = trim(pmStr);	//#-- trim the string
		pmStr  = pmStr.replace(/\r\n|\r|\n/g, ''); 
		pmStr  = pmStr.replace(/\r\n/g,'');
		pmStr  = pmStr.replace(/\r/g,'');
		pmStr  = pmStr.replace(/\n/g,''); 
		if (pmStr == "") return false;
		if (pmStr.length > 50) return false;
		if (!isRegExpSupported()) return (pmStr.indexOf(".") > 2) && (pmStr.indexOf("@") > 0);	//#-- is regular expressions supported
		//if the email does not have @ and . then return false
		if(pmStr.indexOf('@') == -1 || pmStr.indexOf('.') == -1 || pmStr.indexOf(' ') != -1)
			return false;
		//###################################################################
		vSubStr = pmStr.split('@'); //#-- split the email 
		vDomain = vSubStr[1].split('.'); //#-- split the domain extension 
		
		
		//###################################################################
		for(vI = 0; vI < vDomain.length ; vI++)
		{
				if(vDomain[vI].length <= 1)
				{
					return (false) //#-- test and return value
				}
		}
		
		pmStr = trim(pmStr);
		var vPattern = "^[A-Za-z0-9](([_\\.\\-]?[a-zA-Z0-9_]+)*)@([A-Za-z0-9]+)(([\\_.\\-]?[a-zA-Z0-9]+)*)\\.([A-Za-z]{2,})$";
		var vRegExp = new RegExp(vPattern);
		return (vRegExp.test(pmStr));
	}
	function isValidPhoneNo(pmPhNo,pmintMinLen,pmintMaxLen)
	{   var i;
		var returnString = "";
		var phoneNumberDelimiters = "0123456789()-+,  ext.";
		// Search through string's characters one by one.
		// If character is not in bag, append to returnString.
		for (i = 0; i < pmPhNo.length; i++)
		{   
			// Check that current character isn't whitespace.
			var c = pmPhNo.charAt(i);
			if(c == "-")
				pmintMinLen++;
			if (phoneNumberDelimiters.indexOf(c) == -1) 
				return false;
		}
		if(pmPhNo.length>pmintMaxLen || pmPhNo.length<pmintMinLen)
			return false;
		else	
			return true;
	}
	function isPhoneNo(pmPhNo,pmintMinLen,pmintMaxLen)
	{   var i;
		var returnString = "";
		var phoneNumberDelimiters = "0123456789()-,  ext.";
		// Search through string's characters one by one.
		// If character is not in bag, append to returnString.
		for (i = 0; i < pmPhNo.length; i++)
		{   
			// Check that current character isn't whitespace.
			var c = pmPhNo.charAt(i);
			if(c == "-")
				pmintMinLen++;
			if (phoneNumberDelimiters.indexOf(c) == -1) 
				return false;
		}
		if(pmPhNo.length>pmintMaxLen || pmPhNo.length<pmintMinLen)
			return false;
		else	
			return true;
	}
	
	function isZipcode(pmStr)
	{
		string=trim(pmStr);
		if (!string) return false;
			var ichars = "!!*|,\":<>[]{}`\';()@&$#%";
		
		for (var i = 0; i < string.length; i++) 
		{
			if (ichars.indexOf(string.charAt(i)) != -1)
			return false;
		}
		return true;
	}
	
	function isSpeacilChar(pmStr)
	{
		string=trim(pmStr);
		if (!string) return false;
			var ichars = "~!*|,\":<>[]{}`\';()@&$#%=-\:?,/";
		
		for (var i = 0; i < string.length; i++) 
		{
			if (ichars.indexOf(string.charAt(i)) != -1)
			return false;
		}
		return true;
	}
	
	
	/***********************************************
	// Function to Check whether given name is valid
	***********************************************/
	function isPersonName(pmStr)
	{
		/**********************************************************************************************
		// @pmStr = String to be tested
		// Checks the allowed string be "A to Z", "a to z", "space" and "'."
		**********************************************************************************************/
	    
		pmStr = trim(pmStr);
		if (pmStr == "") return false;
		if (isRegExpSupported())	//#-- is regular expression supported
		{
			var vPattern = "(^([a-zA-Z0-9 '.'-]+)?)$";	//#-- set the pattern
			var vRegExp = new RegExp(vPattern);									//#-- create regular expression object
			return (vRegExp.test(pmStr));										//#-- test and return status
		} //#-- close of if (isRegExpSupported())
		var vPattern = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 '.";
		if (!pmStr.length) return false;	//#-- check for empty string
		for (var i = 0; i < pmStr.length; i++) if (vPattern.indexOf(pmStr.charAt(i)) == -1) return false;
		return true;
	} //#-- close of isName(pmStr)

	
	function isName(pmStr)
	{
		string=trim(pmStr);
		if (!string) return false;
			var ichars = "^~!*|\"<>[]{}`\;()@$#%";
		
		for (var i = 0; i < string.length; i++) 
		{
			if (ichars.indexOf(string.charAt(i)) != -1)
			{
				return false;
			}
		}
		return true;
	}
	
	function isName1(pmStr)
	{
		string=trim(pmStr);
		if (!string) return false;
			var ichars = "^~!*|\"<>[]{}`\;()@$#%";
		
		for (var i = 0; i < string.length; i++) 
		{
			if (ichars.indexOf(string.charAt(i)) != -1)
			{
				return false;
			}
		}
		return true;
	}

	function  gfuncMaxLenChk(fstrValue,lintLength)
	{
		var lstrValue = fstrValue.value.length;
		window.status='Text Length-->'+lstrValue+ ' / '+ lintLength;
 
		if (lstrValue>=lintLength)
		{
			window.status = "Text cannot exceed " + lintLength + " characters";			
			window.event.keyCode=0;
			return false;			
		}
	}
	
	/* ***   FUNCTION THAT ALLOWS ONLY NUMBERS (WHOLE) INSIDE A TEXTBOX   *** */
	function gNulNumKeys()
	{
		/*Function that allows only Numbers. This is to be 
		 called in the "KeyPress" event of a Text control. 
		 "this" reference is to be passed.*/
		// Variable to store the "KeyCode".
		var pNumKeyCode = window.event.keyCode;
		// Check what is the value of "KeyCode". If its valid
		// allow the value to be displayed, otherwise prompt.
		if(pNumKeyCode >= 47 && pNumKeyCode < 58)
		{
			window.status = "";
			window.event.keyCode = pNumKeyCode;	
		}
		else
		{	
			window.status = "Invalid Character. Only Numbers Are Allowed.";
			window.event.keyCode = 0;
		}
	} 
	// END FUNCTION gNulNumKeys
	function properText(string)
	{
	   if (!string) return false;
	   var ichars = "\~!*^|+?,\":<>[]{}'`\/;()&$#%=";
	
	   for (var i = 0; i < string.length; i++) {
		  if (ichars.indexOf(string.charAt(i)) != -1)
			 return false;
	   }
	   return true;
	}
	function textTrim(str)
	/************************************************************************/
	  //	PURPOSE: Remove leading blanks from text area.
	 // 	INPUt: str - the string we want to check
	/****************************************************************************/
	{
		//#--	check condition
		var whitespace = new String(" \t\n\r");
		var s = new String(str);
		//#--	check white space
		if (whitespace.indexOf(s.charAt(0)) != -1) 
		{
			//#--	We have a string with leading blank(s)...
			var j=0, i = s.length;
			//#--	Iterate from the far left of string until we
			// #--	don't have any more whitespace...
			while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
			j++;
			//#--	Get the substring from the first non-whitespace
			//#--	character to the end of the string...
			s = s.substring(j, i);
		}
	//#--	return value
	  return s;
	}
		/************************************
	// Function to check for valid US Phone number format with extension 
	************************************/
	function isValidUSPhone(pmPhoneNumber)
	{
		/****************************
		// pmPhoneNumber = Phone Number that to be validated
		****************************/
		
		//#--Write Regular expression to check valid US Phone number
		var vPattern = '^(\\(?\\d\\d\\d\\)?)?( |-|\\.)?\\d\\d\\d( |-|\\.)?\\d{4,4}(( |-|\\.)?[ext\\.]+ ?\\d+)?$';
		var vRegExp = new RegExp(vPattern);
	
		//#-- return true if it is valid Phone number or false for invalid Phone number
		return (vRegExp.test(pmPhoneNumber));
	}
		
	//#-- Created by vimala
	//############################################################################
	//#-- Modified by Senthil Kumar S. for remove only Existing email id's
	function isEmailExists(pmStr)
	{
		var vFLag = 0;
		pmStr = pmStr.replace(/;/g,",");
		temp = pmStr;
		aTempEmailId = trim(temp).split(",");
		pmStr = pmStr.toUpperCase(); 
		aEmailIds = trim(pmStr).split(",");
		vExists = "";	
		for(vLoopEmail = 0; vLoopEmail < aEmailIds.length; vLoopEmail++)
		{
			vEmail  = trim(aEmailIds[vLoopEmail]);
			vEmail  = vEmail.replace(/\r\n|\r|\n/g, ''); 
			vEmail  = vEmail.replace(/\r\n/g,'');
			vEmail  = vEmail.replace(/\r/g,'');
			vEmail  = vEmail.replace(/\n/g,'');
			vEmail	= trim(vEmail);
			
			vTemp  = trim(aTempEmailId[vLoopEmail]);
			vTemp  = vTemp.replace(/\r\n|\r|\n/g, ''); 
			vTemp  = vTemp.replace(/\r\n/g,'');
			vTemp  = vTemp.replace(/\r/g,'');
			vTemp  = vTemp.replace(/\n/g,'');
			vTemp	= trim(vTemp);
			
			if(vEmail != "") 
			{
				if(vExists.toUpperCase().indexOf("|" + vEmail + "|") == -1)
				{
					vExists = vExists + "|" + vTemp + "|,";
					vPreValue = vExists;
				}
				else
				{
					//#-- modified by Senthil Kumar S.
					vFLag = 1;
				}
			}
		}
		//#-- this part added by Senthil Kumar S.
		if(vFLag == 1)
		{
			document.frmShareAlbum.too.value = vPreValue.replace(/\|/g,'');
			return false;
		}
		//#--
		return true;
	} //#-- close of isEmail()
	//#################################################################################
	//# - remember me option - added by jeyaseelan on 12/01/2006
	function checkrememberme(ckbox,form)
	{
		var obj = eval("document."+form+".ckRemember");
		if(ckbox.checked == true)
			obj.value = 1;
		else
			obj.value = 0;
	}
	function setCookie (name, value)
	{
	delCookie(name);
	document.cookie = name + "=" + escape (value) + 
	"; expires=" + expdate.toGMTString() +  "; path=/";
	}
	
	function delCookie (name) 
	{
	var expireNow = new Date();
	document.cookie = name + "=" +
	"; expires=Thu, 01-Jan-70 00:00:01 GMT" +  "; path=/";
	}
	//#################################################################################
	//#!-- -------------------------------------------------------------------------------------------------------------------------
	function checkName(pmStr)
	{
		var illegalChars =/[\(\)\<\>\;\ \@\%\^\&\_\~\,\#\+\{\}\=\|\?\*\$\:\!\\\/\"\[\]]/; 
		//	str=pmStr.substring(0,1)
		if (illegalChars.test(pmStr)){//|| pmStr.indexOf("_")==0)  {
		  return false
		}
		else
			return true
	}
	//#!-- ------------------------------------------------------------------------------------------------------------------------
	function funNotAllowSpace(e)
	{	
		var unicode=e.charCode? e.charCode : e.keyCode
		if (unicode==32)
		{ //if the key isn't the backspace key (which we should allow)
			return false //disable key press
		}
	}
	//#!-- ------------------------------------------------------------------------------------------------------------------------
		//# function to allow only letters and numbers in password and in phone or zipcode
	function checkStr(pmStr)
	{
		var illegalChars = /[\W_]/; 
		if (illegalChars.test(pmStr)) {
		  return false
		}
		else
			return true
	}
