<!--

<!-- //



function handleError() {

	alert("Please Wait, the page need to be load");

	return true;

}

//window.onerror = handleError;

// End of the error handling function.-->



gstrMsgSplChr="Special Characters not allowed";

gcMsgProPhoneNumber		= "Please enter a valid phone number (Like 123-456-7890 or 123-456-7890 ext.12345)";

gcMsgIsPersonName = "Characters other than alphanumeric, spaces, apostrophes, and dots are not allowed";



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->





function RoundCust(pmValue) 

{

	var	vDecPlaces=1;

	//#--	Round your decimals to as few,

	vValue	=	(Math.round(pmValue*Math.pow(10,vDecPlaces)))/Math.pow(10,vDecPlaces);

	vValue	=vValue.toFixed(2);

	return  vValue;

}





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 = "~!^|+?,\:<>[]{}`'\/;()@&#%=";
	   var str = string.value;
	   //alert(str);
	   len = str.length;
	   //alert(len);
	   for (var i = 0; i < len; i++)
	    {
		 // alert(string.charAt(i));
		  if (ichars.indexOf(str.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 (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)

	{

			// Created by durai babu.

			return str.replace( /^ +/, "" ).replace( / +$/, "" );

	}

	

	// Function used to get the radio value...   (ie checked radio button value)	

	// object form Field         -->   document.frmproject.elements[strFieldName]

	function getRadialValue(objFormField)

	{

		//   var objFormField = document.frmproject.elements[strFieldName]

	   var objFormField;

	   intControlLength = objFormField.length

	   if(intControlLength)

	   {

			for (i=0;i<intControlLength;i++)

			{

				if(objFormField[i].checked)

				{

					strValue = objFormField[i].value;

					return strValue;

				}

			}

			

			return false;

	   }

	   else

	   {

			strValue=objFormField.value;

			return strValue;	

	   }     

	}

			

	// 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 add_photo(pmvalue)

	{

		document.addphoto_form.albumid.value = pmvalue;

		document.addphoto_form.action = "grp_check_uploader.php";

		//document.addphoto_form.action = "mem_photo_add.php";

		//document.addphoto_form.action = "uploader_install.php";

		document.addphoto_form.submit();

	}

 

/*******************************************************

// 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)

		{

			aEmailIds = pmStr.split(",")

			vResValidate = true;

			for(vLoopEmail = 0; vLoopEmail < aEmailIds.length; vLoopEmail++)

			{

				if (!isEmail(aEmailIds[vLoopEmail]))

				{

					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

		******************************/



		pmStr = trim(pmStr);	//#-- trim the string

		pmStr  = pmStr.replace('\r\n',"");

		pmStr  = pmStr.replace('\n',"");

		if (pmStr == "") return false;

		if (pmStr.length > 50) return false;

		if (!isRegExpSupported()) return (pmStr.indexOf(".") > 2) && (pmStr.indexOf("@") > 0);	//#-- is regular expressions supported

	

		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 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 fillProductQuantity(pmSelectObj)

	{



		var vQuantityName  =  pmSelectObj.name;

		vChkCount =  aNameOnly.length;

		//for Quick selecting  operation......

		for (i=0; i < vChkCount ; i++)

		{

			vQtyObject =  eval("document.sizeform['"+ vQuantityName +"_" +aNameOnly[i]+ "']");

			vQtyObject.value = (pmSelectObj.value == "" ? elements[i].value : pmSelectObj.value);

		}

	}

	

	

	/* ***   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 for follow up email.....

function MyClose(pmID, pmShareID)

{

	var top=self.screenTop;

	if (top > 9000) 

	{

		vPM  =  window.open("share_follow_mail.php?id="+pmID+"&share_id="+pmShareID,"Follow_up","width=400, height=565,top=0,left=0");

	} 

}



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));

	}
