
var intPrevRow=0;
function chkAll(chChkd, chId)
{
	chId = chId.replace("_", ":");
	chId = chId.replace("::", ":_");
	if(chChkd)
		msg = "Do you want Activate All.";
	else
		msg = "Do you want De-Activate All."
	if (confirm(msg))
	{
		__doPostBack(chId,'');
	}
	else
		return false;
}
function chkAllDelete(chkChecked,chkId)
{
	if(chkChecked)
		msg = "Do you want Select All";
	else
		msg = "Do You want Unselect All";
	if(confirm(msg))
	{
		__doPostBack(chkId,'');
	}
	else
		return false;
}
function GetScroll(divscroll)
{
	document.frmMasterLanguage['txtScrollPos'].value = divscroll.scrollTop;
}
function SetScroll(divscroll)
{
	divscroll.scrollTop = document.frmMasterLanguage['txtScrollPos'].value;
}
function OnMouseOverColor(trColor)
{
	trColor.style.backgroundColor = '#DBD5B3';	
	HighlightRow(intPrevRow);
}
function OnMouseOutColor(trColor)
{
	trColor.style.backgroundColor = "";	
	HighlightRow(intPrevRow);
}
function HighlightRow(intRowColor)
{
	if(intRowColor != 0)
		dgDisplay.rows[intRowColor].style.backgroundColor = '#DBD5B3';
}
function DeHighlightRow(intRowColor)
{
	dgDisplay.rows[intRowColor].style.backgroundColor = '';
}
function ErrorBlank()
{
	document.all['lblStatus'].innerText = "";
	document.all['imgStatus'].src = "../skin1/images/spacer.gif";
}
function CheckTransaction()
{
	if(trim(document.frmMasterTransactionSearch['txtAmount'].value) == "")
	{
		alert("Please Enter the Amount");
		document.frmMasterTransactionSearch['txtAmount'].focus();
		return false;
	}
	if(document.frmMasterTransactionSearch['rbCheck'].checked == true)
	{
		if(trim(document.frmMasterTransactionSearch['txtCheckDated'].value) == "")
		{
			alert("Please Enter the Check Date");
			document.frmMasterTransactionSearch['txtCheckDated'].focus();
			return false;
		}
		if (isDate(document.frmMasterTransactionSearch['txtCheckDated'].value)==false)
		{
			document.frmMasterTransactionSearch['txtCheckDated'].focus();
			document.frmMasterTransactionSearch['txtCheckDated'].select();
			return false;
		}
		if(trim(document.frmMasterTransactionSearch['txtCheckNo'].value) == "")
		{
			alert("Please Enter the Check Number");
			document.frmMasterTransactionSearch['txtCheckNo'].focus();
			return false;
		}	
		if(trim(document.frmMasterTransactionSearch['txtBankName'].value) == "")
		{
			alert("Please Enter the Bank Name");
			document.frmMasterTransactionSearch['txtBankName'].focus();
			return false;
		}	
		if(trim(document.frmMasterTransactionSearch['txtAccountNo'].value) == "")
		{
			alert("Please Enter the Account Number");
			document.frmMasterTransactionSearch['txtAccountNo'].focus();
			return false;
		}	
	}
	if(document.frmMasterTransactionSearch['rbOther'].checked == true)
	{
		if(trim(document.frmMasterTransactionSearch['txtOthers'].value) == "")
		{
			alert("Please Enter the Information about the Transaction");
			document.frmMasterTransactionSearch['txtOthers'].focus();
			return false;
		}	
	}
}
function CheckOrganization()
{
	if(trim(document.frmOrganization['txtOrgLegalName'].value) == "")
	{
		alert("Please Enter Organization Legal Name");
		document.frmOrganization['txtOrgLegalName'].focus();
		return false;
	}
	if(trim(document.frmOrganization['txtOrgDispName'].value) == "")
	{
		alert("Please Enter Organization Display Name");
		document.frmOrganization['txtOrgDispName'].focus();
		return false;
	}
	if(document.frmOrganization['hidLogo'].value == "" && document.frmOrganization['fileOrgLogo'].value == "")
	{
		alert("Please Select Organization Logo");
		document.frmOrganization['fileOrgLogo'].focus();
		return false;
	}
	if(trim(document.frmOrganization['txtOrgWebsite'].value) == "")
	{
		alert("Please Enter Organization Website URL");
		document.frmOrganization['txtOrgWebsite'].focus();
		return false;
	}
	if(trim(document.frmOrganization['txtOrgTelephone'].value) == "")
	{
		alert("Please Enter Organization Telephone");
		document.frmOrganization['txtOrgTelephone'].focus();
		return false;
	}
	if(trim(document.frmOrganization['txtOrgFAX'].value) == "")
	{
		alert("Please Enter Organization FAX");
		document.frmOrganization['txtOrgFAX'].focus();
		return false;
	}	
}

function CheckDates()
{			
	if(!(document.all['txtFrom'].value == "" && document.all['txtTo'].value == ""))
	{
		if(document.all['txtFrom'].value == "")
		{
			alert("Please Enter the From Date");
			document.all['txtFrom'].focus();
			return false;
		}
		if (isDate(document.all['txtFrom'].value)==false)
		{
			document.all['txtFrom'].focus();
			document.all['txtFrom'].select();
			return false;
		}
		if(document.all['txtTo'].value == "")
		{
			alert("Please Enter the To Date");
			document.all['txtTo'].focus();
			return false;
		}
		if (isDate(document.all['txtTo'].value)==false)
		{
			document.all['txtTo'].focus();
			document.all['txtTo'].select();
			return false;
		}
		var FromDateValid = document.all['txtFrom'].value;
		
		var fromMonth = FromDateValid.substring(0, FromDateValid.indexOf("/"));
		var fromDate = FromDateValid.substring(FromDateValid.indexOf("/")+1, FromDateValid.lastIndexOf("/"));
		var fromYear = FromDateValid.substring(FromDateValid.lastIndexOf("/")+1, FromDateValid.length);
		
		var ToDateValid = document.all['txtTo'].value;
		
		var toMonth = ToDateValid.substring(0, ToDateValid.indexOf("/"));
		var toDate = ToDateValid.substring(ToDateValid.indexOf("/")+1, ToDateValid.lastIndexOf("/"));
		var toYear = ToDateValid.substring(ToDateValid.lastIndexOf("/")+1, ToDateValid.length);
		
		/*if(fromYear > toYear)
		{
			alert('From date should be Lesser than To date');
			document.all['txtFrom'].focus();
			document.all['txtFrom'].select();
			return false;
		}
		else if(fromYear <= toYear)
		{	
			if(toYear > fromYear)
			{
				return true;
			}
			else
			{
				if(parseInt(fromMonth * 1) > parseInt(toMonth * 1))
				{
					alert('From date Should be Lesser than To date');
					document.all['txtFrom'].focus();
					document.all['txtFrom'].select();
					return false;
				}
				else if(parseInt(fromMonth * 1) <= parseInt(toMonth * 1))
				{
					if(parseInt(fromDate * 1) > parseInt(toDate * 1) && parseInt(fromMonth * 1) >= parseInt(toMonth * 1))
					{
						alert('From date should be Lesser than to date');
						document.all['txtFrom'].focus();
						document.all['txtFrom'].select();
						return false;
					}
				}
			}
		}*/
		var fromD = new Date(FromDateValid);
		var toD = new Date(ToDateValid);
		if(fromD > toD)
		{
			alert('From Date should be Lesser than To date');
			return false;
		}
	}
	else
	{
		alert("Please Select or Enter From Date and To Date");
		return false;
	}
}
			
