	// Global vars 
	
	// fn_SetAction
	//	Function Description : 
	//		This function will set the action(hidden) variable 
	//
	function fn_SetAction(strAction)
	{
		// Set the value 
		document.frmAction.txtAction.value = strAction;
	}
	// Function fn_SetAction END 

	// fn_GoToAction
	//	Function Description : 
	//		This will submit the form 
	//	
	function fn_GoToAction(strAction)
	{
		
		//document.frmAction.action = "index.php";
//		if(document.frmAction.txtAction.value == "")
//		{ 
			fn_SetAction(strAction);
//		}
	//	document.frmAction.action = "index.php?txtAction="+strAction
		//document.frmAction.method="GET";
		document.frmAction.submit();
	}
	// Function fn_GoToAction END 

	function fn_ReditectAction(strAction)
	{
		self.location = "index.php?txtAction="+strAction;
	}
	// Function fn_GoToAction END 


	// fn_GoToAction
	//	Function Description : 
	//		This will submit the form 
	//	
	function fn_Menu(strAction)
	{
		// mainCat_id is for displaying the main category list...it should be cleared when clicked on other menu links
		document.frmAction.mainCat_id.value="";
		document.frmAction.PgInation.value="";
		document.frmAction.Bday_Id.value="";
		//fn_GoToAction(strAction);
	}
	// Function fn_GoToAction END 


	// fn_GoToAction
	//	Function Description : 
	//		This will submit the form 
	//	
	function fn_GoToActionNPagin(strAction)
	{
		// mainCat_id is for displaying the main category list...it should be cleared when clicked on other menu links
		document.frmAction.PgInation.value="";
		//2-Apr-2007fn_GoToAction(strAction);
		self.location = "index.php?txtAction="+strAction;
	}
	// Function fn_GoToAction END 


	//fn_SetHidden
	//Function Description : 
	//This function will set a particular hidden text box to the a particulat value(passed as parameter)
	function fn_SetHidden(hiddenBox_ID,hiddenBox_value,strAction)
	{
		//document.getElementById(hiddenBox_ID).value=hiddenBox_value;
		
		window.location = "index.php?txtAction="+strAction+"&"+hiddenBox_ID+"="+hiddenBox_value;
		//2-Apr-2007fn_GoToAction(strAction);
	}
	// Function fn_SetHidden END 


	//fn_SetHidden1
	//Function Description : 
	//This function will set a particular hidden text box to the a particulat value(passed as parameter)
	function fn_SetHidden1(hiddenBox_ID,hiddenBox_value,strAction)
	{
		document.getElementById(hiddenBox_ID).value=hiddenBox_value;
		
//		window.location = "index.php?txtAction="+strAction+"&"+hiddenBox_ID+"="+hiddenBox_value;
		fn_GoToAction(strAction);
	}
	// Function fn_SetHidden1 END 

	//fn_SetHiddebNVal
	//Function Description : 
	//This function will set a particular hidden text box to the a particulat value(passed as parameter)
	//and also calls validateForm function
	function fn_SetHiddenNVal(hiddenBox_ID,hiddenBox_value,strAction)
	{
		document.getElementById(hiddenBox_ID).value=hiddenBox_value;
		fn_ValidateForm(strAction);
	}
	//Function fn_SetHiddebNVal END


	// fn_GoToAction
	//	Function Description : 
	//		This will submit the form 
	//	
	function fn_GoToActionNPaginNSetHidden(hiddenBox_ID,hiddenBox_value,strAction)
	{
		document.getElementById(hiddenBox_ID).value=hiddenBox_value;
		document.frmAction.PgInation.value="";
		fn_GoToAction(strAction);
	}
	// Function fn_GoToAction END 

//this function is not working
	function fn_DeleteBox(hiddenBox_ID,hiddenBox_value,strAction)
	{
		 var val_hiddenBox_ID=hiddenBox_ID;
		 var val_hiddenBox_value=hiddenBox_value
		 var val_strAction=strAction;
		 var Chk= confirm("Do You want to Delete?");
		 if (Chk==true)
		 {
			fn_GoToActionNPaginNSetHidden(val_hiddenBox_ID,val_hiddenBox_value,val_strAction);
		 }
		 else
		 {
			 return false;
		 }
	}

	// fn_GetHtmlObject 
	// Function Description:
	//		Function Return the object of html element
	//		Takes One Argument
	//		First -- Id of Html Element
	//
	function fn_GetHtmlObject(L_strHtmlElementId)
	{
		// Get the object 
		var objName = document.getElementById(L_strHtmlElementId);
		
		// Return the object 
		return objName;
	}
	// Function fn_GetHtmlObject END 



	// fn_LTrim
	// Function Description:
	//		Trim the string from the left of the string 
	//	
	function fn_LTrim(value) 
	{
		// Set the pattern 
		var re = /\s*((\S+\s*)*)/;
		
		// Return the replaced value 
		return value.replace(re, "$1");
	}
	// Function fn_LTrim END 

	// fn_RTrim 
	// Function Description:	
	//		Removes ending whitespaces
	//
	function fn_RTrim(value) 
	{
		// Set the pattern 
		var re = /((\s*\S+)*)\s*/;
		
		// Return the replaced value 
		return value.replace(re, "$1");
	}
	// Function fn_RTrim END 



	// fn_Trim 
	// Function Description:	
	//		Removes leading and ending whitespaces
	//
	function fn_Trim(value) 
	{
		return fn_LTrim(fn_RTrim(value));
	}
	// Function fn_Trim END 



	// fn_EMailCheck 
	// Function Description:
	//		This function validates the email 
	//
	function fn_EMailCheck(str, name) 
	{
		var at = "@";
		var dot = ".";
		var lat = str.indexOf(at);
		var lstr = str.length;
		var ldot = str.indexOf(dot);

		if(str.indexOf(at) == -1)
		{
			return false;
		}

		if(str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr)
		{
			return false;
		}

		if(str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr)
		{
			return false;
		}

		if(str.indexOf(at,(lat + 1)) != -1)
		{
			return false;
		}

		if(str.substring(lat-1, lat) == dot || str.substring(lat + 1, lat + 2) == dot)
		{
			return false;
		}

		if (str.indexOf(dot,(lat + 2)) == -1)
		{
			return false;
		}

		if (str.indexOf(" ") != -1)
		{
			return false;
		}
		return true;
	}
	// Function fn_EMailCheck END 



	function isInteger(val){if(isBlank(val)){return false;}for(var i=0;i<val.length;i++){if(!isDigit(val.charAt(i))){return false;}}return true;}
	function isNumeric(val){return(parseFloat(val,10)==(val*1));}
	function isArray(obj){return(typeof(obj.length)=="undefined")?false:true;}
	function isDigit(num){if(num.length>1){return false;}var string="1234567890";if(string.indexOf(num)!=-1){return true;}return false;}



	//testing
	function fn_hideTextBox()
	{
		for (i=1;i<=20;i++)
		{
			document.getElementById('div_txtid'+i).style.display="none";
		}
	}

	//fn_generateTextBox()
	//Function Description : 
	//This function unhides text box used while sending ecard
	function fn_generateTextBox(frmtypeid)
	{
		fn_hideTextBox();
		var count=document.getElementById(frmtypeid).value;
		for (i=1;i<=count;i++)
		{
			document.getElementById('div_txtid'+i).style.display="inline";
		}
	}

	function fn_hideFrmObj(frmObjId)
	{
		document.getElementById(frmObjId).style.display="NONE";
	}

	function fn_unHideFrmObj(frmObjId)
	{
		document.getElementById(frmObjId).style.display="inline";
	}

	function fn_remUserPass()
	{
		Ck_UsrName=getCookie('loginDetailsUser')
		Ck_UsrPass=getCookie('loginDetailsPassword')

		if((Ck_UsrName!=null) && (Ck_UsrPass!=null))
		{
			document.frmAction.txtUserName.value=getCookie('loginDetailsUser');
			document.frmAction.txtPassword.value=getCookie('loginDetailsPassword');
		}
	}

	function fn_calendarNav(year,month,day,StrAction)
	{
		//document.getElementById("Cal_Year").value=year;
		//document.getElementById("Cal_Month").value=month;
		//document.getElementById("Cal_Day").value=day;
		newaction = StrAction+"&Cal_Year="+year+"&Cal_Month="+month+"&Cal_Day="+day;
		fn_ReditectAction(newaction);
	}

	function fn_calendarNavToDtl(year,month,day,hiddenBox_ID,strAction)
	{
		document.getElementById("Cal_Year").value=year;
		document.getElementById("Cal_Month").value=month;
		document.getElementById("Cal_Day").value=day;
		fn_GoToAction(strAction);
	}

	function submitPPForm()
	{
		document.getElementById("return").value=document.getElementById("return").value+"?task=actAckPayPal";
		document.frmAction.action ="https://www.paypal.com/cgi-bin/webscr";
	//	document.frmAction.action ="https://www.belahost.com/pp/";
		document.frmAction.submit();
	}