function CheckOrganizationAddress()
{
	if(trim(document.frmOrganizationAddress['txtLocationName'].value) == "")
	{
		alert("Please Enter Organization Location Name");
		document.frmOrganizationAddress['txtLocationName'].focus();
		return false;
	}
	if(trim(document.frmOrganizationAddress['txtAddress1'].value) == "")
	{
		alert("Please Enter Organization Address");
		document.frmOrganizationAddress['txtAddress1'].focus();
		return false;
	}
	if(trim(document.frmOrganizationAddress['txtCity'].value) == "")
	{
		alert("Please Enter the City");
		document.frmOrganizationAddress['txtCity'].focus();
		return false;
	}
	if(document.frmOrganizationAddress['ddlState'].value == "")
	{
		alert("Please Select the State");
		document.frmOrganizationAddress['ddlState'].focus();
		return false;
	}
	if(document.frmOrganizationAddress['ddlCountry'].value == "")
	{
		alert("Please Select the Country");
		document.frmOrganizationAddress['ddlCountry'].focus();
		return false;
	}	
	if(trim(document.frmOrganizationAddress['txtZip'].value) == "")
	{
		alert("Please Enter the Zip/Postal Code.");
		document.frmOrganizationAddress['txtZip'].focus();
		return false;
	}
	if(!regexp(document.frmOrganizationAddress['txtZip'], "0123456789"))
	{
		alert("Your Zip Contains Invalid Characters.\n Only the following characters are allowed : 0123456789");
		document.frmOrganizationAddress['txtZip'].select();
		document.frmOrganizationAddress['txtZip'].focus();
		return false;
	}
	if(document.frmOrganizationAddress['hidZipRange'].value != "")
	{
		if(document.frmOrganizationAddress['txtZip'].value.length > document.frmOrganizationAddress['hidZipRange'].value)
		{
			alert("Invalid Zip/Postal Code.");
			document.frmOrganizationAddress['txtZip'].focus();
			document.frmOrganizationAddress['txtZip'].select();
			return false;
		}
	}
	if(trim(document.frmOrganizationAddress['txtPhone'].value) == "")
	{
		alert("Please Enter the Phone Number");
		document.frmOrganizationAddress['txtPhone'].focus();
		return false;
	}
	if(!regexp(document.frmOrganizationAddress['txtPhone'], "0123456789-+() "))
	{
		alert("Your Phone Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmOrganizationAddress['txtPhone'].select();
		document.frmOrganizationAddress['txtPhone'].focus();
		return false;
	}
	if(trim(document.frmOrganizationAddress['txtMobile'].value) == "")
	{
		alert("Please Enter the Mobile Number");
		document.frmOrganizationAddress['txtMobile'].focus();
		return false;
	}
	if(!regexp(document.frmOrganizationAddress['txtMobile'], "0123456789-+()"))
	{
		alert("Your Mobile Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmOrganizationAddress['txtMobile'].select();
		document.frmOrganizationAddress['txtMobile'].focus();
		return false;
	}
	if(trim(document.frmOrganizationAddress['txtFax'].value) == "")
	{
		alert("Please Enter the FAX");
		document.frmOrganizationAddress['txtFax'].focus();
		return false;
	}
	if(!regexp(document.frmOrganizationAddress['txtFax'], "0123456789- "))
	{
		alert("Your FAX Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmOrganizationAddress['txtFax'].select();
		document.frmOrganizationAddress['txtFax'].focus();
		return false;
	}
	if(trim(document.frmOrganizationAddress['txtEmail'].value) == "")
	{
		alert("Please Enter the Email Address");
		document.frmOrganizationAddress['txtEmail'].focus();
		return false;
	}
	if(!emailCheck(document.frmOrganizationAddress['txtEmail'].value))
	{
		document.frmOrganizationAddress['txtEmail'].select();
		document.frmOrganizationAddress['txtEmail'].focus();
		return false;
	}
}



function OrgAddressEditValues(lname, cid, sid, city, add1, add2, add3, zip, ph, mobile, fax, email, intCurrentRow)
{
	document.frmOrganizationAddress['hidLocation'].value = lname;
	document.frmOrganizationAddress['ddlCountry'].value = cid;
	document.frmOrganizationAddress['ddlState'].value = sid;
	document.frmOrganizationAddress['txtLocationName'].value = lname;
	document.frmOrganizationAddress['txtAddress1'].value = add1;
	document.frmOrganizationAddress['txtAddress2'].value = add2;
	document.frmOrganizationAddress['txtCity'].value = city;
	document.frmOrganizationAddress['txtZip'].value = zip;
	document.frmOrganizationAddress['txtPhone'].value = ph;
	document.frmOrganizationAddress['txtMobile'].value = mobile;
	document.frmOrganizationAddress['txtFax'].value = fax;
	document.frmOrganizationAddress['txtEmail'].value = email;
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);	
}

function makeVisible(intVal)
{
	try
	{
		if(document.all['rbTicket'].checked == true && intVal == 0)
			makeVisible(1)
		else if(document.all['rbUser'].checked == true && intVal == 0)
			makeVisible(2)
		else
		{
			document.all['txtUser'].disabled = true
			document.all['txtTicketNumber'].disabled = true
			document.all['rbTicket'].checked = false
			document.all['rbUser'].checked = false
			if(intVal == 1)
			{
				document.all['txtTicketNumber'].disabled = false
				document.all['rbTicket'].checked = true						
				document.all['txtTicketNumber'].focus()
			}
			if(intVal == 2)
			{
				document.all['txtUser'].disabled = false
				document.all['rbUser'].checked = true
				document.all['txtUser'].focus()
			}
		}
	}
	catch(err){}
}	

function makeVisiblex(intVal)
{
	try
	{
		if(document.all['rbTicket'].checked == true && intVal == 0)
			makeVisible(1)
		else if(document.all['rbUser'].checked == true && intVal == 0)
			makeVisible(2)
		else if(document.all['rbName'].checked == true && intVal == 0)
			makeVisible(3)
		else
		{
			document.all['txtUser'].disabled = true
			document.all['txtTicketNumber'].disabled = true
			document.all['txtName'].disabled = true
			document.all['rbTicket'].checked = false
			document.all['rbUser'].checked = false
			document.all['rbName'].checked = false
			
			if(intVal == 1)
			{
				document.all['txtTicketNumber'].disabled = false
				document.all['rbTicket'].checked = true						
				document.all['txtTicketNumber'].focus()
			}
			if(intVal == 2)
			{
				document.all['txtUser'].disabled = false
				document.all['rbUser'].checked = true
				document.all['txtUser'].focus()
			}
			if(intVal == 3)
			{
				document.all['txtName'].disabled = false
				document.all['rbName'].checked = true
				document.all['txtName'].focus()
			}
			
		}
	}
	catch(err){}
}		
				
function CheckMasterCountry()
{
	if(trim(document.frmMasterCountry['txtCountryCode'].value) == "")
	{
		alert("Please Enter Country Code");
		document.frmMasterCountry['txtCountryCode'].focus();
		return false;
	}
	if(trim(document.frmMasterCountry['txtCountryName'].value) == "")
	{
		alert("Please Enter Country Name");
		document.frmMasterCountry['txtCountryName'].focus();
		return false;
	}
	if(trim(document.frmMasterCountry['txtCurrency'].value) == "")
	{
		alert("Please Enter Currency");
		document.frmMasterCountry['txtCurrency'].focus();
		return false;
	}	
	if(document.frmMasterCountry['ddlLanguage'].value == "")
	{
		alert("Please Select Language");
		document.frmMasterCountry['ddlLanguage'].focus();
		return false;
	}
}
function CheckReviews()
{
    if(trim(document.frmCategoryDisplay['txtReviewTitle'].value) == "")
	{
		alert("Please Enter Review Title");
		document.frmCategoryDisplay['txtReviewTitle'].focus();
		return false;
	}
	if(trim(document.frmCategoryDisplay['txtReview'].value) == "")
	{
		alert("Please Enter Review");
		document.frmCategoryDisplay['txtReview'].focus();
		return false;
	}
}
function checkCard()
{  
	if(document.frmAllocateGiftCards['txtGCName'].value == "")
	{
		alert("Please Enter the Card Name");
		document.frmAllocateGiftCards['txtGCName'].focus();
		return false;
	}
	if(!regexp(document.frmAllocateGiftCards['txtGCName'], "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789. "))
	{
		alert("Name Contains Invalid Characters.\nOnly The Following Characters Are allowed:\nAlphanumerics");
		document.frmAllocateGiftCards['txtGCName'].select();
		document.frmAllocateGiftCards['txtGCName'].focus();
		return false;
	}
	if(document.frmAllocateGiftCards['txtAmount'].value == "")
	{
		alert("Please Enter the Amount");
		document.frmAllocateGiftCards['txtAmount'].focus();
		return false;
	}
	if(!regexp(document.frmAllocateGiftCards['txtAmount'], "0123456789."))
	{
		alert("Amount Contains Invalid Characters.");
		document.frmAllocateGiftCards['txtAmount'].select();
		document.frmAllocateGiftCards['txtAmount'].focus();
		return false;
	}
	/*if(document.frmAllocateGiftCards['txtValid'].value == "")
	{
		alert("Please select the date.");
		document.frmAllocateGiftCards['txtValid'].focus();
		return false;
	}*/
	if(!isAnyCheckBoxChecked())
	{
		alert("Select a record to send");
		return false;
	}
}
function isAnyCheckBoxChecked()
{
	var retValue = false;

	elm = document.frmAllocateGiftCards.elements;
	for(i=0;i<elm.length;i++)
	{
		if(elm[i].type=="checkbox")
		{
			if(elm[i].checked)
			{
				retValue = true;
				break;
			}
		}
	}
	return retValue
}
function CheckCategoryWriteReview()
{
    if(trim(document.frmCategoryWriteReviews['txtReviewTitle'].value) == "")
	{
		alert("Please Enter Review Title");
		document.frmCategoryWriteReviews['txtReviewTitle'].focus();
		return false;
	}
	if(trim(document.frmCategoryWriteReviews['txtReview'].value) == "")
	{
		alert("Please Enter Review");
		document.frmCategoryWriteReviews['txtReview'].focus();
		return false;
	}
}
function CountryEditValues(cid, ccode, cname, currency, cdesc, zip, mainlanguage, intCurrentRow)
{
	document.frmMasterCountry['hidCountryId'].value = cid;
	document.frmMasterCountry['txtCountryCode'].value = ccode;
	document.frmMasterCountry['txtCountryName'].value = cname;
	document.frmMasterCountry['txtCurrency'].value = currency;
	document.frmMasterCountry['txtCurDescription'].value = cdesc;
	document.frmMasterCountry['txtZipRange'].value = zip;
	document.frmMasterCountry['ddlLanguage'].value = mainlanguage;					
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}

function CheckMasterState()
{
	if(trim(document.frmMasterState['ddlCountry'].value) == "")
	{
		alert("Please Select the Country");
		document.frmMasterState['ddlCountry'].focus();
		return false;
	}
	if(trim(document.frmMasterState['txtStateCode'].value) == "")
	{
		alert("Please Enter the State Code");
		document.frmMasterState['txtStateCode'].focus();
		return false;
	}
	if(trim(document.frmMasterState['txtStateName'].value) == "")
	{
		alert("Please Enter the State Name");
		document.frmMasterState['txtStateName'].focus();
		return false;
	}
	if(document.frmMasterState['ddlLanguage'].value == "")
	{
		alert("Please Select the Language");
		document.frmMasterState['ddlLanguage'].focus();
		return false;
	}
}
function CheckMasterAddressType()
{
	if(trim(document.frmMasterAddressType['ddlCountry'].value) == "")
	{
		alert("Please Select the Country");
		document.frmMasterAddressType['ddlCountry'].focus();
		return false;
	}
	if(trim(document.frmMasterAddressType['ddlStateType'].value) == "")
	{
		alert("Please Enter the State Type");
		document.frmMasterAddressType['ddlStateType'].focus();
		return false;
	}
	if(trim(document.frmMasterAddressType['ddlCityType'].value) == "")
	{
		alert("Please Enter the City Type");
		document.frmMasterAddressType['ddlCityType'].focus();
		return false;
	}
	if(document.frmMasterAddressType['ddlZipType'].value == "")
	{
		alert("Please Enter Zip Type");
		document.frmMasterAddressType['ddlZipType'].focus();
		return false;
	}
	if(document.frmMasterAddressType['txtRange'].value == "")
	{
		alert("Please Enter Zip Range");
		document.frmMasterAddressType['txtRange'].focus();
		return false;
	}
}
function StateEditValues(sid, scode, sname, cid, lid, intCurrentRow)
{
	document.frmMasterState['hidStateId'].value = sid;
	document.frmMasterState['txtStateCode'].value = scode;
	document.frmMasterState['txtStateName'].value = sname;
	document.frmMasterState['ddlCountry'].value = cid;
	document.frmMasterState['ddlLanguage'].value = lid;					
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function AddressTypeEditValues(sid, cname,addresslines, stype, ctype, ztype,zctype,zrange, intCurrentRow)
{
	document.frmMasterAddressType['hidStateId'].value = sid;
	document.frmMasterAddressType['ddlCountry'].value = cname;
	if(addresslines == 1)
	{
		document.frmMasterAddressType['AddressLine1'].checked = true;
		document.frmMasterAddressType['AddressLine2'].checked = false;
		document.frmMasterAddressType['AddressLine3'].checked = false;
	}
	else if(addresslines == 2)
	{
		document.frmMasterAddressType['AddressLine1'].checked = true;
		document.frmMasterAddressType['AddressLine2'].checked = true;
		document.frmMasterAddressType['AddressLine3'].checked = false;	
	}
	else if(addresslines == 3)
	{
		document.frmMasterAddressType['AddressLine1'].checked = true;
		document.frmMasterAddressType['AddressLine2'].checked = true;
		document.frmMasterAddressType['AddressLine3'].checked = true;	
	}
	
	
	document.frmMasterAddressType['ddlStateType'].value = stype;
	document.frmMasterAddressType['ddlCityType'].value = ctype;
	document.frmMasterAddressType['ddlZipType'].value = ztype;
	
	if(zctype == "AN")
	{	
		document.frmMasterAddressType['rdAN'].checked = true;
	}
	else
	{
		document.frmMasterAddressType['rdN'].checked = true;
	}
		
	document.frmMasterAddressType['txtRange'].value = zrange;					
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}	
function CheckMasterMail()
{
	if(document.frmMasterMail['txtMailSubject'].value == "")
	{
		alert("Please Enter Mail Subject");
		document.frmMasterMail['txtMailSubject'].focus();
		return false;
	}
	if(document.frmMasterMail['txtMailBody'].value == "")
	{
		alert("Please Enter Mail Body");
		document.frmMasterMail['txtMailBody'].focus();
		return false;
	}
	if(document.frmMasterMail['ddlMailType'].value == "")
	{
		alert("Please Select Mail Type");
		document.frmMasterMail['ddlMailType'].focus();
		return false;
	}		
}
function CheckMasterFAQ()
{
	if(document.frmMasterManageFAQ['txtQuestion'].value == "")
	{
		alert("Please Enter the Question");
		document.frmMasterManageFAQ['txtQuestion'].focus();
		return false;
	}
	if(document.frmMasterManageFAQ['txtAnswer'].value == "")
	{
		alert("Please Enter the Answer");
		document.frmMasterManageFAQ['txtAnswer'].focus();
		return false;
	}
}
function CheckMasterHelp()
{
	if(document.frmMasterManageHelp['txtQuestion'].value == "")
	{
		alert("Please Enter the Question");
		document.frmMasterManageHelp['txtQuestion'].focus();
		return false;
	}
	if(document.frmMasterManageHelp['txtAnswer'].value == "")
	{
		alert("Please Enter the Answer");
		document.frmMasterManageHelp['txtAnswer'].focus();
		return false;
	}
	if(document.frmMasterManageHelp['ddlMailType'].value == "")
	{
		alert("Please Select Help Type");
		document.frmMasterManageHelp['ddlMailType'].focus();
		return false;
	}		
}
function CheckMasterAboutUs()
{
	if(document.frmMasterManageAboutUs['txtTitle'].value == "")
	{
		alert("Please Enter the Title");
		document.frmMasterManageAboutUs['txtTitle'].focus();
		return false;
	}
	/*if(document.frmMasterManageAboutUs['txtDescription'].value == "")
	{
		alert("Please Enter the Description");
		document.frmMasterManageAboutUs['txtDescription'].focus();
		return false;
	}*/
}
function CheckMasterPRelease()
{
	if(document.frmMasterManagePRelease['txtTitle'].value == "")
	{
		alert("Please Enter the Title");
		document.frmMasterManagePRelease['txtTitle'].focus();
		return false;
	}
	if(document.frmMasterManagePRelease['txtDescription'].value == "")
	{
		alert("Please Enter the Description");
		document.frmMasterManagePRelease['txtDescription'].focus();
		return false;
	}
	if(document.frmMasterManagePRelease['txtReleasedDate'].value == "")
	{
		alert("Please Enter Release Date");
		document.frmMasterManagePRelease['txtReleasedDate'].focus();
		return false;
	}		
}
function CheckMasterContests()
{
	if(document.frmMasterManageContests['txtTitle'].value == "")
	{
		alert("Please Enter the Title");
		document.frmMasterManageContests['txtTitle'].focus();
		return false;
	}
	if(document.frmMasterManageContests['txtDescription'].value == "")
	{
		alert("Please Enter the Description");
		document.frmMasterManageContests['txtDescription'].focus();
		return false;
	}
	/*if(document.frmMasterManageContests['txtFromDate'].value == "")
	{
		alert("Please Enter From Date");
		document.frmMasterManageContests['txtFromDate'].focus();
		return false;
	}		
	if(document.frmMasterManageContests['txtToDate'].value == "")
	{
		alert("Please Enter To Date");
		document.frmMasterManageContests['txtToDate'].focus();
		return false;
	}*/
	
	//////////////////////////////////////////////////////////
	
	if(!(document.all['txtFromDate'].value == "" && document.all['txtToDate'].value == ""))
	{
	if(document.all['txtFromDate'].value == "")
	{
		alert("Please Enter the From Date");
		document.all['txtFromDate'].focus();
		return false;
	}
	if (isDate(document.all['txtFromDate'].value)==false)
	{
		document.all['txtFromDate'].focus();
		document.all['txtFromDate'].select();
		return false;
	}
	if(document.all['txtToDate'].value == "")
	{
		alert("Please Enter the To Date");
		document.all['txtToDate'].focus();
		return false;
	}
	if (isDate(document.all['txtToDate'].value)==false)
	{
		document.all['txtToDate'].focus();
		document.all['txtToDate'].select();
		return false;
	}
	var FromDateValid = document.all['txtFromDate'].value;
		
		var fromMonth = FromDateValid.substring(0, FromDateValid.indexOf("/"));
		var fromDate = FromDateValid.substring(FromDateValid.indexOf("/")+1, FromDateValid.lastIndexOf("/"));
		var fromYear = FromDateValid.substring(FromDateValid.lastIndexOf("/")+1, FromDateValid.length);
		
		var ToDateValid = document.all['txtToDate'].value;
		
		var toMonth = ToDateValid.substring(0, ToDateValid.indexOf("/"));
		var toDate = ToDateValid.substring(ToDateValid.indexOf("/")+1, ToDateValid.lastIndexOf("/"));
		var toYear = ToDateValid.substring(ToDateValid.lastIndexOf("/")+1, ToDateValid.length);
		
		if(fromYear > toYear)
			{
				alert('From date should be Lesser than To date');
				document.all['txtFromDate'].focus();
				document.all['txtFromDate'].select();
				return false;
			}
			else if(fromYear <= toYear)
			{	
				if(parseInt(fromMonth * 1) > parseInt(toMonth * 1))
				{
					alert('From date Should be Lesser than To date');
					document.all['txtFromDate'].focus();
					document.all['txtFromDate'].select();
					return false;
				}
				else if(parseInt(fromMonth * 1) <= parseInt(toMonth * 1))
				{
					if(parseInt(fromDate * 1) > parseInt(toDate * 1) && parseInt(fromMonth * 1) >= parseInt(toMonth * 1))
					{
						alert('From date should be Lesser than to date');
						document.all['txtFromDate'].focus();
						document.all['txtFromDate'].select();
						return false;
					}
				}
			}
		}
		else
		{
			alert("Please Select or Enter From Date and To Date");
			return false;
		}
	////////////////////////////////////////////////////////////////
}
function MailEditValues(mid, msubject, mbody, mcode, mtype, intCurrentRow)
{
	var bodymsg = mbody.replace(/<br>/g,"\r\n");
	document.frmMasterMail['hidMailId'].value = mid;
	document.frmMasterMail['txtMailSubject'].value = msubject;
	document.frmMasterMail['txtMailBody'].value = bodymsg;
	document.frmMasterMail['txtMailCode'].value = mcode;
	document.frmMasterMail['ddlMailType'].value = mtype;					
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function FAQEditValues(fid, question, answer, intCurrentRow)
{
	var bodymsg = answer.replace(/<br>/g,"\r\n");
	document.frmMasterManageFAQ['hidFaqId'].value = fid;
	document.frmMasterManageFAQ['txtQuestion'].value = question;
	document.frmMasterManageFAQ['txtAnswer'].value = bodymsg;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function HelpEditValues(hid, question, answer, cat, intCurrentRow)
{
	var bodymsg = answer.replace(/<br>/g,"\r\n");
	bodymsg = answer.replace(/&quot;/g,"\"");
	document.frmMasterManageHelp['hidHelpId'].value = hid;
	document.frmMasterManageHelp['txtQuestion'].value = question;
	document.frmMasterManageHelp['txtAnswer'].value = bodymsg;
	document.frmMasterManageHelp['ddlMailType'].value = cat;					
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function AboutEditValues(aid, title, desc, intCurrentRow)
{
	var bodymsg = desc.replace(/<br>/g,"\r\n");
	bodymsg = desc.replace(/&quote;/g,"\"");
	
	var titleMes = title.replace(/<br>/g,"\r\n");
	titleMes = title.replace(/&quote;/g,"\"");
	
	document.frmMasterManageAboutUs['hidAboutId'].value = aid;
	document.frmMasterManageAboutUs['txtTitle'].value = titleMes;
	document.frmMasterManageAboutUs['txtDescription'].value = bodymsg;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function PReleaseEditValues(rid, title, desc, rdate, intCurrentRow)
{
	var bodymsg = desc.replace(/<br>/g,"\r\n");
	bodymsg = desc.replace(/&quote;/g,"\"");
	
	var titleMes = title.replace(/<br>/g,"\r\n");
	titleMes = title.replace(/&quote;/g,"\"");
	
	document.frmMasterManagePRelease['hidReleaseId'].value = rid;
	document.frmMasterManagePRelease['txtTitle'].value = titleMes;
	document.frmMasterManagePRelease['txtDescription'].value = bodymsg;
	document.frmMasterManagePRelease['txtReleasedDate'].value = rdate;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function CheckMasterError()
{		
	if(trim(document.frmMasterError['txtErrorCode'].value) == "")
	{
		alert("Please Enter Error Code");
		document.frmMasterError['txtErrorCode'].focus();
		return false;
	}
	if(trim(document.frmMasterError['txtErrorDesc'].value) == "")
	{
		alert("Please Enter Error Description");
		document.frmMasterError['txtErrorDesc'].focus();
		return false;
	}	
}
function ErrorEditValues(ecode, edesc, esolution, intCurrentRow)
{
	document.frmMasterError['hidErrorCode'].value = ecode;
	document.frmMasterError['txtErrorCode'].value = ecode;
	document.frmMasterError['txtErrorDesc'].value = edesc;
	document.frmMasterError['txtErrorSolution'].value = esolution;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}	
function CheckMasterLanguage()
{
	if(trim(document.frmMasterLanguage['txtLanguageName'].value) == "")
	{
		alert("Please Enter Language Name");
		document.frmMasterLanguage['txtLanguageName'].focus();
		return false;
	}
}
function CheckPortalUserPermissions()
{
	if(document.frmMasterPortalUserPermissions['ddlUserType'].value == "")
	{
		alert("Please Select User Type");
		document.frmMasterPortalUserPermissions['ddlUserType'].focus();
		return false;
	}
}
function CheckPackagePermissions()
{
	if(document.frmMasterPackagePermissions['ddlPackage'].value == "")
	{
		alert("Please Select the Package");
		document.frmMasterPackagePermissions['ddlPackage'].focus();
		return false;
	}
}
function LanguageEditValues(lid, lname, intCurrentRow)
{
	document.frmMasterLanguage['hidLanguageId'].value = lid;
	document.frmMasterLanguage['txtLanguageName'].value = lname;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}		
function CheckMasterLookup()
{
	if(trim(document.frmMasterLookup['txtLookupCode'].value) == "")
	{
		alert("Please Enter Lookup Code");
		document.frmMasterLookup['txtLookupCode'].focus();
		return false;
	}				
	if(document.frmMasterLookup['ddlLookupType'].value == "")
	{
		alert("Select the Lookup Type");
		document.frmMasterLookup['ddlLookupType'].focus();
		return false;
	}
}

function CheckMasterPricelistLine()
{
	if(trim(document.frmMasterPriceListLine['txtCategory'].value) == "")
	{
		alert("Please Enter Category");
		document.frmMasterPriceListLine['txtCategory'].focus();
		return false;
	}
	if(trim(document.frmMasterPriceListLine['txtLowRange'].value) == "")
	{
		alert("Please Enter LowRange");
		document.frmMasterPriceListLine['txtLowRange'].focus();
		return false;
	}
	if(trim(document.frmMasterPriceListLine['txtHighRange'].value) == "")
	{
		alert("Please Enter HighRange");
		document.frmMasterPriceListLine['txtHighRange'].focus();
		return false;
	}
	if(trim(document.frmMasterPriceListLine['txtAmount'].value) == "")
	{
		alert("Please Enter Amount");
		document.frmMasterPriceListLine['txtAmount'].focus();
		return false;
	}
	if(trim(document.frmMasterPriceListLine['txtValue'].value) == "")
	{
		alert("Please Enter Value");
		document.frmMasterPriceListLine['txtValue'].focus();
		return false;
	}				
	if(document.frmMasterPriceListLine['ddlPriceListType'].value == "")
	{
		alert("Select the PriceListType");
		document.frmMasterPriceListLine['ddlPriceListType'].focus();
		return false;
	}
}
function LookupEditValues(lid, lcode, ldesc, ltype, intCurrentRow)
{
	document.frmMasterLookup['hidLookupId'].value = lid;
	document.frmMasterLookup['txtLookupCode'].value = lcode;
	document.frmMasterLookup['txtDescription'].value = ldesc;
	document.frmMasterLookup['ddlLookupType'].value = ltype;					
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}	
function CheckMasterLookupType()
{
	if(trim(document.frmMasterLookupType['txtLookupType'].value) == "")
	{
		alert("Please Enter Lookup Type");
		document.frmMasterLookupType['txtLookupType'].focus();
		return false;
	}
	if(trim(document.frmMasterLookupType['txtLookupCode'].value) == "")
	{
		alert("Please Enter Lookup Code");
		document.frmMasterLookupType['txtLookupCode'].focus();
		return false;
	}
}

function CheckMasterPriceListHeader()
{
	if(trim(document.frmMasterPriceListHeader['txtPricelistName'].value) == "")
	{
		alert("Please Enter PriceList Name");
		document.frmMasterPriceListHeader['txtPricelistName'].focus();
		return false;
	}
	if(trim(document.frmMasterPriceListHeader['txtCurrency'].value) == "")
	{
		alert("Please Enter Currency");
		document.frmMasterPriceListHeader['txtCurrency'].focus();
		return false;
	}
	if(document.frmMasterPriceListHeader['txtRounding'].value == "")
	{
		alert("Please Enter Rounding");
		document.frmMasterPriceListHeader['txtRounding'].focus();
		return false;
	}
	if(document.frmMasterPriceListHeader['txtCode'].value == "")
	{
		alert("Please Enter Code");
		document.frmMasterPriceListHeader['txtCode'].focus();
		return false;
	}
}
function LookupTypeEditValues(lid, lname, lcode, ldescription, intCurrentRow)
{
	document.frmMasterLookupType['hidLookuptypeId'].value = lid;
	document.frmMasterLookupType['txtLookupType'].value = lname;
	document.frmMasterLookupType['txtLookupDesc'].value = ldescription;
	document.frmMasterLookupType['txtLookupCode'].value = lcode;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}	
function PriceListHeaderEditValues(plid, plname, desc, currency, rounding, code, intCurrentRow)
{
	document.frmMasterPriceListHeader['hidPricelistId'].value = plid;
	document.frmMasterPriceListHeader['txtPricelistName'].value = plname;
	document.frmMasterPriceListHeader['txtDescription'].value = desc;
	document.frmMasterPriceListHeader['txtCurrency'].value = currency;
	document.frmMasterPriceListHeader['txtRounding'].value = rounding;
	document.frmMasterPriceListHeader['txtCode'].value = code;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function PriceListLineEditValues(plid, category, lowrange, highrange, amount, value, pltype, intCurrentRow)
{
	document.frmMasterPriceListLine['hidPricelistId'].value = plid;
	document.frmMasterPriceListLine['txtCategory'].value = category;
	document.frmMasterPriceListLine['txtLowRange'].value = lowrange;
	document.frmMasterPriceListLine['txtHighRange'].value = highrange;
	document.frmMasterPriceListLine['txtAmount'].value = amount;
	document.frmMasterPriceListLine['txtValue'].value = value;
	document.frmMasterPriceListLine['ddlPriceListType'].value = pltype;					
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}		
function CheckCategoryView()
{
    if(document.frmCategoryView['txtKeyword'].value == "")
	{
	//	alert("Please Enter KeyWord");
//		document.frmCategoryView['txtKeyword'].focus();
//		return false;
	}	
}
function CheckMasterAgreement()
{
	if(document.frmMasterAgreement['txtAgreementCode'].value == "")
	{
		alert("Please Enter Agreement Code");
		document.frmMasterAgreement['txtAgreementCode'].focus();
		return false;
	}				
	if(document.frmMasterAgreement['txtAgreementName'].value == "")
	{
		alert("Please Enter Agreement Name");
		document.frmMasterAgreement['txtAgreementName'].focus();
		return false;
	}				
	if(document.frmMasterAgreement['ddlAgreementType'].value == "")
	{
		alert("Select the Agreement Type");
		document.frmMasterAgreement['ddlAgreementType'].focus();
		return false;
	}
}

function CheckBid()
{
	
	if(document.frmBidNow['ddlTheater'].value == "")
	{
		alert("Please Select the Theater/Club");
		document.frmBidNow['ddlTheater'].focus();
		return false;
	}
	if(document.frmBidNow['ddlCategory'].value == "")
	{
		alert("Please Select the Movie/Music");
		document.frmBidNow['ddlCategory'].focus();
		return false;
	}
	if(document.frmBidNow['ddlPictures'].value == "")
	{
		alert("Please Select the Picture");
		document.frmBidNow['ddlPictures'].focus();
		return false;
	}
	if(document.frmBidNow['txtBidAmount'].value == "")
	{
		alert("Please Enter New Bid Amount");
		document.frmBidNow['txtBidAmount'].focus();
		return false;
	}
	if(!regexp(document.frmBidNow['txtBidAmount'], "0123456789."))
	{
		alert("Your Bid Amount Contains Invalid Characters.\n Only the following characters are allowed : 0123456789.");
		document.frmBidNow['txtBidAmount'].select();
		document.frmBidNow['txtBidAmount'].focus();
		return false;
	}
	/*if(document.frmBidNow['rdButIDAgree'].checked)
	{
		question = confirm("Are you sure you want to decline the Terms of Service? \nClick Cancel to continue with the Bidding."); 
		if (question == true) 
			window.location.href = 'frmMyAccount.aspx'; 
		return false;
	}*/
	/*if(!document.all['chkTermAgree'].checked)
	{
		alert("Please Agree the Terms of Service");
		document.all['chkTermAgree'].focus();
		return false;
	}	
	if(document.frmBidNow['hidHaveBid'].value != "")
	{
		question = confirm("You Already have a bid for this Auction. \nThis bid considered as a new bid. \nDo you want to continue with this new bid."); 
		return question;
	}*/
}

function AgreementPopup(path)
{
	window.open('frmAgreementpopup.aspx?path='+path,'Agreement');
}
function Remove()
{
	document.all['FileAgreement'].style.visibility = "visible"
	document.getElementById('lblfilename').innerHTML = ""
	document.getElementById('lnkremove').innerHTML = ""
}
function AgreementEditValues(aid, aname,acode,atype, adescription, rowInt)
{
	
	document.frmMasterAgreement['hidAgreementId'].value = aid;
	document.frmMasterAgreement['txtAgreementName'].value = aname;
	document.frmMasterAgreement['ddlAgreementType'].value = atype;
	document.frmMasterAgreement['hidfpath'].value = adescription;
	document.frmMasterAgreement['txtAgreementCode'].value = acode;
	//alert(document.frmMasterAgreement['hidfpath'].value);
	
	if(adescription != "")
	{
		document.all['FileAgreement'].style.visibility = "hidden"	
		document.getElementById('lblfilename').innerHTML = adescription.substr(adescription.lastIndexOf("/")+1,adescription.length - adescription.lastIndexOf("/")-1);
		document.getElementById('lnkremove').innerHTML = "Change"
	}
//	document.frmMasterAgreement['txtDescription'].value = adescription.replace("<br>","\r\n");
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = rowInt;
	
	HighlightRow(rowInt);
}	
function GiftCardEditValues(gid, name, desc, intCurrentRow)
{
	
	document.frmManageGiftCards['hidGCId'].value = gid;
	document.frmManageGiftCards['txtName'].value = name;
	document.frmManageGiftCards['txtDescription'].value = desc;
		
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}	
function CheckMasterSecret()
{
	if(trim(document.frmMasterSecretQuestion['txtSecretQuestion'].value) == "")
	{
		alert("Please Enter the Secret Question");
		document.frmMasterSecretQuestion['txtSecretQuestion'].focus();
		return false;
	}
}
function SecretEditValues(sqid, sq, intCurrentRow)
{
	document.frmMasterSecretQuestion['hidSecretId'].value = sqid;
	document.frmMasterSecretQuestion['txtSecretQuestion'].value = sq;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function CheckMasterGenres()
{
	if(trim(document.frmMasterGenres['txtGenres'].value) == "")
	{
		alert("Please Enter Genres");
		document.frmMasterGenres['txtGenres'].focus();
		return false;
	}
}
function GenresEditValues(gid, genres, gpid, intCurrentRow)
{
	document.frmMasterGenres['hidGenreID'].value = gid;
	document.frmMasterGenres['txtGenres'].value = genres;
	document.frmMasterGenres['ddlGenreParent'].value = gpid;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function CheckMasterCredits()
{
	if(trim(document.frmMasterCredits['txtCreditName'].value) == "")
	{
		alert("Please Enter Credit Name");
		document.frmMasterCredits['txtCreditName'].focus();
		return false;
	}
	if(document.frmMasterCredits['ddlCategory'].value == "")
	{
		alert("Please Select the Category");
		document.frmMasterCredits['ddlCategory'].focus();
		return false;
	}
}
function CreditsEditValues(cid, credit, category, intCurrentRow)
{
	document.frmMasterCredits['hidCreditID'].value = cid;
	document.frmMasterCredits['txtCreditName'].value = credit;
	document.frmMasterCredits['ddlCategory'].value = category;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function CheckMasterRatings()
{
	if(trim(document.frmMasterRatings['txtRatingName'].value) == "")
	{
		alert("Please Enter Rating Name");
		document.frmMasterRatings['txtRatingName'].focus();
		return false;
	}
	if(document.frmMasterRatings['ddlCategory'].value == "")
	{
		alert("Please Select the Category");
		document.frmMasterRatings['ddlCategory'].focus();
		return false;
	}
}
function RatingsEditValues(rid, rating, category, intCurrentRow)
{
	document.frmMasterRatings['hidRatingID'].value = rid;
	document.frmMasterRatings['txtRatingName'].value = rating;
	document.frmMasterRatings['ddlCategory'].value = category;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function CheckMasterModule()
{
	if(trim(document.frmMasterModule['txtModuleName'].value) == "")
	{
		alert("Please Enter Module Name");
		document.frmMasterModule['txtModuleName'].focus();
		return false;
	}
}
function ModuleEditValues(mid, mname, intCurrentRow)
{
	document.frmMasterModule['hidModuleId'].value = mid;
	document.frmMasterModule['txtModuleName'].value = mname;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function CheckMasterModuleUsers()
{
	if(trim(document.frmMasterModuleUser['txtModuleName'].value) == "")
	{
		alert("Please Enter Module Name");
		document.frmMasterModuleUser['txtModuleName'].focus();
		return false;
	}
}
function ModuleEditValuesUsers(mid, mname, intCurrentRow)
{
	document.frmMasterModuleUser['hidModuleId'].value = mid;
	document.frmMasterModuleUser['txtModuleName'].value = mname;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function CheckMasterSubModule()
{
	if(trim(document.frmMasterSubModule['txtSubModuleName'].value) == "")
	{
		alert("Please Enter Sub Module Name");
		document.frmMasterSubModule['txtSubModuleName'].focus();
		return false;
	}
	if(trim(document.frmMasterSubModule['txtSubModuleURL'].value) == "")
	{
		alert("Please Enter Sub Module URL");
		document.frmMasterSubModule['txtSubModuleURL'].focus();
		return false;
	}
	if(document.frmMasterSubModule['ddlModule'].value == "")
	{
		alert("Please Select the Module Name");
		document.frmMasterSubModule['ddlModule'].focus();
		return false;
	}
}
function SubModuleEditValues(smid, smname, smurl, mid, intCurrentRow)
{
	document.frmMasterSubModule['hidSubModuleId'].value = smid;
	document.frmMasterSubModule['txtSubModuleName'].value = smname;
	document.frmMasterSubModule['txtSubModuleURL'].value = smurl;
	document.frmMasterSubModule['ddlModule'].value = mid;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function CheckMasterSubModuleUsers()
{
	if(trim(document.frmMasterSubModuleUser['txtSubModuleName'].value) == "")
	{
		alert("Please Enter Sub Module Name");
		document.frmMasterSubModuleUser['txtSubModuleName'].focus();
		return false;
	}
	if(trim(document.frmMasterSubModuleUser['txtSubModuleURL'].value) == "")
	{
		alert("Please Enter Sub Module URL");
		document.frmMasterSubModuleUser['txtSubModuleURL'].focus();
		return false;
	}
	if(trim(document.frmMasterSubModuleUser['ddlModule'].value) == "")
	{
		alert("Please Select the Module Name");
		document.frmMasterSubModuleUser['ddlModule'].focus();
		return false;
	}
}
function SubModuleEditValuesUsers(smid, smname, smurl, mid, intCurrentRow)
{
	document.frmMasterSubModuleUser['hidSubModuleId'].value = smid;
	document.frmMasterSubModuleUser['txtSubModuleName'].value = smname;
	document.frmMasterSubModuleUser['txtSubModuleURL'].value = smurl;
	document.frmMasterSubModuleUser['ddlModule'].value = mid;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function CheckAdminUserCreation()
{
	if(trim(document.frmAdminUserCreation['txtFirstName'].value) == "")
	{
		alert("Please Enter the First Name");
		document.frmAdminUserCreation['txtFirstName'].focus();
		return false;
	}
	if(trim(document.frmAdminUserCreation['txtLastName'].value) == "")
	{
		alert("Please Enter the Last Name");
		document.frmAdminUserCreation['txtLastName'].focus();
		return false;
	}
	if(trim(document.frmAdminUserCreation['txtAddress1'].value) == "")
	{
		alert("Please Enter the Address");
		document.frmAdminUserCreation['txtAddress1'].focus();
		return false;
	}
	if(trim(document.frmAdminUserCreation['txtAddress1'].value) == "")
	{
		alert("Please Enter the Address");
		document.frmAdminUserCreation['txtAddress1'].focus();
		return false;
	}
	if(document.frmAdminUserCreation['ddlCountry'].value == "")
	{
		alert("Please Select the Country");
		document.frmAdminUserCreation['ddlCountry'].focus();
		return false;
	}
	if(document.frmAdminUserCreation['ddlState'].value == "")
	{
		alert("Please Select the State");
		document.frmAdminUserCreation['ddlState'].focus();
		return false;
	}
	if(trim(document.frmAdminUserCreation['txtCity'].value) == "")
	{
		alert("Please Enter the City");
		document.frmAdminUserCreation['txtCity'].focus();
		return false;
	}
	if(trim(document.frmAdminUserCreation['txtZip'].value) == "")
	{
		alert("Please Enter the Zip/Postal Code.");
		document.frmAdminUserCreation['txtZip'].focus();
		return false;
	}
	if(!regexp(document.frmAdminUserCreation['txtZip'], "0123456789"))
	{
		alert("Your Zip Contains Invalid Characters.\n Only the following characters are allowed : 0123456789");
		document.frmAdminUserCreation['txtZip'].select();
		document.frmAdminUserCreation['txtZip'].focus();
		return false;
	}
	if(document.frmAdminUserCreation['hidZipRange'].value != "")
	{
		if(document.frmAdminUserCreation['txtZip'].value.length != document.frmAdminUserCreation['hidZipRange'].value)
		{
			alert("Invalid Zip/Postal Code.");
			document.frmAdminUserCreation['txtZip'].focus();
			document.frmAdminUserCreation['txtZip'].select();
			return false;
		}
	}
	if(trim(document.frmAdminUserCreation['txtPhone'].value) == "")
	{
		alert("Please Enter the Phone Number");
		document.frmAdminUserCreation['txtPhone'].focus();
		return false;
	}
	if(!regexp(document.frmAdminUserCreation['txtPhone'], "0123456789-+() "))
	{
		alert("Your Phone Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmAdminUserCreation['txtPhone'].select();
		document.frmAdminUserCreation['txtPhone'].focus();
		return false;
	}
	if(trim(document.frmAdminUserCreation['txtMobile'].value) == "")
	{
		alert("Please Enter the Mobile Number");
		document.frmAdminUserCreation['txtMobile'].focus();
		return false;
	}
	if(!regexp(document.frmAdminUserCreation['txtMobile'], "0123456789-+()"))
	{
		alert("Your Mobile Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmAdminUserCreation['txtMobile'].select();
		document.frmAdminUserCreation['txtMobile'].focus();
		return false;
	}
	if(trim(document.frmAdminUserCreation['txtFax'].value) == "")
	{
		alert("Please Enter the FAX");
		document.frmAdminUserCreation['txtFax'].focus();
		return false;
	}
	if(!regexp(document.frmAdminUserCreation['txtFax'], "0123456789- "))
	{
		alert("Your FAX Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmAdminUserCreation['txtFax'].select();
		document.frmAdminUserCreation['txtFax'].focus();
		return false;
	}
	if(trim(document.frmAdminUserCreation['txtEmail'].value) == "")
	{
		alert("Please Enter the Email Address");
		document.frmAdminUserCreation['txtEmail'].focus();
		return false;
	}
	if(!emailCheck(document.frmAdminUserCreation['txtEmail'].value))
	{
		document.frmAdminUserCreation['txtEmail'].select();
		document.frmAdminUserCreation['txtEmail'].focus();
		return false;
	}
	if(trim(document.frmAdminUserCreation['txtPassword'].value) == "")
	{
		alert("Please Enter Password");
		document.frmAdminUserCreation['txtPassword'].focus();
		return false;
	}
	if(regexp(document.frmAdminUserCreation['txtPassword'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-") == false)
	{
		alert("Your Password Contains Invalid Characters.\nOnly Following Characters Are allowed:\nAlphanumerics\nHyphen -\nUnderscore _");
		document.frmAdminUserCreation['txtPassword'].focus();
		document.frmAdminUserCreation['txtPassword'].select();
		return false;
	}
	if(trim(document.frmAdminUserCreation['txtRePassword'].value) == "")
	{
		alert("Please ReType Your Password");
		document.frmAdminUserCreation['txtRePassword'].focus();
		return false;		
	}
	if(regexp(document.frmAdminUserCreation['txtRePassword'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-") == false)
	{
		alert("Your Password Contains Invalid Characters.\nOnly Following Characters Are allowed:\nAlphanumerics\nHyphen -\nUnderscore _");
		document.frmAdminUserCreation['txtRePassword'].focus();
		document.frmAdminUserCreation['txtRePassword'].select();
		return false;
	}
	if(document.frmAdminUserCreation['txtPassword'].value != document.frmAdminUserCreation['txtRePassword'].value)
	{
		alert("Password and Re-Type Password are Differed.");
		document.frmAdminUserCreation['txtRePassword'].focus();
		document.frmAdminUserCreation['txtRePassword'].select();
		return false;
	}
}
function CheckAdminUserUpdation()
{
	if(trim(document.frmAdminUserUpdation['txtFirstName'].value) == "")
	{
		alert("Please Enter the First Name");
		document.frmAdminUserUpdation['txtFirstName'].focus();
		return false;
	}
	if(trim(document.frmAdminUserUpdation['txtLastName'].value) == "")
	{
		alert("Please Enter the Last Name");
		document.frmAdminUserUpdation['txtLastName'].focus();
		return false;
	}
	if(trim(document.frmAdminUserUpdation['txtAddress1'].value) == "")
	{
		alert("Please Enter the Address");
		document.frmAdminUserUpdation['txtAddress1'].focus();
		return false;
	}
	if(trim(document.frmAdminUserUpdation['txtAddress1'].value) == "")
	{
		alert("Please Enter the Address");
		document.frmAdminUserUpdation['txtAddress1'].focus();
		return false;
	}
	if(document.frmAdminUserUpdation['ddlCountry'].value == "")
	{
		alert("Please Select the Country");
		document.frmAdminUserUpdation['ddlCountry'].focus();
		return false;
	}
	if(document.frmAdminUserUpdation['ddlState'].length > 1 && document.frmAdminUserUpdation['ddlState'].value == "")
	{
		alert("Please Select the State");
		document.frmAdminUserUpdation['ddlState'].focus();
		return false;
	}
	if(trim(document.frmAdminUserUpdation['txtCity'].value) == "")
	{
		alert("Please Enter the City");
		document.frmAdminUserUpdation['txtCity'].focus();
		return false;
	}
	if(trim(document.frmAdminUserUpdation['txtZip'].value) == "")
	{
		alert("Please Enter the Zip/Postal Code.");
		document.frmAdminUserUpdation['txtZip'].focus();
		return false;
	}
	if(!regexp(document.frmAdminUserUpdation['txtZip'], "0123456789"))
	{
		alert("Your Zip Contains Invalid Characters.\n Only the following characters are allowed : 0123456789");
		document.frmAdminUserUpdation['txtZip'].select();
		document.frmAdminUserUpdation['txtZip'].focus();
		return false;
	}
	if(document.frmAdminUserUpdation['hidZipRange'].value != "")
	{
		if(document.frmAdminUserUpdation['txtZip'].value.length != document.frmAdminUserUpdation['hidZipRange'].value)
		{
			alert("Invalid Zip/Postal Code.");
			document.frmAdminUserUpdation['txtZip'].focus();
			document.frmAdminUserUpdation['txtZip'].select();
			return false;
		}
	}
	if(trim(document.frmAdminUserUpdation['txtPhone'].value) == "")
	{
		alert("Please Enter the Phone Number");
		document.frmAdminUserUpdation['txtPhone'].focus();
		return false;
	}
	if(!regexp(document.frmAdminUserUpdation['txtPhone'], "0123456789-+() "))
	{
		alert("Your Phone Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmAdminUserUpdation['txtPhone'].select();
		document.frmAdminUserUpdation['txtPhone'].focus();
		return false;
	}
	if(trim(document.frmAdminUserUpdation['txtMobile'].value) == "")
	{
		alert("Please Enter the Mobile Number");
		document.frmAdminUserUpdation['txtMobile'].focus();
		return false;
	}
	if(!regexp(document.frmAdminUserUpdation['txtMobile'], "0123456789-+()"))
	{
		alert("Your Mobile Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmAdminUserUpdation['txtMobile'].select();
		document.frmAdminUserUpdation['txtMobile'].focus();
		return false;
	}
	if(trim(document.frmAdminUserUpdation['txtFax'].value) == "")
	{
		alert("Please Enter the FAX");
		document.frmAdminUserUpdation['txtFax'].focus();
		return false;
	}
	if(!regexp(document.frmAdminUserUpdation['txtFax'], "0123456789- "))
	{
		alert("Your FAX Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmAdminUserUpdation['txtFax'].select();
		document.frmAdminUserUpdation['txtFax'].focus();
		return false;
	}
	//------------------------
	if(trim(document.frmAdminUserUpdation['txtPassword'].value) == "")
	{
		alert("Please Enter Password");
		document.frmAdminUserUpdation['txtPassword'].focus();
		return false;
	}
	if(regexp(document.frmAdminUserUpdation['txtPassword'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 !@#$%^&*()_-<>,.:;[]{}/\?+=~`") == false)
	{
		alert("Your password contains invalid characters.  Please use numbers, letters and \n the following symbols !@#$%^&*()_-<>,.:;[]{}/\?+=~` only.");
		document.frmAdminUserUpdation['txtPassword'].focus();
		document.frmAdminUserUpdation['txtPassword'].select();
		return false;
	}
	/*if(firstspace(document.frmAdminUserUpdation['txtPassword'].value) == false)
	{
		alert("You can't enter the first character as a space");
		document.frmAdminUserUpdation['txtPassword'].focus();
		document.frmAdminUserUpdation['txtPassword'].select();
		return false;
	}*/
	if(trim(document.frmAdminUserUpdation['txtConfirmPassword'].value) == "")
	{
		alert("Please ReType Your Password");
		document.frmAdminUserUpdation['txtConfirmPassword'].focus();
		return false;		
	}
	if(regexp(document.frmAdminUserUpdation['txtConfirmPassword'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 !@#$%^&*()_-<>,.:;[]{}/\?+=~`") == false)
	{
		alert("Your Re-type password contains invalid character. Please use numbers, letters and \n the following symbols  !@#$%^&*()_-<>,.:;[]{}/\?+=~` only.");
		document.frmAdminUserUpdation['txtConfirmPassword'].focus();
		document.frmAdminUserUpdation['txtConfirmPassword'].select();
		return false;
	}
	if(document.frmAdminUserUpdation['txtPassword'].value != document.frmAdminUserUpdation['txtConfirmPassword'].value)
	{
		alert("Your passwords do not match. Please ensure that you re-type the same password.");
		document.frmAdminUserUpdation['txtConfirmPassword'].focus();
		document.frmAdminUserUpdation['txtConfirmPassword'].select();
		return false;
	}
	return false;
}
function CheckPortalUserAddressUpd()
{
	/*if(trim(document.frmPortalUserAddressUpdation['txtAddress1'].value) == "")
	{
		alert("Please Enter the Address");
		document.frmPortalUserAddressUpdation['txtAddress1'].focus();
		return false;
	}
	if(trim(document.frmPortalUserAddressUpdation['txtAddress1'].value) == "")
	{
		alert("Please Enter the Address");
		document.frmPortalUserAddressUpdation['txtAddress1'].focus();
		return false;
	}*/
	if(document.frmPortalUserAddressUpdation['ddlCountry'].value == "")
	{
		alert("Please Select the Country");
		document.frmPortalUserAddressUpdation['ddlCountry'].focus();
		return false;
	}
	/*if(document.frmPortalUserAddressUpdation['ddlState'].length > 1 && document.frmPortalUserAddressUpdation['ddlState'].value == "")
	{
		alert("Please Select the State/Province/Territory");
		document.frmPortalUserAddressUpdation['ddlState'].focus();
		return false;
	}
	if(trim(document.frmPortalUserAddressUpdation['txtCity'].value) == "")
	{
		alert("Please Enter the City/Region");
		document.frmPortalUserAddressUpdation['txtCity'].focus();
		return false;
	}*/
	if(regexp(document.frmPortalUserAddressUpdation['txtCity'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ") == false)
	{
		alert("Your City Contains Invalid Characters.\n Only the following characters are allowed : Alphabets");
		document.frmPortalUserAddressUpdation['txtCity'].focus();
		document.frmPortalUserAddressUpdation['txtCity'].select();
		return false;
	}
	/*if(trim(document.frmPortalUserAddressUpdation['txtZip'].value) == "")
	{
		alert("Please Enter the Zip/Postal Code.");
		document.frmPortalUserAddressUpdation['txtZip'].focus();
		return false;
	}*/
	if(document.frmPortalUserAddressUpdation['hidZipCodeType'].value == "AN")
	{
		if(!regexp(document.frmPortalUserAddressUpdation['txtZip'], "0123456789-,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz "))
		{
			alert("Your Zip must Contain Letters and Numbers");
			document.frmPortalUserAddressUpdation['txtZip'].select();
			document.frmPortalUserAddressUpdation['txtZip'].focus();
			return false;
		}	
	}
	else
	{
		if(!regexp(document.frmPortalUserAddressUpdation['txtZip'], "0123456789-,"))
		{
			alert("Your Zip Contains Invalid Characters.\n Only the following characters are allowed : 0123456789-,");
			document.frmPortalUserAddressUpdation['txtZip'].select();
			document.frmPortalUserAddressUpdation['txtZip'].focus();
			return false;
		}
			
	}
	if(document.frmPortalUserAddressUpdation['hidZipRange'].value != "")
	{
		if(document.frmPortalUserAddressUpdation['txtZip'].value.length > document.frmPortalUserAddressUpdation['hidZipRange'].value)
		{
			alert("Invalid Zip/Postal Code.");
			document.frmPortalUserAddressUpdation['txtZip'].focus();
			document.frmPortalUserAddressUpdation['txtZip'].select();
			return false;
		}
	}
	/*if(trim(document.frmPortalUserAddressUpdation['txtPhone'].value) == "")
	{
		alert("Please Enter the Phone Number");
		document.frmPortalUserAddressUpdation['txtPhone'].focus();
		return false;
	}*/
	if(!regexp(document.frmPortalUserAddressUpdation['txtPhone'], "0123456789-+() "))
	{
		alert("Your Phone Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmPortalUserAddressUpdation['txtPhone'].select();
		document.frmPortalUserAddressUpdation['txtPhone'].focus();
		return false;
	}
	if(!regexp(document.frmPortalUserAddressUpdation['txtMobile'], "0123456789-+()"))
	{
		alert("Your Mobile Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmPortalUserAddressUpdation['txtMobile'].select();
		document.frmPortalUserAddressUpdation['txtMobile'].focus();
		return false;
	}
	if(!regexp(document.frmPortalUserAddressUpdation['txtFax'], "0123456789- "))
	{
		alert("Your FAX Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmPortalUserAddressUpdation['txtFax'].select();
		document.frmPortalUserAddressUpdation['txtFax'].focus();
		return false;
	}
}

function CheckPortalUserAddress()
{
	if(document.frmAddressType['ddlCountry'].value == "")
	{
		alert("Please Select the Country");
		document.frmAddressType['ddlCountry'].focus();
		return false;
	}
	if(trim(document.frmAddressType['txtAddress1'].value) == "")
	{
		alert("Please Enter the Address");
		document.frmAddressType['txtAddress1'].focus();
		return false;
	}
	if(trim(document.frmAddressType['txtAddress1'].value) == "")
	{
		alert("Please Enter the Address");
		document.frmAddressType['txtAddress1'].focus();
		return false;
	}
	/*if(document.frmPortalUserAddressUpdatation['ddlState'].value == "")
	{
		alert("Please Select the State");
		document.frmPortalUserAddressUpdatation['ddlState'].focus();
		return false;
	}
	
	if(document.frmPortalUserAddressUpdatation['ddlState'].value == "" && document.frmPortalUserAddressUpdatation['ddlState'].length > 1)
	{
		alert("Please Select the State");
		document.frmPortalUserAddressUpdatation['ddlState'].focus();
		return false;
	}*/
	if(typeof document.all['ddlState'] != "undefined")
	{
		if(document.all['ddlState'].length > 1 && document.all['ddlState'].value == "")
		{
			alert("Please Select the State/Province/Territory");
			document.frmAddressType['ddlState'].focus();
			return false;
		}
	}
	if(typeof document.all['txtCity'] != "undefined")
	{
		if(trim(document.frmAddressType['txtCity'].value) == "")
		{
			alert("Please Enter the City/Region");
			document.frmAddressType['txtCity'].focus();
			return false;
		}
		if(regexp(document.frmAddressType['txtCity'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ") == false)
		{
			alert("Your City Contains Invalid Characters.\n Only the following characters are allowed : Alphabets");
			document.frmAddressType['txtCity'].focus();
			document.frmAddressType['txtCity'].select();
			return false;
		}
	}
	if(trim(document.frmAddressType['txtZip'].value) == "")
	{
		alert("Please Enter the Zip/Postal Code.");
		document.frmAddressType['txtZip'].focus();
		return false;
	}
	/*if(!regexp(document.frmAddressType['txtZip'], "0123456789-,"))
	{
		alert("Your Zip Contains Invalid Characters.\n Only the following characters are allowed : 0123456789-,");
		document.frmAddressType['txtZip'].select();
		document.frmAddressType['txtZip'].focus();
		return false;
	}*/
	
	if(trim(document.frmAddressType['hidZipCodeType'].value) == "AN")
	{
		if(!regexp(document.frmAddressType['txtZip'], "0123456789-, ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"))
		{
			alert("Your Zip Contains Invalid Characters.\n Only the following characters are allowed : \n Letters \n 0123456789-,");
			document.frmAddressType['txtZip'].select();
			document.frmAddressType['txtZip'].focus();
			return false;
		}	
	}
	else
	{
		if(!regexp(document.frmAddressType['txtZip'], "0123456789-,"))
		{
			alert("Your Zip Contains Invalid Characters.\n Only the following characters are allowed : 0123456789-,");
			document.frmAddressType['txtZip'].select();
			document.frmAddressType['txtZip'].focus();
			return false;
		}
			
	}
	if(document.frmAddressType['hidZipRange'].value != "")
	{
		if(document.frmAddressType['txtZip'].value.length > document.frmAddressType['hidZipRange'].value)
		{
			alert("Invalid Zip/Postal Code.");
			document.frmAddressType['txtZip'].focus();
			document.frmAddressType['txtZip'].select();
			return false;
		}
	}
	if(trim(document.frmAddressType['txtPhone'].value) == "")
	{
		alert("Please Enter the Phone Number");
		document.frmAddressType['txtPhone'].focus();
		return false;
	}
	if(!regexp(document.frmAddressType['txtPhone'], "0123456789-+() "))
	{
		alert("Your Phone Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmAddressType['txtPhone'].select();
		document.frmAddressType['txtPhone'].focus();
		return false;
	}
	/*if(trim(document.frmPortalUserAddressUpdatation['txtMobile'].value) == "")
	{
		alert("Please Enter the Mobile Number");
		document.frmPortalUserAddressUpdatation['txtMobile'].focus();
		return false;
	}*/
	if(!regexp(document.frmAddressType['txtMobile'], "0123456789-+()"))
	{
		alert("Your Mobile Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmAddressType['txtMobile'].select();
		document.frmAddressType['txtMobile'].focus();
		return false;
	}
	/*if(document.frmPortalUserAddressUpdatation['txtFax'].value == "")
	{
		alert("Please Enter the FAX");
		document.frmPortalUserAddressUpdatation['txtFax'].focus();
		return false;
	}*/
	if(!regexp(document.frmAddressType['txtFax'], "0123456789- "))
	{
		alert("Your FAX Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmAddressType['txtFax'].select();
		document.frmAddressType['txtFax'].focus();
		return false;
	}
}
function CheckMasterTheater()
{
	if(document.frmMasterTheater['ddlTheaterType'].value == "")
	{
		alert("Please Select Theater Type");
		document.frmMasterTheater['ddlTheaterType'].focus();
		return false;
	}
	if(trim(document.frmMasterTheater['txtMaxMovies'].value) == "")
	{
		alert("Please Enter MaxMovies");
		document.frmMasterTheater['txtMaxMovies'].focus();
		return false;
	}
	if(trim(document.frmMasterTheater['txtFreePictureLoad'].value) == "")
	{
		alert("Please Enter FreePictureLoad");
		document.frmMasterTheater['txtFreePictureLoad'].focus();
		return false;
	}
	if(trim(document.frmMasterTheater['txtFreeTrailerLoad'].value) == "")
	{
		alert("Please Enter FreeTrailerLoad");
		document.frmMasterTheater['txtFreeTrailerLoad'].focus();
		return false;
	}
	if(trim(document.frmMasterTheater['txtMaxPictures'].value) == "")
	{
		alert("Please Enter MaxPictures");
		document.frmMasterTheater['txtMaxPictures'].focus();
		return false;
	}
	if(trim(document.frmMasterTheater['txtMaxTrailers'].value) == "")
	{
		alert("Please Enter MaxTrailers");
		document.frmMasterTheater['txtMaxTrailers'].focus();
		return false;
	}
}
function TheaterEditValues(tid, ttype, mmovies, fpload,ftload,mpictures,mtrailers, rowInt)
{
	document.frmMasterTheater['hidTheaterId'].value = tid;
	document.frmMasterTheater['ddlTheaterType'].value = ttype;
	document.frmMasterTheater['txtMaxMovies'].value = mmovies;
	document.frmMasterTheater['txtFreePictureLoad'].value = fpload;
	document.frmMasterTheater['txtFreeTrailerLoad'].value = ftload;
	document.frmMasterTheater['txtMaxPictures'].value = mpictures;
	document.frmMasterTheater['txtMaxTrailers'].value = mtrailers;					
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = rowInt;
	
	HighlightRow(rowInt);
}
function CheckMasterUserTheater()
{
    if(trim(document.frmMasterUserTheater['txtTheaterName'].value) == "")
	{
		alert("Please Enter Theater Name");
		document.frmMasterUserTheater['txtTheaterName'].focus();
		return false;
	}
	if(document.frmMasterUserTheater['ddlTheaterMode'].value == "")
	{
		alert("Please Select Theater Mode ");
		document.frmMasterUserTheater['ddlTheaterMode'].focus();
		return false;
	}
	if(document.frmMasterUserTheater['ddlTheaterType'].value == "")
	{
		alert("Please Select Theater Type ");
		document.frmMasterUserTheater['ddlTheaterType'].focus();
		return false;
	}
}
function HideRow()
{	
	RowHide.style.display = "none";
}
function ShowHideRow()
{	
	if(document.frmMasterUserTheater['ddlTheaterType'].value == document.frmMasterUserTheater['hidHiddenType'].value)
		RowHide.style.display = "block";
	else
		RowHide.style.display = "none";
}
function UserTheaterEditValues(tid, tname,ttype, tmode, tdescription, rowInt)
{
	tdescription = tdescription.replace(/<br>/g, "\r\n");
	tdescription = tdescription.replace(/&quote;/g,"\"");
	
	document.frmMasterUserTheater['hidUserTheaterId'].value = tid;
	document.frmMasterUserTheater['txtTheaterName'].value = tname;
	//document.frmMasterUserTheater['ddlTheaterType'].value = ttype;
	document.frmMasterUserTheater['ddlTheaterMode'].value = tmode;
	document.frmMasterUserTheater['txtTheaterDescription'].value = tdescription;
		
	ErrorBlank();
	//ShowHideRow();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = rowInt;
	
	HighlightRow(rowInt);
}
function ClearValuesT()
{   
    document.frmMasterTheater['hidTheaterId'].value = "";
	document.frmMasterTheater['ddlTheaterType'].value = "";
	document.frmMasterTheater['txtMaxMovies'].value = "";
	document.frmMasterTheater['txtFreePictureLoad'].value = "";
	document.frmMasterTheater['txtFreeTrailerLoad'].value = "";
	document.frmMasterTheater['txtMaxPictures'].value = "";
	document.frmMasterTheater['txtMaxTrailers'].value ="";
}	
function ClearValuesUT()
{
	document.frmMasterUserTheater['hidUserTheaterId'].value = "";
	document.frmMasterUserTheater['txtTheaterName'].value = "";
	document.frmMasterUserTheater['ddlTheaterType'].value = "";
	document.frmMasterUserTheater['txtTheaterDescription'].value ="";
	document.frmMasterUserTheater['txtTheaterPassword'].value = "";
	
}
function CheckMasterRegion()
{
    if(trim(document.frmMasterRegion['txtRegionName'].value) == "")
	{
		alert("Please Enter Region Name");
		document.frmMasterRegion['txtRegionName'].focus();
		return false;
	}
    if(document.frmMasterRegion['lstCountries1'].length == 0)
	{
		alert("Please Select Country");
		document.frmMasterRegion['lstCountries'].focus();
		return false;
	}	
}
/*function CheckDemographics()
{
	if(document.frmDemographicsUpdate['ddlGender'].value == "")
	{
		alert("Please Select Gender");
		document.frmDemographicsUpdate['ddlGender'].focus();
		return false;
	}
	if(trim(document.frmDemographicsUpdate['ddlAgeGroup'].value) == "")
	{
		alert("Please select Age group");
		document.frmDemographicsUpdate['ddlAgeGroup'].focus();
		return false;
	}
	if(trim(document.frmDemographicsUpdate['ddlOrigin'].value) == "")
	{
		alert("Please select Origin");
		document.frmDemographicsUpdate['ddlOrigin'].focus();
		return false;
	}
	if(trim(document.frmDemographicsUpdate['ddlOccupation'].value) == "")
	{
		alert("Please select Occupation");
		document.frmDemographicsUpdate['ddlOccupation'].focus();
		return false;
	}
	if(document.frmDemographicsUpdate['lstLanguagesKnown'].length == 0)
	{
		alert("Please Select Language(s)");
		document.frmDemographicsUpdate['lstLanguagesKnown'].focus();
		return false;
	}	
}*/
function CheckMasterPackage()
{
    if(document.frmMasterTheaterPackage['ddlPackageType'].value == "")
	{
		alert("Please Select Package Type");
		document.frmMasterTheaterPackage['ddlPackageType'].focus();
		return false;
	}
	if(trim(document.frmMasterTheaterPackage['txtAmount'].value) == "")
	{
		alert("Please Enter Amount");
		document.frmMasterTheaterPackage['txtAmount'].focus();
		return false;
	}
	if(trim(document.frmMasterTheaterPackage['txtTheaters'].value) == "")
	{
		alert("Please Enter Number of Theaters");
		document.frmMasterTheaterPackage['txtTheaters'].focus();
		return false;
	}
	if(trim(document.frmMasterTheaterPackage['txtStorageCapacity'].value) == "")
	{
		alert("Please Enter StorageCapacity");
		document.frmMasterTheaterPackage['txtStorageCapacity'].focus();
		return false;
	}
	if(trim(document.frmMasterTheaterPackage['txtBroadcastCapacity'].value) == "")
	{
		alert("Please Enter BroadcastCapacity");
		document.frmMasterTheaterPackage['txtBroadcastCapacity'].focus();
		return false;
	}
}
function PackageEditValues(pid, ptype, nooftheater, amount, desc, storagecap, broadcastcap, rowInt)
{
	document.frmMasterTheaterPackage['hidPackageId'].value = pid;
	document.frmMasterTheaterPackage['ddlPackageType'].value = ptype;
	document.frmMasterTheaterPackage['txtAmount'].value = amount;
	document.frmMasterTheaterPackage['txtDescription'].value = desc;
	document.frmMasterTheaterPackage['txtTheaters'].value = nooftheater;
	document.frmMasterTheaterPackage['txtStorageCapacity'].value = storagecap;
	document.frmMasterTheaterPackage['txtBroadcastCapacity'].value = broadcastcap;
						
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = rowInt;
	
	HighlightRow(rowInt);
}
function CheckChangePassword()
{
    if(trim(document.ChangePassword['txtOldPassword'].value) == "")
	{
		alert("Please Enter Current Password");
		document.ChangePassword['txtOldPassword'].focus(); 
		return false;
	}
	if(trim(document.ChangePassword['txtNewPassword'].value) == "")
	{
		alert("Please Enter New Password");
		document.ChangePassword['txtNewPassword'].focus(); 
		return false;
	}
	if(trim(document.ChangePassword['txtReEnterPassword'].value) == "")
	{
		alert("Please ReEnter New Password");
		document.ChangePassword['txtReEnterPassword'].focus(); 
		return false;
	}
	if(regexp(document.ChangePassword['txtNewPassword'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 !@#$%^&*()_-<>,.:;[]{}/\?+=~`") == false)
	{
		alert("Your password contains invalid characters.  Please use numbers, letters and \n the following symbols !@#$%^&*()_-<>,.:;[]{}/\?+=~` only.");
		document.ChangePassword['txtNewPassword'].focus();
		document.ChangePassword['txtNewPassword'].select();
		return false;
	}
	if(regexp(document.ChangePassword['txtReEnterPassword'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 !@#$%^&*()_-<>,.:;[]{}/\?+=~`") == false)
	{
		alert("Your password contains invalid characters.  Please use numbers, letters and \n the following symbols !@#$%^&*()_-<>,.:;[]{}/\?+=~` only.");
		document.ChangePassword['txtReEnterPassword'].focus();
		document.ChangePassword['txtReEnterPassword'].select();
		return false;
	}
	if(document.ChangePassword['txtNewPassword'].value != document.ChangePassword['txtReEnterPassword'].value)
	{
		alert("New Password and Re-Type Password should be same.");
		document.ChangePassword['txtReEnterPassword'].focus();
		document.ChangePassword['txtReEnterPassword'].select();
		return false;
	}
}
function CheckChangeLimit()
{
	if(trim(document.ChangeCreditLimit['txtcclimit'].value) == "")
	{
		alert("Credit Limit for Credit Card Users cannot be null");		
		document.ChangeCreditLimit['txtcclimit'].focus();
		return false;
	}
	if(regexp(document.ChangeCreditLimit['txtcclimit'], "0123456789.,-") == false)
	{
		alert("Please Enter Numeric values");
		document.ChangeCreditLimit['txtcclimit'].focus();
		document.ChangeCreditLimit['txtcclimit'].select();
		return false;
	}	
	if(trim(document.ChangeCreditLimit['txtncclimit'].value) == "")
	{
		alert("Credit Limit for non Credit Card Users cannot be null");		
		document.ChangeCreditLimit['txtncclimit'].focus();
		return false;
	}
	if(regexp(document.ChangeCreditLimit['txtncclimit'], "0123456789.,-") == false)
	{
		alert("Please Enter Numeric values");
		document.ChangeCreditLimit['txtncclimit'].focus();
		document.ChangeCreditLimit['txtncclimit'].select();
		return false;
	}	
}
function CheckCreditLimit()
{
	if(trim(document.ChangeCredit['txtCreditAmount'].value) == "")
	{
		alert("Credit Amount cannot be null");		
		document.ChangeCredit['txtCreditAmount'].focus();
		return false;
	}
	if(regexp(document.ChangeCredit['txtCreditAmount'], "0123456789.,-") == false)
	{
		alert("Please Enter Numeric values");
		document.ChangeCredit['txtCreditAmount'].focus();
		document.ChangeCredit['txtCreditAmount'].select();
		return false;
	}	
}

function CheckChangeEmailID()
{
	if(trim(document.ChangeEmailID['txtEmailAdress'].value) == "")
	{
		alert("E-mail Address cannot be blank");		
		document.ChangeEmailID['txtEmailAdress'].focus();
		return false;
	}
	if(!emailCheck(document.ChangeEmailID['txtEmailAdress'].value))
	{
		document.ChangeEmailID['txtEmailAdress'].select();
		document.ChangeEmailID['txtEmailAdress'].focus();
		return false;
	}
	if(trim(document.ChangeEmailID['txtFName'].value) == "")
	{		
		alert("Please Enter the First Name");
		document.ChangeEmailID['txtFName'].focus();
		return false;
	}
	if(regexp(document.ChangeEmailID['txtFName'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.- ") == false)
	{
		alert("Your First Name contains invalid characters.  Only letters, hyphens, and periods are allowed.");
		document.ChangeEmailID['txtFName'].focus();
		document.ChangeEmailID['txtFName'].select();
		return false;
	}
	if(regexp(document.ChangeEmailID['txtMName'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.- ") == false)
	{
		alert("Your Middle Name contains invalid characters.  Only letters, hyphens, and periods are allowed.");
		document.ChangeEmailID['txtMName'].focus();
		document.ChangeEmailID['txtMName'].select();
		return false;
	}
	if(trim(document.ChangeEmailID['txtLName'].value) == "")
	{
		alert("Please Enter the Last Name");
		document.ChangeEmailID['txtLName'].focus();
		return false;
	}
	if(regexp(document.ChangeEmailID['txtLName'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.- ") == false)
	{
		alert("Your Last Name contains invalid characters.  Only letters, hyphens, and periods are allowed.");
		document.ChangeEmailID['txtLName'].focus();
		document.ChangeEmailID['txtLName'].select();
		return false;
	}
	if(regexp(document.ChangeEmailID['txtcompany'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.-, &") == false)
	{
		alert("Your Company Contains Invalid Characters.\nOnly Following Characters Are allowed:\nAlphabetic\nHyphen -\nComma ,");
		document.ChangeEmailID['txtcompany'].focus();
		document.ChangeEmailID['txtcompany'].select();
		return false;
	}
	if(regexp(document.ChangeEmailID['txtjobtitle'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.-, ") == false)
	{
		alert("Your Title Contains Invalid Characters.\nOnly Following Characters Are allowed:\nAlphabetic\nHyphen -\nComma ,");
		document.ChangeEmailID['txtjobtitle'].focus();
		document.ChangeEmailID['txtjobtitle'].select();
		return false;
	}
}
function CheckChangeProfile()
{
	if(trim(document.ChangeYourProfile['txtFName'].value) == "")
	{
		alert("Please Enter First Name.");
		document.ChangeYourProfile['txtFName'].focus();
		return false;
	}
	if(trim(document.ChangeYourProfile['txtLName'].value) == "")
	{
		alert("Please Enter Last Name.");
		document.ChangeYourProfile['txtLName'].focus();
		return false;
	}
	if(regexp(document.ChangeYourProfile['txtCompany'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.-, &") == false)
	{
		alert("Your Company Contains Invalid Characters.\nOnly Following Characters Are allowed:\nAlphabetic\nHyphen -\nComma ,");
		document.ChangeYourProfile['txtCompany'].focus();
		document.ChangeYourProfile['txtCompany'].select();
		return false;
	}
	if(regexp(document.ChangeYourProfile['txtjobtitle'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.-, ") == false)
	{
		alert("Your Title Contains Invalid Characters.\nOnly Following Characters Are allowed:\nAlphabetic\nHyphen -\nComma ,");
		document.ChangeYourProfile['txtjobtitle'].focus();
		document.ChangeYourProfile['txtjobtitle'].select();
		return false;
	}
}
function CheckSendLinkEmailID()
{
	if(trim(document.frmSendLink['txtFrom'].value) == "")
	{
		alert("Please Enter Email Address");		
		document.frmSendLink['txtFrom'].focus();
		return false;
	}
	if(!emailCheck(document.frmSendLink['txtFrom'].value))
	{
		document.frmSendLink['txtFrom'].select();
		document.frmSendLink['txtFrom'].focus();
		return false;
	}
	if(trim(document.frmSendLink['txtTo'].value) == "")
	{
		alert("Please Enter Email Address");		
		document.frmSendLink['txtTo'].focus();
		return false;
	}
	/*if(!emailCheck(document.frmSendLink['txtTo'].value))
	{
		document.frmSendLink['txtTo'].select();
		document.frmSendLink['txtTo'].focus();
		return false;
	}*/
}
function CheckShoppingCart()
{
	if(trim(document.frmShoppingCart['txtAddress1'].value) == "")
	{
		alert("Please Enter Billing Address");
		document.frmShoppingCart['txtAddress1'].focus();
		return false;
	}
	if(document.frmShoppingCart['ddlCountry'].value == "")
	{
		alert("Please Select the Billing Country");
		document.frmShoppingCart['ddlCountry'].focus();
		return false;
	}
	/*if(document.frmShoppingCart['ddlState'].value == "")
	{
		alert("Please Select the Billing State");
		document.frmShoppingCart['ddlState'].focus();
		return false;
	}*/	
	if(document.frmShoppingCart['ddlState'].length > 1 && document.frmShoppingCart['ddlState'].value == "")
	{
		alert("Please Select the State");
		document.frmShoppingCart['ddlState'].focus();
		return false;
	}
	if(trim(document.frmShoppingCart['txtCity'].value) == "")
	{
		alert("Please Enter Billing City");
		document.frmShoppingCart['txtCity'].focus();
		return false;
	}
	if(trim(document.frmShoppingCart['txtZip'].value) == "")
	{
		alert("Please Enter the Billing Zip/Postal Code.");
		document.frmShoppingCart['txtZip'].focus();
		return false;
	}
	if(!regexp(document.frmShoppingCart['txtZip'], "0123456789"))
	{
		alert("Your Zip Contains Invalid Characters.\n Only the following characters are allowed : 0123456789");
		document.frmShoppingCart['txtZip'].select();
		document.frmShoppingCart['txtZip'].focus();
		return false;
	}
	
	if(trim(document.frmShoppingCart['txtPhone'].value) == "")
	{
		alert("Please Enter the Billing Phone Number");
		document.frmShoppingCart['txtPhone'].focus();
		return false;
	}
	if(!regexp(document.frmShoppingCart['txtPhone'], "0123456789-+() "))
	{
		alert("Your Phone Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmShoppingCart['txtPhone'].select();
		document.frmShoppingCart['txtPhone'].focus();
		return false;
	}
	
	if(trim(document.frmShoppingCart['txtSAddress1'].value) == "")
	{
		alert("Please Enter Shipping Address");
		document.frmShoppingCart['txtSAddress1'].focus();
		return false;
	}	
	if(document.frmShoppingCart['ddlSCountry'].value == "")
	{
		alert("Please Select the Country");
		document.frmShoppingCart['ddlSCountry'].focus();
		return false;
	}
	if(document.frmShoppingCart['ddlSState'].length > 1 && document.frmShoppingCart['ddlSState'].value == "")
	{
		alert("Please Select the State");
		document.frmShoppingCart['ddlSState'].focus();
		return false;
	}
	if(trim(document.frmShoppingCart['txtSCity'].value) == "")
	{
		alert("Please Enter City");
		document.frmShoppingCart['txtSCity'].focus();
		return false;
	}
	if(trim(document.frmShoppingCart['txtSZip'].value) == "")
	{
		alert("Please Enter the Zip/Postal Code.");
		document.frmShoppingCart['txtSZip'].focus();
		return false;
	}
	if(!regexp(document.frmShoppingCart['txtSZip'], "0123456789"))
	{
		alert("Your Zip Contains Invalid Characters.\n Only the following characters are allowed : 0123456789");
		document.frmShoppingCart['txtSZip'].select();
		document.frmShoppingCart['txtSZip'].focus();
		return false;
	}
	
	if(trim(document.frmShoppingCart['txtSphone'].value) == "")
	{
		alert("Please Enter the Phone Number");
		document.frmShoppingCart['txtSphone'].focus();
		return false;
	}
	if(!regexp(document.frmShoppingCart['txtSphone'], "0123456789- "))
	{
		alert("Your Phone Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
		document.frmShoppingCart['txtSphone'].select();
		document.frmShoppingCart['txtSphone'].focus();
		return false;
	}
	
}

function CheckMasterAuction()
{	
    if(!document.frmMasterAdvAuctions['rbHome'].checked)
    {
		if(document.frmMasterAdvAuctions['ddlCategory'].value == "")
		{
			alert("Please Select Category Type");
			document.frmMasterAdvAuctions['ddlCategory'].focus();
			return false;
		}
		document.all['hidCategoryID'].value = document.all['ddlCategory'].value;
		
	}
	else
	{
		document.all['hidCategoryID'].value = 0;	
	}
	if(trim(document.frmMasterAdvAuctions['txtAuctionTitle'].value) == "")
		{
			alert("Please Enter Auction Title");
			document.frmMasterAdvAuctions['txtAuctionTitle'].focus();
			return false;
		}
	if(document.frmMasterAdvAuctions['ddlFrequency'].value == "")
	{
		alert("Please Select Frequency");
		document.frmMasterAdvAuctions['ddlFrequency'].focus();
		return false;
	}
	if(document.frmMasterAdvAuctions['txtStartDate'].value == "")
	{
		alert("Please Enter Start Date");
		document.frmMasterAdvAuctions['txtStartDate'].focus();
		return false;
	}
	if(document.frmMasterAdvAuctions['ddlSTHour'].value == "")
	{
		alert("Please Select Start Time Hour");
		document.frmMasterAdvAuctions['ddlSTHour'].focus();
		return false;
	}
	if(document.frmMasterAdvAuctions['ddlSTMinutes'].value == "")
	{
		alert("Please Select Start Time Minute");
		document.frmMasterAdvAuctions['ddlSTMinutes'].focus();
		return false;
	}
	if(document.frmMasterAdvAuctions['txtEndDate'].value == "")
	{
		alert("Please Enter End Date");
		document.frmMasterAdvAuctions['txtEndDate'].focus();
		return false;
	}
	if(document.frmMasterAdvAuctions['ddlETHour'].value == "")
	{
		alert("Please Select End Time Hour");
		document.frmMasterAdvAuctions['ddlETHour'].focus();
		return false;
	}
	if(document.frmMasterAdvAuctions['ddlETMinutes'].value == "")
	{
		alert("Please Select End Time Minute");
		document.frmMasterAdvAuctions['ddlETMinutes'].focus();
		return false;
	}
	if(trim(document.frmMasterAdvAuctions['txtStartBid'].value) == "")
	{
		alert("Please Enter Starting Bid Amount");
		document.frmMasterAdvAuctions['txtStartBid'].focus();
		return false;
	}
}
function CheckMasterFind()
{		
	if(document.frmMasterAdvAuctions['txtFind'].value == "")
	{
		alert("Please Enter the search code");
		document.frmMasterAdvAuctions['txtFind'].focus();
		return false;
	}
}	
function AuctionEditValues(aid, ctype, auction, frequency, sdate, stimehh, stimemm, edate, etimehh, etimemm, sbid, mincr, intCurrentRow)
{
	if(ctype == 0)
	{	
		Visibility();
		/*document.all['rbCategoryHome'].Checked = false
		document.all['rbHome'].Checked = true*/
		var OnLoad = GenresOnChange();
	}
	else
	{
		Visibility1();
		/*document.all['rbHome'].Checked = false
		document.all['rbCategoryHome'].Checked = true*/
		var OnEdit = GenresOnEdit(ctype);
	}
	//document.frmMasterAdvAuctions['ddlCategory'].value = ctype;
	document.frmMasterAdvAuctions['hidAuctionID'].value = aid;
	document.frmMasterAdvAuctions['txtAuctionTitle'].value = auction;
	document.frmMasterAdvAuctions['ddlFrequency'].value = frequency;
	document.frmMasterAdvAuctions['txtStartDate'].value = sdate;
	if(stimehh < 10)
		document.frmMasterAdvAuctions['ddlSTHour'].value = "0"+stimehh;
	else
		document.frmMasterAdvAuctions['ddlSTHour'].value = stimehh;
	if(stimemm < 10)
		document.frmMasterAdvAuctions['ddlSTMinutes'].value = "0"+stimemm;
	else
		document.frmMasterAdvAuctions['ddlSTMinutes'].value = stimemm;
	document.frmMasterAdvAuctions['txtEndDate'].value = edate;
	if(etimehh < 10)
		document.frmMasterAdvAuctions['ddlETHour'].value = "0"+etimehh;
	else
		document.frmMasterAdvAuctions['ddlETHour'].value = etimehh;
	if(etimemm < 10)
		document.frmMasterAdvAuctions['ddlETMinutes'].value = "0"+etimemm;
	else
		document.frmMasterAdvAuctions['ddlETMinutes'].value = etimemm;
	document.frmMasterAdvAuctions['txtStartBid'].value = sbid;
	document.frmMasterAdvAuctions['txtMinimumIncrement'].value = mincr;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
	
}	
function CheckMasterTimeZone()
{
	if(trim(document.frmMasterTimeZone['txtCode'].value) == "")
	{
		alert("Please Enter Time Zone Code");
		document.frmMasterTimeZone['txtCode'].focus();
		return false;
	}
	if(trim(document.frmMasterTimeZone['txtDescription'].value) == "")
	{
		alert("Please Enter Description");
		document.frmMasterTimeZone['txtDescription'].focus();
		return false;
	}
}

function TimeZoneEditValues(tid, tcode, tname, tdesc, tpm, thr, tmin, intCurrentRow)
{
	document.frmMasterTimeZone['hidTimeZoneId'].value = tid;
	document.frmMasterTimeZone['txtCode'].value = tcode;
	document.frmMasterTimeZone['txtName'].value = tname;
	document.frmMasterTimeZone['txtDescription'].value = tdesc;	
	document.frmMasterTimeZone['ddlPlusMinus'].value = tpm;	
	document.frmMasterTimeZone['ddlHours'].value = thr;
	document.frmMasterTimeZone['ddlMinutes'].value = tmin;
	
	ErrorBlank();
	
	if(intPrevRow != 0)
		DeHighlightRow(intPrevRow);
	
	intPrevRow = intCurrentRow;
	
	HighlightRow(intCurrentRow);
}
function isValidLetter(field)
{
	var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\\~!@#$%^&*()_+`-=\][;\'/.,<>?:{}|\"\f\t\r\b\n ";
	if (valid.indexOf(field) == "-1") 		
		return false;
  	else
		return true;	
}
function regexpNo(field,reg)
{
	var valid = reg;
	var ok = "no";
	var temp;   
	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if(isValidLetter(temp))
		{
			if (valid.indexOf(temp) >= 0) ok = "yes";
		}
		else
			ok = "yes";		
	}
	if (ok == "no") 
		return true;
  	else
		return false;   	
}

function regexp(field,reg)
{
	var valid = reg;
	var ok = "yes";
	var temp;   
	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if(isValidLetter(temp))
		{	
			if (valid.indexOf(temp) == "-1") ok = "no";
		}
		else
			ok = "no";
	}
	if (ok == "no") 
		return false;
  	else
		return true;   	
}
function regexpF(field,reg)
{
	var valid = reg;
	var ok = "yes";
	var temp;   
	temp = "" + field.value.substring(0, 1);
	if (valid.indexOf(temp) == "-1") ok = "no";
	if (ok == "no") 
		return false;
  	else
		return true;   	
}
function emailCheck (emailStr)
{
	var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
	var matchArray=emailStr.match(emailPat)
	if (matchArray==null) 
	{
		alert("Your Email Address must be valid!")
		return false
	}
	var user=matchArray[1]
	var domain=matchArray[2]
	if (user.match(userPat)==null)
	{
		alert("Your Email Address must be valid!")
		return false;
	}

	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) 
	{
		for (var i=1;i<=4;i++) 
		{
	    	if (IPArray[i]>255) 
			{
				alert("Your Email Address must be valid!")
				return false
	    	}
    	}
    	return true
	}
	var domainArray=domain.match(domainPat)
	if (domainArray==null) 
	{
		alert("Your Email Address must be valid!")
	    return false
	}
	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
	if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) 
	{
		alert("The Email Address must end in a three-letter domain, or two letter country.")
		return false
	}
	if (len<2)
	{
		alert("Your Email Address is invalid.")
		return false
	}
	return true;
}
function trim(inputString) 
{
   if (typeof inputString != "string") 
   { 
     return inputString; 
	}
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") 
   {
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") 
   {
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) 
   { 
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
   }
   return retValue;
}


function CalculateAmount(objFormat, objFormatId, objAmount, objAutoId, obj, rdName)
{
	elm = document.ConverCalculator.elements;
	for(i=0;i<elm.length;i++)
	{
		if(elm[i].type=="radio" && elm[i].id.indexOf(rdName) >= 0)
			elm[i].checked = false;		
	}
	obj.checked = true;	
	FillValue(objFormat, objAmount);
	FillValue(objFormatId, objAutoId);
	CalculateConvertionService();	
}
function CalculateConvertionService()
{
	var FormatAmount = GetValue('hidCFormat');
	var MediaAmount = GetValue('hidRMedia');
	var FileLength = GetValue('txtFLength');		
	var intResult = (FormatAmount / 60) * FileLength;
	
	if((intResult * 1) > 0)
		document.getElementById('lblCTotal').innerHTML = "$ " + intResult.toFixed(2);
	
	if((MediaAmount * 1) > 0)
		document.getElementById('lblRTotal').innerHTML = "$ " + MediaAmount.toFixed(2);
	else
		document.getElementById('lblRTotal').innerHTML = "";
	
	document.getElementById("hidFTotal").value = intResult;
	document.getElementById("hidRTotal").value = MediaAmount;
	
	var FinalResult = intResult + MediaAmount;
	if((FinalResult * 1) > 0)
		document.getElementById('lblTotalPrice').innerHTML = "$ " + FinalResult.toFixed(2);
	
	document.getElementById("hidTotal").value = FinalResult.toFixed(2);
}
function GetValue(objName)
{
	var objValue = 0;
	try
	{
		objValue = document.getElementById(objName).value * 1;
	}
	catch(err)
	{}
	return objValue;
}
function FillValue(objName, objValue)
{
	try
	{
		document.getElementById(objName).value = objValue;
	}
	catch(err)
	{}
}
function Calculate()
{
	var blnStatus = true;
	if(typeof document.all["pnlInfo"] != "undefined")
	{
		/*if(document.getElementById("rdCurrent_0").checked ||  document.getElementById("rdCurrent_1").checked || document.getElementById("rdCurrent_2").checked)
		{
			if(trim(document.ConverCalculator['txtFLength'].value) == "")
			{
				alert("Please Enter the Film Length");
				document.ConverCalculator['txtFLength'].focus();
				blnStatus = false;
			}
			if(blnStatus)
			{
				if(!regexp(document.ConverCalculator['txtFLength'], "0123456789."))
				{
					alert("Your Film Length Contains Invalid Characters.\n Only the following characters are allowed : 0123456789");
					document.ConverCalculator['txtFLength'].select();
					document.ConverCalculator['txtFLength'].focus();
					blnStatus = false;
				}
			}
			if(blnStatus)
			{
				if((document.getElementById("txtFLength").value * 1) <= 0)
				{
					alert("Film Length should be greater than Zero");
					document.getElementById("txtFLength").focus();
					document.getElementById("txtFLength").select();
					blnStatus = false;
				}
			}
			if(blnStatus)
			{
				var intCalcValue, intResult, intFilmLen;
				if(document.getElementById("rdCurrent_0").checked)
				{
					intCalcValue = document.getElementById("rdCurrent_0").value;
					intFilmLen = document.ConverCalculator['txtFLength'].value;
					document.getElementById("hidCFormat").value = intCalcValue;
					intResult = (intCalcValue / 60) * intFilmLen;
					intResult = intResult.toFixed(2);
					document.getElementById("lblCTotal").innerHTML =  "$ " + intResult;
					document.getElementById("hidFTotal").value = intResult;
				}
				if(document.getElementById("rdCurrent_1").checked)
				{
					intCalcValue = document.getElementById("rdCurrent_1").value;
					intFilmLen = document.ConverCalculator['txtFLength'].value;
					document.getElementById("hidCFormat").value = intCalcValue;
					intResult = (intCalcValue / 60) * intFilmLen;
					intResult = intResult.toFixed(2);
					document.getElementById("lblCTotal").innerHTML = "$ " +  intResult;
					document.getElementById("hidFTotal").value = intResult;
				}
				if(document.getElementById("rdCurrent_2").checked)
				{
					intCalcValue = document.getElementById("rdCurrent_2").value;
					intFilmLen = document.ConverCalculator['txtFLength'].value;
					document.getElementById("hidCFormat").value = intCalcValue;
					intResult = (intCalcValue / 60) * intFilmLen;
					intResult = intResult.toFixed(2);
					document.getElementById("lblCTotal").innerHTML = "$ " +  intResult;
					document.getElementById("hidFTotal").value = intResult;
				}
			}
		}
		
		if(document.getElementById("rdMedia_2").checked)
		{
			intValue = document.getElementById("rdMedia_2").value;
			document.getElementById("hidRMedia").value = intValue;
			document.getElementById("lblRTotal").innerText = "$ " +  intValue;
			document.getElementById("hidRTotal").value = intValue;
		}
		if(document.getElementById("rdMedia_3").checked)
		{
			intValue = document.getElementById("rdMedia_3").value;
			document.getElementById("hidRMedia").value = intValue;
			document.getElementById("lblRTotal").innerText = "$ " + intValue;
			document.getElementById("hidRTotal").value = intValue;
		}
		if(document.getElementById("rdMedia_0").checked || document.getElementById("rdMedia_1").checked)
		{
			document.getElementById("lblRTotal").innerText = "";
			document.getElementById("hidRTotal").value = "";
			if(document.getElementById("rdMedia_0").checked)
			{
				intValue = document.getElementById("rdMedia_0").value;
				document.getElementById("hidRMedia").innerText = intValue;
			}
			if(document.getElementById("rdMedia_1").checked)
			{
				intValue = document.getElementById("rdMedia_1").value;
				document.getElementById("hidRMedia").innerText = intValue;
			}
		}*/
		var intValue;
		if(document.getElementById("rdSend_0").checked)
		{
			intValue = document.getElementById("rdSend_0").value;
			document.getElementById("hidSend").value = intValue;
			//document.getElementById("txtFileName").style.visibility = "visible";
		}
		else if(document.getElementById("rdSend_1").checked)
		{
			intValue = document.getElementById("rdSend_1").value;
			document.getElementById("hidSend").value = intValue;
			//document.getElementById("txtFileName").style.visibility = "hidden";
		}
		
		if(document.getElementById("rdFormat_0").checked)
		{
			intValue = document.getElementById("rdFormat_0").value;
			document.getElementById("hidFConvert").value = intValue;
			/*document.getElementById("pnlOther").style.visibility = "hidden";
			document.getElementById("pnlOther").style.position = "absolute";*/
		}
		else if(document.getElementById("rdFormat_1").checked)
		{
			intValue = document.getElementById("rdFormat_1").value;
			document.getElementById("hidFConvert").value = intValue;
			/*document.getElementById("pnlOther").style.visibility = "hidden";
			document.getElementById("pnlOther").style.position = "absolute";*/
		}
		if(document.getElementById("rdFormat_2").checked)
		{
			intValue = document.getElementById("rdFormat_2").value;
			document.getElementById("hidFConvert").value = intValue;
			/*document.getElementById("pnlOther").style.visibility = "hidden";
			document.getElementById("pnlOther").style.position = "absolute";*/
		}
		/*else if(document.getElementById("rdFormat_3").checked)
		{
			intValue = document.getElementById("rdFormat_3").value;
			document.getElementById("hidFConvert").innerText = intValue;
			/*document.getElementById("pnlOther").style.position = "relative";
			document.getElementById("pnlOther").style.visibility = "visible";
			
		}*/
		
		/*if(blnStatus)
		{
			var intCTotal, intRTotal;
			intCTotal = document.getElementById("hidFTotal").value;
			intRTotal = document.getElementById("hidRTotal").value;
			intCTotal = (intCTotal * 1) + (intRTotal * 1); 
			if((intCTotal * 1) > 0)
			{
				document.getElementById("lblTotalPrice").innerHTML = "$ " + intCTotal;
				document.getElementById("hidTotal").value = intCTotal;
			}
		}*/
	}
}


function ConverFields()
{
	if(trim(document.getElementById("txtFLength").value) == "")
	{
		alert("Please Enter the Film Length");
		document.getElementById("txtFLength").focus();
		return false;
	}
	if(!regexp(document.getElementById("txtFLength"), "0123456789."))
	{
		alert("Your Film Length Contains Invalid Characters.\n Only the following characters are allowed : 0123456789");
		document.getElementById("txtFLength").select();
		document.getElementById("txtFLength").focus();
		return false;
	}
	if((document.getElementById("txtFLength").value * 1) <= 0)
	{
		alert("Film Length should be greater than Zero");
		document.getElementById("txtFLength").focus();
		document.getElementById("txtFLength").select();
		return false;
	}
	if(trim(document.getElementById("hidFTotal").value) == "")
	{
		alert("Please click any one of the Current Format Option");
		document.getElementById("dgCurrentFormat").focus();
		return false;
	}
	if((document.getElementById("hidCFormatId").value * 1) <= 0)
	{
		alert("Please click any one of the Current Format Option");
		document.getElementById("dgCurrentFormat").focus();
		return false;
	}
	if(trim(document.getElementById("hidSend").value) == "")
	{
		alert("Please click any one of the Send your Film Option");
		document.getElementById("rdSend_0").focus();
		return false;
	}
	if(trim(document.getElementById("hidFConvert").value) == "")
	{
		alert("Please click any one of the Convert Format Option");
		document.getElementById("rdFormat_0").focus();
		return false;
	}
	if(document.getElementById("rdFormat_2").checked)
	{
		if(trim(document.getElementById("txtAspect1").value) == "")
		{
			alert("Please enter the Aspect Ratio");
			document.getElementById("txtAspect1").focus();
			return false;
		}
		if(!regexp(document.getElementById("txtAspect1"), "0123456789."))
		{
			alert("Your Aspect Ratio Contains Invalid Characters.\n Only the following characters are allowed : 0123456789");
			document.getElementById("txtAspect1").select();
			document.getElementById("txtAspect1").focus();
			return false;
		}
		if((document.getElementById("txtAspect1").value * 1) < 0)
		{
			alert("Aspect Ratio should be greater than Zero");
			document.getElementById("txtAspect1").focus();
			document.getElementById("txtAspect1").select();
			return false;
		}
		
		if(trim(document.getElementById("txtAspect2").value) == "")
		{
			alert("Please enter the Aspect Ratio");
			document.getElementById("txtAspect2").focus();
			return false;
		}
		if(!regexp(document.getElementById("txtAspect2"), "0123456789."))
		{
			alert("Your Aspect Ratio Contains Invalid Characters.\n Only the following characters are allowed : 0123456789");
			document.getElementById("txtAspect2").select();
			document.getElementById("txtAspect2").focus();
			return false;
		}
		if((document.getElementById("txtAspect2").value * 1) < 0)
		{
			alert("Aspect Ratio should be greater than Zero");
			document.getElementById("txtAspect2").focus();
			document.getElementById("txtAspect2").select();
			return false;
		}
		
		if(trim(document.getElementById("txtDimension1").value) == "")
		{
			alert("Please enter the Dimension");
			document.getElementById("txtDimension1").focus();
			return false;
		}
		if(!regexp(document.getElementById("txtDimension1"), "0123456789."))
		{
			alert("Your Dimension Contains Invalid Characters.\n Only the following characters are allowed : 0123456789");
			document.getElementById("txtDimension1").select();
			document.getElementById("txtDimension1").focus();
			return false;
		}
		if((document.getElementById("txtDimension1").value * 1) < 0)
		{
			alert("Dimension should be greater than Zero");
			document.getElementById("txtDimension1").focus();
			document.getElementById("txtDimension1").select();
			return false;
		}
		
		if(trim(document.getElementById("txtDimension2").value) == "")
		{
			alert("Please enter the Dimension");
			document.getElementById("txtDimension2").focus();
			return false;
		}
		if(!regexp(document.getElementById("txtDimension2"), "0123456789."))
		{
			alert("Your Dimension Contains Invalid Characters.\n Only the following characters are allowed : 0123456789");
			document.getElementById("txtDimension2").select();
			document.getElementById("txtDimension2").focus();
			return false;
		}
		if((document.getElementById("txtDimension2").value * 1) < 0)
		{
			alert("Dimension should be greater than Zero");
			document.getElementById("txtDimension2").focus();
			document.getElementById("txtDimension2").select();
			return false;
		}
		
		if(trim(document.getElementById("txtStreaming1").value) == "")
		{
			alert("Please enter the Streaming Rate");
			document.getElementById("txtStreaming1").focus();
			return false;
		}
		if(!regexp(document.getElementById("txtStreaming1"), "0123456789"))
		{
			alert("Your Streaming Rate Invalid Characters.\n Only the following characters are allowed : 0123456789");
			document.getElementById("txtStreaming1").select();
			document.getElementById("txtStreaming1").focus();
			return false;
		}
		if((document.getElementById("txtStreaming1").value * 1) < 0)
		{
			alert("Streaming Rate should be greater than Zero");
			document.getElementById("txtStreaming1").focus();
			document.getElementById("txtStreaming1").select();
			return false;
		}
	}
	if(trim(document.getElementById("hidRMedia").value) == "")
	{
		alert("Please click any one of the Return Media Option");
		document.getElementById("dgReturnMedia").focus();
		return false;
	}
	//return false;
}
function CheckAddCC()
{
	if(typeof document.all["pnlAddress"] != "undefined")
	{
		if(document.ConverCalculator['ddlCountry'].value == "")
		{
			alert("Please Select the Country");
			document.ConverCalculator['ddlCountry'].focus();
			return false;
		}
		if(trim(document.ConverCalculator['txtAddress1'].value) == "")
		{
			alert("Please Enter the Address");
			document.ConverCalculator['txtAddress1'].focus();
			return false;
		}
		if(typeof document.all['ddlState'] != "undefined")
		{
			if(document.all['ddlState'].length > 1 && document.all['ddlState'].value == "")
			{
				alert("Please Select the State/Province/Territory");
				document.ConverCalculator['ddlState'].focus();
				return false;
			}
		}
		if(typeof document.all['txtCity'] != "undefined")
		{
			if(trim(document.ConverCalculator['txtCity'].value) == "")
			{
				alert("Please Enter the City/Region");
				document.ConverCalculator['txtCity'].focus();
				return false;
			}
			if(regexp(document.ConverCalculator['txtCity'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ") == false)
			{
				alert("Your City Contains Invalid Characters.\n Only the following characters are allowed : Alphabets");
				document.ConverCalculator['txtCity'].focus();
				document.ConverCalculator['txtCity'].select();
				return false;
			}
		}
		if(trim(document.ConverCalculator['txtZip'].value) == "")
		{
			alert("Please Enter the Zip/Postal Code.");
			document.ConverCalculator['txtZip'].focus();
			return false;
		}
		if(trim(document.ConverCalculator['hidZipCodeType'].value) == "AN")
		{
			if(!regexp(document.ConverCalculator['txtZip'], "0123456789-,ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz "))
			{
				alert("Your Zip Contains Invalid Characters.\n Only the following characters are allowed : \n Letters \n 0123456789-,");
				document.ConverCalculator['txtZip'].select();
				document.ConverCalculator['txtZip'].focus();
				return false;
			}	
		}
		else
		{
			if(!regexp(document.ConverCalculator['txtZip'], "0123456789-, "))
			{
				alert("Your Zip Contains Invalid Characters.\n Only the following characters are allowed : 0123456789-,");
				document.ConverCalculator['txtZip'].select();
				document.ConverCalculator['txtZip'].focus();
				return false;
			}
				
		}
		if(document.ConverCalculator['hidZipRange'].value != "")
		{
			if(document.ConverCalculator['txtZip'].value.length > document.ConverCalculator['hidZipRange'].value)
			{
				alert("Invalid Zip/Postal Code.");
				document.ConverCalculator['txtZip'].focus();
				document.ConverCalculator['txtZip'].select();
				return false;
			}
		}
		if(trim(document.ConverCalculator['txtPhone'].value) == "")
		{
			alert("Please Enter the Phone Number");
			document.ConverCalculator['txtPhone'].focus();
			return false;
		}
		if(!regexp(document.ConverCalculator['txtPhone'], "0123456789-+() "))
		{
			alert("Your Phone Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
			document.ConverCalculator['txtPhone'].select();
			document.ConverCalculator['txtPhone'].focus();
			return false;
		}
		if(!regexp(document.ConverCalculator['txtMobile'], "0123456789-+()"))
		{
			alert("Your Mobile Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
			document.ConverCalculator['txtMobile'].select();
			document.ConverCalculator['txtMobile'].focus();
			return false;
		}
		if(!regexp(document.ConverCalculator['txtFax'], "0123456789- "))
		{
			alert("Your FAX Number Contains Invalid Characters.\n Only the following characters are allowed : 0123456789- ");
			document.ConverCalculator['txtFax'].select();
			document.ConverCalculator['txtFax'].focus();
			return false;
		}
	}
	if(document.ConverCalculator['ddlCCType'].length > 1 && document.ConverCalculator['ddlCCType'].value == "")
	{
		alert("Please Select the Card Type");
		document.ConverCalculator['ddlCCType'].focus();
		return false;
	}
	if(document.ConverCalculator['txtCCNumber'].value == "")
	{
		alert("Please Enter the Credit Card Number.");						
		document.ConverCalculator.txtCCNumber.focus();
		return false;
	}		
	if (isInteger(document.ConverCalculator['txtCCNumber'].value)==false)
	{
		alert("Invalid.. Enter Numeric characters");
		document.ConverCalculator.txtCCNumber.focus();
		return false;
	}
	if(document.ConverCalculator['txtName'].value == "")
	{
		alert("Name cannot be empty");						
		document.ConverCalculator.txtName.focus();
		return false;
	}
	if (isNotSpecial(document.ConverCalculator['txtName'].value)==false)
	{
		alert("Invalid data for Name");
		document.ConverCalculator.txtName.focus();
		return false;
	}
	if(document.ConverCalculator['txtSecNo'].value=="")
	{
		alert("Card Security Code cannot be empty");
		document.ConverCalculator.txtSecNo.focus();
		return false;
	}
	if(trim(document.ConverCalculator['txtVerify'].value) == "")
	{
		alert("Please Enter the characters displayed in the picture below.");
		document.ConverCalculator['txtVerify'].focus();
		return false;
	}
}

function AdminCheckTheaterFields()
{
	/*for(var i=0;i<frmAddTheater.elements.length;i++)
	{
		frmAddTheater.elements[i].value = trim(frmAddTheater.elements[i].value);
		if(frmAddTheater.elements[i].value != "" && (frmAddTheater.elements[i].type == "text" || frmAddTheater.elements[i].type == "textarea"))
		{
			var strTheater = document.frmAddTheater.elements[i].value;
			strTheater = strTheater.replace(/\r\n/g,"<br>");
			strTheater = strTheater.replace(/</g,"&lt;");
			strTheater = strTheater.replace(/>/g,"&gt;");
			if(regexp1(strTheater,'\\') == true)
			{
				alert('Invalid Characters, this field cannot contain \ ');
				frmAddTheater.elements[i].focus();
				frmAddTheater.elements[i].select();
				return false;
			}
		}
	}*/
	
	if(document.frmAddTheater['txtTheatName'].value == "")
		{
			alert("Please Enter the Theater Name");
			document.frmAddTheater['txtTheatName'].focus();
			return false;
		}
		if(regexp(document.frmAddTheater['txtTheatName'], "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz12345667890 .-,&'~?/*+={}[]!@#$%^;: *()") == false)
		{
			alert("Your Theater Name Contains Invalid Characters.\nOnly Following Characters Are allowed:\nAlphabets\nNumers\nSpecial characters like .-'()&/?;:[]{} `~_+=|<>,!@#$%^*");
			document.frmAddTheater['txtTheatName'].focus();
			document.frmAddTheater['txtTheatName'].select();
			return false;
		}
		
		var theaterDesc = getCharCount('txtDescription');
		var docName = getTxtName('txtDescription');	
		if(theaterDesc == 0)
		{
			alert("Please Enter the Theater Description");		
			docName.body.focus();
			return false;
		}
		if(theaterDesc > 5000)
		{				
			alert("Theater Description should be less than 5000 characters. \nThe 5000 character count includes all text and spaces and is also affected by font size, color, and other formatting applied.\nClick the View Source (HTML) icon to see the total Characters.");
			//document.all['txtAbout'].focus();
			//document.all['txtAbout'].select();
			docName.body.focus();
			return false;
		}
		
		var tv = document.frmAddTheater['filePicutureUpload'].value; 
		/*if(trim(tv) == "")
		{
			alert("Your display picture cannot be empty. Please select");
			document.frmTheater['filePicutureUpload'].focus();
			return false;
		}*/
		if(trim(tv) != "")
		{
			if (!((tv.substr((tv.length-3),3).toLowerCase() == "jpg") || (tv.substr((tv.length-3),3).toLowerCase() == "gif")))
			{
				alert("Select JPG or GIF formats for Theater Picture");
				document.frmAddTheater['filePicutureUpload'].focus();
				document.frmAddTheater['filePicutureUpload'].select();
				return false;
			}
		}
		if(trim(document.frmAddTheater['ddlTheaterTypes'].value) == "")
		{
			alert("Please Select The Theater Type");
			document.frmAddTheater['ddlTheaterTypes'].focus();
			return false;
		}
		if(trim(document.frmAddTheater['ddlTheaterModes'].value) == "")
		{
			alert("Please Select The Theater Mode");
			document.frmAddTheater['ddlTheaterModes'].focus();
			return false;
		}
		if(document.frmAddTheater['txtOwnerName'].value != "")
		{
			if(regexp(document.frmAddTheater['txtOwnerName'], "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz12345667890 .-,&'~?/*+={}[]!@#$%^;: *()") == false)
			{
				alert("Your Owner Name Contains Invalid Characters.\nOnly Following Characters Are allowed:\nAlphabets\nNumers\nSpecial characters like .-'()&/?;:[]{} `~_+=|<>,!@#$%^*");
				document.frmAddTheater['txtOwnerName'].focus();
				document.frmAddTheater['txtOwnerName'].select();
				return false;
			}
		}
		
		var OwnerDesc = getCharCount('txtOwnerDesc');
		var ownerName = getTxtName('txtOwnerDesc');	
		if(OwnerDesc > 5000)
		{				
			alert("Owner Description should be less than 5000 characters. \nThe 5000 character count includes all text and spaces and is also affected by font size, color, and other formatting applied.\nClick the View Source (HTML) icon to see the total Characters.");
			//document.all['txtAbout'].focus();
			//document.all['txtAbout'].select();
			ownerName.body.focus();
			return false;
		}
		var ownPic = document.frmAddTheater['flOwnerUpload'].value; 
		/*if(trim(tv) == "")
		{
			alert("Your display picture cannot be empty. Please select");
			document.frmTheater['filePicutureUpload'].focus();
			return false;
		}*/
		if(trim(ownPic) != "")
		{
			if (!((ownPic.substr((ownPic.length-3),3).toLowerCase() == "jpg") || (ownPic.substr((ownPic.length-3),3).toLowerCase() == "gif")))
			{
				alert("Select JPG or GIF formats for Owner Picture");
				document.frmAddTheater['flOwnerUpload'].focus();
				document.frmAddTheater['flOwnerUpload'].select();
				return false;
			}
		}
}

function AdminCheckFields()
{

	if(trim(document.frmViewTheater['txtTheaterName'].value) == "")
	{
		alert('Theater name cannot be Empty');
		document.frmViewTheater['txtTheaterName'].focus();
		return false;
	}
	if(regexp(document.frmViewTheater['txtTheaterName'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz12345667890.-,&'~?/*+={}[]!@#$%^;: *()") == false)
	{
		alert("Theater Name contain Invalid Character.\n Only the following characters are Allowed: \n alphbets, \n numbers and \n special characters like .-,'&?!@#$%|/*+={}^;:()[]");
		document.frmViewTheater['txtTheaterName'].focus();
		document.frmViewTheater['txtTheaterName'].select();
		return false;
	}
	
	var theaterDesc = getCharCount('txtDescription');
	var docName = getTxtName('txtDescription');	
	if(theaterDesc == 0)
	{
		alert("Please Enter the Theater Description");		
		docName.body.focus();
		return false;
	}
	if(theaterDesc > 5000)
	{				
		alert("Theater Description should be less than 5000 characters. \nThe 5000 character count includes all text and spaces and is also affected by font size, color, and other formatting applied.\nClick the View Source (HTML) icon to see the total Characters.");
		docName.body.focus();
		return false;
	}
	
	if(document.frmViewTheater['txtOwnerName'].value != "")
	{
		if(regexp(document.frmViewTheater['txtOwnerName'], "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz12345667890 .-,&'~?/*+={}[]!@#$%^;: *()") == false)
		{
			alert("Your Owner Name Contains Invalid Characters.\nOnly Following Characters Are allowed:\nAlphabets\nNumers\nSpecial characters like .-'()&/?;:[]{} `~_+=|<>,!@#$%^*");
			document.frmViewTheater['txtOwnerName'].focus();
			document.frmViewTheater['txtOwnerName'].select();
			return false;
		}
	}
	
	var OwnerDesc = getCharCount('txtOwnerDesc');
	var ownerName = getTxtName('txtOwnerDesc');	
	if(OwnerDesc > 5000)
	{				
		alert("Owner Description should be less than 5000 characters. \nThe 5000 character count includes all text and spaces and is also affected by font size, color, and other formatting applied.\nClick the View Source (HTML) icon to see the total Characters.");
		ownerName.body.focus();
		return false;
	}
}

function CheckBrowse()
{
	var tv = document.frmViewTheater['filePicutureUpload'].value; 
	if(trim(tv) == "")
	{
		alert("Your display picture cannot be empty. Please select");
		document.frmViewTheater['filePicutureUpload'].focus();
		return false;
	}
	if (!((tv.substr((tv.length-3),3).toLowerCase() == "jpg") || (tv.substr((tv.length-3),3).toLowerCase() == "gif")))
	{
		alert("Select JPG or GIF formats for Picture");
		document.frmViewTheater['filePicutureUpload'].focus();
		document.frmViewTheater['filePicutureUpload'].select();
		return false;
	}
}

function CheckGFNameChange()
{
	if(trim(document.frmGFNameChange['txtGFName'].value) == "")
	{
		alert("Please Enter the your Grapeflix Name");
		document.frmGFNameChange['txtGFName'].focus();
		return false;
	}
	if(regexp(document.frmGFNameChange['txtGFName'],"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ._1234567890") == false)
	{
		alert("Your Grapeflix Name contains invalid characters.  Only letters, numbers, underscore  and periods are allowed.");
		document.frmGFNameChange['txtGFName'].focus();
		document.frmGFNameChange['txtGFName'].select();
		return false;
	}
}

function CheckGiftCoupon()
{
	if(typeof document.all['pnlGCEnterDetails'] != "undefined") //&& document.all['pnlGCEnterDetails'] != null)
	{
		if(trim(document.frmGiftCoupon['txtAllowedUser'].value) == "")
		{
			alert("Please Enter Number of Viewers");
			document.frmGiftCoupon['txtAllowedUser'].focus();
			return false;
		}
		if(regexp(document.frmGiftCoupon['txtAllowedUser'],"1234567890") == false)
		{
			alert("Please Enter Numeric values");
			document.frmGiftCoupon['txtAllowedUser'].focus();
			document.frmGiftCoupon['txtAllowedUser'].select();
			return false;
		}
		if((document.frmGiftCoupon['txtAllowedUser'].value * 1) <= 0 )
		{
			alert("The Number viewers should be greater than Zero");
			document.frmGiftCoupon['txtAllowedUser'].focus();
			document.frmGiftCoupon['txtAllowedUser'].select();
			return false;
		}
	}
}

function chkDisableStatus()
{
	if(document.disabledFeatures['chkDisabled'].checked) //&& document.all['pnlGCEnterDetails'] != null)
	{
		if(trim(document.disabledFeatures['txtDisableDesc'].value) == "")
		{
			alert("Please enter the description.");
			document.disabledFeatures['txtDisableDesc'].focus();
			return false;
		}
	}
}
