
function closeWindow() {
	parent.window.opener.window.focus();
	parent.window.close();
}

function printWindow() {
	parent.mainFrame.focus();
	window.print(parent.mainFrame);
}


	function chkULogin1(url)
	{
		user	= trimSpaces(document.frmULogin1.m_username.value);
		pass	= trimSpaces(document.frmULogin1.m_password.value);
		
		if (user.length <= 0) {
			alert("Please enter a valid Login Id");
			document.frmULogin1.m_username.focus();
			return;
		}
		if (pass.length <= 0) {
			alert("Please enter a valid password");
			document.frmULogin1.m_password.focus();
			return;
		}
		document.frmULogin1.action = url;
		document.frmULogin1.submit();
	}

	function chkULogin()
	{
		user	= trimSpaces(document.frmULogin.m_username.value);
		pass	= trimSpaces(document.frmULogin.m_password.value);
		if (user.length <= 0) {
			alert("Please enter a valid Login Id");
			document.frmULogin.m_username.focus();
			return false;
		}
		if (pass.length <= 0) {
			alert("Please enter a valid password");
			document.frmULogin.m_password.focus();
			return false;
		}
		document.frmULogin.action = "verifyLogin.php";
		document.frmULogin.submit();
	}

function checkSubscription(action)
{

 if(action=="sub")
  {
	document.frmEnquery.lname.value=trimSpaces(document.frmEnquery.lname.value);
	if(document.frmEnquery.lname.value.length<=0)
	 {
	 	alert("Enter your Last Name");
		document.frmEnquery.lname.focus();
		return false;
	 }

	document.frmEnquery.fname.value=trimSpaces(document.frmEnquery.fname.value);
	if(document.frmEnquery.fname.value.length<=0)
	 {
	 	alert("Enter your First Name");
		document.frmEnquery.fname.focus();
		return false;
	 }

	   	
	document.frmEnquery.email.value=trimSpaces(document.frmEnquery.email.value);
	if(document.frmEnquery.email.value.length<=0)
	 {
	 	alert("Enter Email Id");
		document.frmEnquery.email.focus();
		return false;
	 }
	else
	 {
	   if(!checkEmail(document.frmEnquery.email.value))
	   {
		document.frmEnquery.email.focus();
	    return false;
	   }
	 }  	 
	 
	document.frmEnquery.frmAction.value="update";
	document.frmEnquery.submit();
 }
 else
  {	
  	document.forms[0].email.value=trimSpaces(document.forms[0].email.value);
	if(document.forms[0].email.value.length<=0)
	 {
	 	alert("Enter Email Id");
		document.forms[0].email.focus();
		return false;
	 }
	else
	 {
	   if(!checkEmail(document.forms[0].email.value))
	   {
	    return false;
	   }
	 }  	 
	 
	document.forms[0].frmAction.value="delete";
	alert();
	document.forms[0].submit();
}
}


function showPicture(gid,cid) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 600;
	winHeight = 500;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("showPicture.php?galleryid=" + gid + "&category=" +cid, "picture", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
}

function viewPollResults(poll_topic_id)
{
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 200;
	winHeight = 200;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("php/viewPollResult.php?poll_topic_id="+poll_topic_id, "picture", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
}

function checkEmailList() {
	
	firstName = trimSpaces(document.forms[0].firstName.value);
	if(firstName.length <= 0) {
		alert("Please enter your name.");
		document.forms[0].firstName.focus();
		return false;
	}
/*	
	lastName = trimSpaces(document.forms[0].lastName.value);
	if(lastName.length <= 0) {
		alert("Please enter your last name.");
		document.forms[0].lastName.focus();
		return false;
	}
*/	
	subscriberEmail = trimSpaces(document.forms[0].subscriberemail.value);
	if(subscriberEmail.length <= 0) {
		alert("Please enter your email.");
		document.forms[0].subscriberemail.focus();
		return false;
	}
	if(subscriberEmail.length > 0){
		if(!checkEmail(subscriberEmail)){
			document.forms[0].subscriberemail.focus();
			return false;
		}
	}
	
	document.forms[0].frmAction.value = "update";

}
function checkField2(page)
  {
	if(document.investor.userName.value.length<=0) 
	{ 
	alert("Enter the user name"); 
	document.investor.userName.focus();
	if(page=="home")
		return; 
	else
	     return false;
	}
	if(document.investor.password.value.length<=0) 
	{ 
	alert("Enter the password"); 
	document.investor.password.focus();
	if(page=="home")
		return; 
	else
	     return false;
	}
	document.investor.frmAction.value="login";
	document.investor.submit();
 }
function checkListing()
{

	document.forms[0].lastName.value=trimSpaces(document.forms[0].lastName.value);
	if(document.forms[0].lastName.value.length<=0)
	 {
	 	alert("Enter your Last Name");
		document.forms[0].lastName.focus();
		return false;
	 }

	document.forms[0].firstName.value=trimSpaces(document.forms[0].firstName.value);
	if(document.forms[0].firstName.value.length<=0)
	 {
	 	alert("Enter your First Name");
		document.forms[0].firstName.focus();
		return false;
	 }
	 
	document.forms[0].street.value=trimSpaces(document.forms[0].street.value);
	if(document.forms[0].street.value.length<=0)
	 {
	 	alert("Enter your street");
		document.forms[0].street.focus();
		return false;
	 }

	   	
	document.forms[0].apartment.value=trimSpaces(document.forms[0].apartment.value);
	if(document.forms[0].apartment.value.length<=0)
	 {
	 	alert("Enter your Apartment");
		document.forms[0].apartment.focus();
		return false;
	 }

	   	
	   	
	document.forms[0].city.value=trimSpaces(document.forms[0].city.value);
	if(document.forms[0].city.value.length<=0)
	 {
	 	alert("Enter your City");
		document.forms[0].city.focus();
		return false;
	 }

	   	
	   	
	document.forms[0].state.value=trimSpaces(document.forms[0].state.value);
	if(document.forms[0].state.value.length<=0)
	 {
		if(document.forms[0].state1.value.length<=0)
		 {
			alert("Enter your State");
			document.forms[0].state1.focus();
			return false;
		 }
		 else if(document.forms[0].country.value=="US")
		 {
			alert("Select your country");
			document.forms[0].country.focus();
			return false;
		 }
	 }

	document.forms[0].phone.value=trimSpaces(document.forms[0].phone.value);
	if(document.forms[0].phone.value.length<=0)
	 {
	 	alert("Enter your Phone");
		document.forms[0].phone.focus();
		return false;
	 }

   	
	document.forms[0].email.value=trimSpaces(document.forms[0].email.value);
	if(document.forms[0].email.value.length<=0)
	 {
	 	alert("Enter Email Id");
		document.forms[0].email.focus();
		return false;
	 }
	else
	 {
	   if(!checkEmail(document.forms[0].email.value))
	   {
		document.forms[0].email.focus();
	    return false;
	   }
	 }  	 
	 
	document.forms[0].frmAction.value="update";
	document.forms[0].submit();
}
 function activate(pic)
 {
	 document.img1.src=pic;
	/* img2.style.visibility='hidden';
	 img3.style.visibility='hidden';
	 img4.style.visibility='hidden';
	 img5.style.visibility='hidden';
 	 img6.style.visibility='hidden';
	 eval(pic+".style.visibility='visible'");*/
 }
function submitSearch(page)
{
	if(page == 'home') {
		val = 'php/';
	}else {val = '';}
	searchKey = trimSpaces(document.search.searchKey.value);
	if(searchKey == '') {
		alert("Enter search string");
		document.search.searchKey.focus();
		return;
	}
	//document.search.action = "displaySearch.php?searchKey=" + searchKey;
	document.search.action = val+"displaySearch.php";
	document.search.submit();
}
function checkKey(page){
	if(window.event.keyCode == 13) {
		if(page == 'home') {
			val = 'php/';
		}else {val = '';}

		searchKey = trimSpaces(document.search.searchKey.value);
		if(searchKey == '') {
			alert("Enter search string");
			document.search.searchKey.focus();
			return false;
		}else {
			document.search.action = val+"displaySearch.php";
			document.search.submit();
		}		
	}
}
function validateFields(from)
{
user_name=trimSpaces(document.loginform.user_name.value);
password=trimSpaces(document.loginform.password.value);
if(user_name.length<=0)
	{
	  alert("Enter the user name");
	  document.loginform.user_name.focus();
	 if(from=="home")
	   return;
	 else
	   return false;
	}
if(password.length<=0)
	{
	  alert("Enter the password");
	  document.loginform.password.focus();
	 if(from=="home")
	   return;
	 else
	   return false;
	}
	document.loginform.frmAction.value="login";
	document.loginform.submit();
}
function checkUserForm()
{
firstName=trimSpaces(document.regform.first_name.value);
lastName=trimSpaces(document.regform.last_name.value);
user_name=trimSpaces(document.regform.user_name.value);
password=trimSpaces(document.regform.password.value);
email=trimSpaces(document.regform.email.value);
if(firstName.length<=0)
{
  alert("Enter your first name");
  document.regform.first_name.focus();
   return false;
}
if(lastName.length<=0)
{
  alert("Enter your last name");
  document.regform.last_name.focus();
   return false;
}
if(email.length<=0)
 {
  alert("Please enter the email");
  document.forms[0].email.focus();
  return false;
 }
 else
 {
	 if(email.length>0)
	 {
		 if(!checkEmail(email))
		 {
		  document.forms[0].email.focus();
		  return false;
		 }
	 }
  }
if(user_name.length<=0)
{
  alert("Enter the user name");
  document.regform.user_name.focus();
   return false;
}
if(password.length<=0)
{
  alert("Enter the password");
  document.regform.password.focus();
   return false;
}

document.regform.frmAction.value="update";
document.regform.submit();
}
function showEventPicture(imgURL, imgType) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	if(imgType == "photo") {
		winWidth = 400;
		winHeight = 400;
	}
	else {
		winWidth = 125;
		winHeight = 100;
	}
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("showeventPicture.php?imgURL=" + imgURL, "photograph", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
}
function showCalendar1(frmElement, dispElement) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 375;
	winHeight = 300;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("showCalendar1.php?frmElement=" + frmElement + "&dispElement=" + dispElement, "Calendar", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=0,resizable=0");
	return;
}


function sub_enabled()
{
	if(document.frmReg.subButton.disabled == true) {
		document.frmReg.subButton.disabled=false
	} else {
		document.frmReg.subButton.disabled=true
	}
}

function chk_enabled()
{
	document.forms[0].chktrem.checked=false
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function  gotoMovieList(str, genre, type){
	location.href="indexin.aspx?s="+str+"&g="+genre+"&t="+type+"&iCode="
}

function chkKeyPress(){
	if (event.keyCode == 13){
		//alert(clientfunction())
		return clientfunction()
		//document.frmMain.btnSubmit.Click
	}
}
			
		
			function clientfunction()
			{
				var msg=""
				var tlen=0
				tlen=document.frmReg.m_username.value.length
				for (i = 0; i < tlen; i++) 
				{
					if(document.frmReg.m_username.value.charAt(i) == " ")
					{
						alert("Your Login Id should not have any space.")
						document.frmReg.m_username.select();
						return false	
					}
				}
				if(document.frmReg.m_username.value == "")
				{				
					alert("Login Id cannot be left blank")
					document.frmReg.m_username.select();
					return false
				}
				else
					{
						if((document.frmReg.m_username.value).length < 3)
						{	
							alert("Login Id should be atleast three characters\n");
							document.frmReg.m_username.select();
							return false
						}
					}	
				
										
				if(document.frmReg.m_password.value == "")
				{	
					alert("Password cannot be left blank\n");
					document.frmReg.m_password.select();
					return false
				}
				else
					{
						if((document.frmReg.m_password.value).length < 6 || (document.frmReg.m_password.value).length > 15)
						{	
							alert("Password cannot be less than 6 and more than 15 characters\n");
							document.frmReg.m_password.select();
							return false
						}	
					}	
				if(document.frmReg.m_password.value != document.frmReg.con_password.value)				 
				{
					//msg=msg + "Passwords do not match\n";
					alert("Passwords do not match\n");
					document.frmReg.con_password.select();
					return false
				}
				if((document.frmReg.m_hintque.selectedIndex <= 0))				
				{
					//msg=msg + "Hint question cannot be left blank\n";
					alert("Hint question cannot be left blank\n");
					document.frmReg.m_hintque.focus();
					return false					
				}
								
									
				if(document.frmReg.m_hintans.value == "")
				{
					//msg=msg + "Hint answer cannot be left blank\n";
					alert("Hint answer cannot be left blank\n");
					document.frmReg.m_hintans.focus();
					return false
				}
				
				if(document.frmReg.m_fname.value == "")				
				{
					//msg=msg + "Firstname cannot be left blank\n";					
					alert("Firstname cannot be left blank\n");
					document.frmReg.m_fname.select();
					return false
				}
				if(document.frmReg.m_lname.value == "")				
				{
					//msg=msg + "Lastname cannot be left blank\n";					
					alert("Lastname cannot be left blank\n");
					document.frmReg.m_lname.select();
					return false
				}
				if (checkPositiveInteger(document.frmReg.m_age.value))
				{
					//msg=msg + "Invalid Age entered\n";					
					alert("Invalid Age entered\n");
					document.frmReg.m_age.select();
					return false
				}
				
				if(document.frmReg.m_address.value == "")				
				{
					//msg=msg + "Address cannot be left blank\n";					
					alert("Address cannot be left blank\n");
					document.frmReg.m_address.select();
					return false
				}
				if(document.frmReg.m_city.value.charAt(0) == " ")				
				{
					var tlen=0
					tlen=document.frmReg.m_city.value.length
					if(tlen==1)
					{
					alert("City cannot be left blank\n");
					document.frmReg.m_city.select();
					return false
					}
				}
				if(document.frmReg.m_city.value == "")				
				{
					//msg=msg + "City cannot be left blank\n";				
					alert("City cannot be left blank\n");
					document.frmReg.m_city.select();
					return false
				}
				else
				{
				var tlen=0
				tlen=document.frmReg.m_city.value.length
				for (i = 0; i < tlen; i++) 
				{
					if (IsNumeric(document.frmReg.m_city.value.charAt(i))==true)
					{
						alert("Number is not allowed for city.")
						document.frmReg.m_city.select();
						return false	
					}
				}
				}
				if(document.frmReg.m_state.value.charAt(0) == " ")				
				{
					var tlen=0
					tlen=document.frmReg.m_state.value.length
					if(tlen==1)
					{
					alert("State/County cannot be left blank\n");
					document.frmReg.m_state.select();
					return false
					}
				}
				if(document.frmReg.m_state.value == "")				
				{
					alert("State/County cannot be left blank\n");
					document.frmReg.m_state.select();
					return false
				}
				else
				{
				var tlen=0
				tlen=document.frmReg.m_state.value.length
				for (i = 0; i < tlen; i++) 
				{
					if (IsNumeric(document.frmReg.m_state.value.charAt(i))==true)
					{
						alert("Number is not allowed for state.")
						document.frmReg.m_state.select();
						return false	
					}
				}
				}
				if(document.frmReg.m_country.selectedIndex <= 0)
				{
					//msg=msg + "Country cannot be blank\n";									
					alert("Country cannot be blank\n");
					document.frmReg.m_country.focus();
					return false
				}
				if(document.frmReg.m_zip.value == "")				
				{
					//msg=msg + "Zip/Postal code cannot be left blank\n";									
					alert("Zip/Postal code cannot be left blank\n");
					document.frmReg.m_zip.select();
					return false
				}
				
				if(valid_email(document.frmReg.m_email.value))
				{
					//msg=msg + "Invalid Email Id \n";
					alert("Invalid Email Id \n");
					document.frmReg.m_email.select();
					return false
				}
				
				if (document.frmReg.m_phone.value == ""){
				    alert("Phone Number cannot be left blank\n");
				    document.frmReg.m_phone.focus();
				    return false;
				}
				document.frmReg.frmAction.value = "update";
				document.frmReg.submit();
			}	
			
			function clientfunction1()
			{
				var msg=""
				var tlen=0
				
				if((document.frmReg.m_hintque.selectedIndex <= 0))				
				{
					//msg=msg + "Hint question cannot be left blank\n";
					alert("Hint question cannot be left blank\n");
					document.frmReg.m_hintque.focus();
					return false					
				}
								
									
				if(document.frmReg.m_hintans.value == "")
				{
					//msg=msg + "Hint answer cannot be left blank\n";
					alert("Hint answer cannot be left blank\n");
					document.frmReg.m_hintans.focus();
					return false
				}
				
				if(document.frmReg.m_fname.value == "")				
				{
					//msg=msg + "Firstname cannot be left blank\n";					
					alert("Firstname cannot be left blank\n");
					document.frmReg.m_fname.select();
					return false
				}
				if(document.frmReg.m_lname.value == "")				
				{
					//msg=msg + "Lastname cannot be left blank\n";					
					alert("Lastname cannot be left blank\n");
					document.frmReg.m_lname.select();
					return false
				}
				if (checkPositiveInteger(document.frmReg.m_age.value))
				{
					//msg=msg + "Invalid Age entered\n";					
					alert("Invalid Age entered\n");
					document.frmReg.m_age.select();
					return false
				}
				
				if(document.frmReg.m_address.value == "")				
				{
					//msg=msg + "Address cannot be left blank\n";					
					alert("Address cannot be left blank\n");
					document.frmReg.m_address.select();
					return false
				}
				if(document.frmReg.m_city.value.charAt(0) == " ")				
				{
					var tlen=0
					tlen=document.frmReg.m_city.value.length
					if(tlen==1)
					{
					alert("City cannot be left blank\n");
					document.frmReg.m_city.select();
					return false
					}
				}
				if(document.frmReg.m_city.value == "")				
				{
					//msg=msg + "City cannot be left blank\n";				
					alert("City cannot be left blank\n");
					document.frmReg.m_city.select();
					return false
				}
				else
				{
				var tlen=0
				tlen=document.frmReg.m_city.value.length
				for (i = 0; i < tlen; i++) 
				{
					if (IsNumeric(document.frmReg.m_city.value.charAt(i))==true)
					{
						alert("Number is not allowed for city.")
						document.frmReg.m_city.select();
						return false	
					}
				}
				}
				if(document.frmReg.m_state.value.charAt(0) == " ")				
				{
					var tlen=0
					tlen=document.frmReg.m_state.value.length
					if(tlen==1)
					{
					alert("State/County cannot be left blank\n");
					document.frmReg.m_state.select();
					return false
					}
				}
				if(document.frmReg.m_state.value == "")				
				{
					alert("State/County cannot be left blank\n");
					document.frmReg.m_state.select();
					return false
				}
				else
				{
				var tlen=0
				tlen=document.frmReg.m_state.value.length
				for (i = 0; i < tlen; i++) 
				{
					if (IsNumeric(document.frmReg.m_state.value.charAt(i))==true)
					{
						alert("Number is not allowed for state.")
						document.frmReg.m_state.select();
						return false	
					}
				}
				}
				if(document.frmReg.m_country.selectedIndex <= 0)
				{
					//msg=msg + "Country cannot be blank\n";									
					alert("Country cannot be blank\n");
					document.frmReg.m_country.focus();
					return false
				}
				if(document.frmReg.m_zip.value == "")				
				{
					//msg=msg + "Zip/Postal code cannot be left blank\n";									
					alert("Zip/Postal code cannot be left blank\n");
					document.frmReg.m_zip.select();
					return false
				}
				
				if(valid_email(document.frmReg.m_email.value))
				{
					//msg=msg + "Invalid Email Id \n";
					alert("Invalid Email Id \n");
					document.frmReg.m_email.select();
					return false
				}
				
				if (document.frmReg.m_phone.value == ""){
				    alert("Phone Number cannot be left blank\n");
				    document.frmReg.m_phone.focus();
				    return false;
				}
				document.frmReg.frmAction.value = "update";
				document.frmReg.submit();
			}	
			
			function checkPositiveInteger(val)
			{			
				if (isNaN(val)==true)
				{
					return true;
				}
				var mystring=new String(val)
				var x=mystring.indexOf(".")
				if (x!="-1")
				{
					return true;
				}
				if (val<0)
				{
					return true;
				}    
			}
	
			function valid_email(eml)
			{
				//declare the required variables
				var mint_len;
				var mstr_eml=eml;
				var mint_at=0;
				var mint_atnum=0;
				var mint_dot=0;
				var mint_dotnum=0;
				
				mint_len=eml.length; //takes the length of the email address entered
				
				//checking for the symbol single quote. If found replace it with its html code
				if (mstr_eml.indexOf("'")!=-1)
				{
					mstr_eml=mstr_eml.replace("'","&#39;");
				}
				
				//checking for the (@) & (.) symbol
				for(var iloop=0;iloop<mint_len;iloop++)
				{
					if(mstr_eml.charAt(iloop)=="@")
					{
						mint_at=iloop+1;
						mint_atnum=mint_atnum+1;
					}
					if(mstr_eml.charAt(iloop)==".")
					{
						mint_dot=iloop+1;
						mint_dotnum=mint_dotnum+1;
					}
				}
				
				//if nothing entered in the field
				if (mstr_eml=="")
				{
					return true;
				}
				
				//if @ entered more than once & dot (.) entered more than 4 times
				else if((mint_atnum!=1)||(mint_dotnum>4)||((mint_dot-mint_at)<2)||((mint_len-mint_dot)<2)||(mint_at<3))
				{
					return true;
				}
				
				//if any blank space is entered in the email address
				else if (mstr_eml.indexOf(" ")!=-1)
				{
					return true;
				}
				return false;
			}

			
			function openWin(url){
				var openTermWin = open(url,"termWin","top=0,left=0,height=200,width=300,scrollbars=yes,maximize=yes")
				openTermWin.focus()
			}
			
function IsNumeric(sText)
{
  var ValidChars = "0123456789";
  var Char;
  Char = sText;
  if (ValidChars.indexOf(Char) == -1) 
    {
		return false;
	}
   else
   {
		return true;
   }
}


	



function funMoreInfo(str)
{
	
	var myWin = window.open("moreinfo.aspx?id="+str,"MoreInfo","toolbars=no,scrollbars=yes,width=710,height=530,left=10,top,3")
	myWin.focus()
}	



function newsKeyPress(){
				if (event.keyCode == 13){
					return enterSubscribe()
				}
			}
			
			function enterSubscribe(){
				if(document.frmMain.txtSubscribeNews.value==""){
					alert("Please enter an Email Id to subscribe for Newsletter.")
					return false
				}
				else
				{
					if(valid_email(document.frmMain.txtSubscribeNews.value))
					{				
						alert("Invalid Email Id \n");
						document.frmMain.txtSubscribeNews.select();
						return false
					}				
				}				
				return true			
			}
			
			function valid_email(eml)
			{
				//declare the required variables
				var mint_len;
				var mstr_eml=eml;
				var mint_at=0;
				var mint_atnum=0;
				var mint_dot=0;
				var mint_dotnum=0;
				
				mint_len=eml.length; //takes the length of the email address entered
				
				//checking for the symbol single quote. If found replace it with its html code
				if (mstr_eml.indexOf("'")!=-1)
				{
					mstr_eml=mstr_eml.replace("'","&#39;");
				}
				
				//checking for the (@) & (.) symbol
				for(var iloop=0;iloop<mint_len;iloop++)
				{
					if(mstr_eml.charAt(iloop)=="@")
					{
						mint_at=iloop+1;
						mint_atnum=mint_atnum+1;
					}
					if(mstr_eml.charAt(iloop)==".")
					{
						mint_dot=iloop+1;
						mint_dotnum=mint_dotnum+1;
					}
				}
				
				//if nothing entered in the field
				if (mstr_eml=="")
				{
					return true;
				}
				
				//if @ entered more than once & dot (.) entered more than 4 times
				else if((mint_atnum!=1)||(mint_dotnum>4)||((mint_dot-mint_at)<2)||((mint_len-mint_dot)<2)||(mint_at<3))
				{
					return true;
				}
				
				//if any blank space is entered in the email address
				else if (mstr_eml.indexOf(" ")!=-1)
				{
					return true;
				}
				return false;
			}
			
			//-->
          	function shippingdetails()
          	{
          	          	
			//window.open("shippingpopup.aspx","Shipping Details","toolbars=no,scrollbars=yes,width=710,height=530,left=10,top,3")
			newWindow = window.open("secure_shopping.html","newWin","width=460,height=450,scrollbars=yes");
			//var myWin = window.open("secure_shopping.htm","Secure Shopping","toolbars=no,scrollbars=yes,width=710,height=530,left=10,top,3")
			//myWin.focus()
			return false;
          	
          	} 
		
function checkOut()
{
	document.forms[0].action="showOrder.php";
	document.forms[0].submit();
}

function populateShipping()
{
	document.orderForm.ship_fname.value = document.orderForm.bill_fname.value;
	document.orderForm.ship_lname.value = document.orderForm.bill_lname.value;
	document.orderForm.ship_address.value = document.orderForm.bill_address.value;
	document.orderForm.ship_city.value = document.orderForm.bill_city.value;
	document.orderForm.ship_state.value = document.orderForm.bill_state.value;
	document.orderForm.ship_zip.value = document.orderForm.bill_zip.value;
	document.orderForm.ship_country.value = document.orderForm.bill_country.value;
	document.orderForm.ship_phone.value = document.orderForm.bill_phone.value;
	document.orderForm.ship_email.value = document.orderForm.bill_email.value;
}

function valOrderForm(toDo)
 {
	bill_firstname = trimSpaces(document.orderForm.bill_fname.value);
	bill_lastname = trimSpaces(document.orderForm.bill_lname.value);
    bill_address = trimSpaces(document.orderForm.bill_address.value);
	bill_city = trimSpaces(document.orderForm.bill_city.value);
	bill_state = trimSpaces(document.orderForm.bill_state.value);
	bill_zip = trimSpaces(document.orderForm.bill_zip.value);
	bill_phone = trimSpaces(document.orderForm.bill_phone.value);
	bill_email = trimSpaces(document.orderForm.bill_email.value);
	
	ship_firstname = trimSpaces(document.orderForm.ship_fname.value);
	ship_lastname = trimSpaces(document.orderForm.ship_lname.value);
	ship_address = trimSpaces(document.orderForm.ship_address.value);
	ship_city = trimSpaces(document.orderForm.ship_city.value);
	ship_state = trimSpaces(document.orderForm.ship_state.value);
	ship_zip = trimSpaces(document.orderForm.ship_zip.value);
	ship_phone = trimSpaces(document.orderForm.ship_phone.value);
	ship_email = trimSpaces(document.orderForm.ship_email.value);

	
	if(bill_firstname.length <= 0) {
		alert("Please enter First name");
		document.orderForm.bill_fname.focus();
		return false;
	}
	
	if(bill_lastname.length <= 0) {
		alert("Please enter Last name");
		document.orderForm.bill_lname.focus();
		return false;
	}
	
	
	if(bill_address.length <= 0) {
		alert("Please enter Address");
		document.orderForm.bill_address.focus();
		return false;
	}
	
	if(bill_city.length <= 0) {
		alert("Please enter City");
		document.orderForm.bill_city.focus();
		return false;
	}
	
	if(bill_state.length <= 0) {
		alert("Please enter State");
		document.orderForm.bill_state.focus();
		return false;
	}
	
	
	if(bill_zip.length <= 0) {
		alert("Please enter zip");
		document.orderForm.bill_zip.focus();
		return false;
	}
		
	if(bill_phone.length <= 0) {
		alert("Please enter Phone no.");
		document.orderForm.bill_phone.focus();
		return false;
	}
	
	if(bill_email.length<=0){
			  alert("Please enter emailID");
			  document.orderForm.bill_email.focus();
			  return false;
	}else{
		   if(!checkEmail(document.orderForm.bill_email.value))
		    {
			 document.orderForm.bill_email.focus();
			return false;
		   }
	}
	
		if(ship_firstname.length <= 0) {
		alert("Please enter First name");
		document.orderForm.ship_fname.focus();
		return false;
	}
	
	if(ship_lastname.length <= 0) {
		alert("Please enter Last name");
		document.orderForm.ship_lname.focus();
		return false;
	}
	
	if(ship_address.length <= 0) {
		alert("Please enter Address");
		document.orderForm.ship_address.focus();
		return false;
	}
	
	if(ship_city.length <= 0) {
		alert("Please enter City");
		document.orderForm.ship_city.focus();
		return false;
	}
	
	if(ship_state.length <= 0) {
		alert("Please enter State");
		document.orderForm.ship_state.focus();
		return false;
	}
	
	if(ship_zip.length <= 0) {
		alert("Please enter zip");
		document.orderForm.ship_zip.focus();
		return false;
	}
		
	if(ship_phone.length <= 0) {
		alert("Please enter Phone no.");
		document.orderForm.ship_phone.focus();
		return false;
	}
	if(ship_email.length<=0){
			  alert("Please enter emailID");
			  document.orderForm.ship_email.focus();
			  return false;
	}else{
		   if(!checkEmail(document.orderForm.ship_email.value))
		    {
			document.orderForm.ship_email.focus();
			return false;
		   }
	}
	
	if (toDo == "update")
	{
	document.orderForm.frmAction.value = toDo;
	}
	else if (toDo == "Preview")
	{
	document.orderForm.action = "previewOrder.php";
	document.orderForm.target = "Photos";
	document.orderForm.submit();	
	}
}	

function chkReview()
{
	title	= trimSpaces(document.frmReview.mr_title.value);
	review	= trimSpaces(document.frmReview.mr_review.value);
	if (title.length <= 0) {
		alert("Please enter a review title.");
		document.frmReview.mr_title.focus();
		return false;
	}
	if (review.length <= 0) {
		alert("Please enter a review.");
		document.frmReview.mr_review.focus();
		return false;
	}
	document.frmReview.frmAction.value = "update";
	document.frmReview.submit();
}
function checkFeedBack() {
	document.feedback.visitorName.value = trimSpaces(document.feedback.visitorName.value);
	if(document.feedback.visitorName.value.length <= 0) {
		alert("Please enter your name");
		document.feedback.visitorName.focus();
		return false;
	}

	document.feedback.emailAddress.value = trimSpaces(document.feedback.emailAddress.value);
	if(document.feedback.emailAddress.value.length <= 0) {
		alert("Please enter your email address");
		document.feedback.emailAddress.focus();
		return false;
	}
	if(!checkEmail(document.feedback.emailAddress.value)) {
		document.feedback.emailAddress.focus();
		document.feedback.emailAddress.select();
		return false;
	}

	document.feedback.visitorComments.value = trimSpaces(document.feedback.visitorComments.value);
	if(document.feedback.visitorComments.value.length <= 0) {
		alert("Please enter your comments");
		document.feedback.visitorComments.focus();
		return false;
	}
	document.feedback.frmAction.value = "update";
}
function checkContactus() {
	document.feedback.firstName.value = trimSpaces(document.feedback.firstName.value);
	if(document.feedback.firstName.value.length <= 0) {
		alert("Please enter your first name");
		document.feedback.firstName.focus();
		return false;
	}
	document.feedback.lastName.value = trimSpaces(document.feedback.lastName.value);
	if(document.feedback.lastName.value.length <= 0) {
		alert("Please enter your last name");
		document.feedback.lastName.focus();
		return false;
	}

	document.feedback.email.value = trimSpaces(document.feedback.email.value);
	if(document.feedback.email.value.length <= 0) {
		alert("Please enter your email address");
		document.feedback.email.focus();
		return false;
	}
	if(!checkEmail(document.feedback.email.value)) {
		document.feedback.email.focus();
		document.feedback.email.select();
		return false;
	}
	document.feedback.frmAction.value = "update";
}
function rowOverEffect(id) {
		
	switch(id){
	case "td1":
		td1.className = 'moduleRowOver';	
		td2.className = 'moduleRow';
		td3.className = 'moduleRow';
		td4.className = 'moduleRow';
		td5.className = 'moduleRow';
		td6.className = 'moduleRow';
		td7.className = 'moduleRow';
		td8.className = 'moduleRow';
		document.getElementById("td9").style.display="block";
		document.getElementById("td10").style.display="none";
		document.getElementById("td11").style.display="none";
		document.getElementById("td12").style.display="none";
		document.getElementById("td13").style.display="none";
		document.getElementById("td14").style.display="none";
		document.getElementById("td15").style.display="none";
		document.getElementById("td16").style.display="none";
		break
	case "td2":
		td1.className = 'moduleRow';	
		td2.className = 'moduleRowOver';
		td3.className = 'moduleRow';
		td4.className = 'moduleRow';
		td5.className = 'moduleRow';
		td6.className = 'moduleRow';
		td7.className = 'moduleRow';
		td8.className = 'moduleRow';
		document.getElementById("td9").style.display="none";
		document.getElementById("td10").style.display="block";
		document.getElementById("td11").style.display="none";
		document.getElementById("td12").style.display="none";
		document.getElementById("td13").style.display="none";
		document.getElementById("td14").style.display="none";
		document.getElementById("td15").style.display="none";
		document.getElementById("td16").style.display="none";
		break
	case "td3":
		td1.className = 'moduleRow';	
		td2.className = 'moduleRow';
		td3.className = 'moduleRowOver';
		td4.className = 'moduleRow';
		td5.className = 'moduleRow';
		td6.className = 'moduleRow';
		td7.className = 'moduleRow';
		td8.className = 'moduleRow';
		document.getElementById("td10").style.display="none";
		document.getElementById("td9").style.display="none";
		document.getElementById("td11").style.display="block";
		document.getElementById("td12").style.display="none";
		document.getElementById("td13").style.display="none";
		document.getElementById("td14").style.display="none";
		document.getElementById("td15").style.display="none";
		document.getElementById("td16").style.display="none";
		break
	case "td4":
		td1.className = 'moduleRow';	
		td2.className = 'moduleRow';
		td3.className = 'moduleRow';
		td4.className = 'moduleRowOver';
		td5.className = 'moduleRow';
		td6.className = 'moduleRow';
		td7.className = 'moduleRow';
		td8.className = 'moduleRow';
		document.getElementById("td9").style.display="none";
		document.getElementById("td10").style.display="none";
		document.getElementById("td11").style.display="none";
		document.getElementById("td12").style.display="block";
		document.getElementById("td13").style.display="none";
		document.getElementById("td14").style.display="none";
		document.getElementById("td15").style.display="none";
		document.getElementById("td16").style.display="none";
		break
	case "td5":
		td1.className = 'moduleRow';	
		td2.className = 'moduleRow';
		td3.className = 'moduleRow';
		td4.className = 'moduleRow';
		td5.className = 'moduleRowOver';
		td6.className = 'moduleRow';
		td7.className = 'moduleRow';
		td8.className = 'moduleRow';
		document.getElementById("td11").style.display="none";
		document.getElementById("td9").style.display="none";
		document.getElementById("td10").style.display="none";
		document.getElementById("td12").style.display="none";
		document.getElementById("td13").style.display="block";
		document.getElementById("td14").style.display="none";
		document.getElementById("td15").style.display="none";
		document.getElementById("td16").style.display="none";
		break
	case "td6":
		td1.className = 'moduleRow';	
		td2.className = 'moduleRow';
		td3.className = 'moduleRow';
		td4.className = 'moduleRow';
		td5.className = 'moduleRow';
		td6.className = 'moduleRowOver';
		td7.className = 'moduleRow';
		td8.className = 'moduleRow';
		document.getElementById("td9").style.display="none";
		document.getElementById("td10").style.display="none";
		document.getElementById("td11").style.display="none";
		document.getElementById("td12").style.display="none";
		document.getElementById("td13").style.display="none";
		document.getElementById("td14").style.display="block";
		document.getElementById("td15").style.display="none";
		document.getElementById("td16").style.display="none";
		break
	case "td7":
		td1.className = 'moduleRow';	
		td2.className = 'moduleRow';
		td3.className = 'moduleRow';
		td4.className = 'moduleRow';
		td5.className = 'moduleRow';
		td6.className = 'moduleRow';
		td7.className = 'moduleRowOver';
		td8.className = 'moduleRow';
		document.getElementById("td9").style.display="none";
		document.getElementById("td10").style.display="none";
		document.getElementById("td11").style.display="none";
		document.getElementById("td12").style.display="none";
		document.getElementById("td13").style.display="none";
		document.getElementById("td14").style.display="none";
		document.getElementById("td15").style.display="none";
		document.getElementById("td16").style.display="block";
		break
	case "td8":
		td1.className = 'moduleRow';	
		td2.className = 'moduleRow';
		td3.className = 'moduleRow';
		td4.className = 'moduleRow';
		td5.className = 'moduleRow';
		td6.className = 'moduleRow';
		td7.className = 'moduleRow';
		td8.className = 'moduleRowOver';
		document.getElementById("td9").style.display="none";
		document.getElementById("td10").style.display="none";
		document.getElementById("td11").style.display="none";
		document.getElementById("td12").style.display="none";
		document.getElementById("td13").style.display="none";
		document.getElementById("td14").style.display="none";
		document.getElementById("td15").style.display="block";
		document.getElementById("td16").style.display="none";
	break
	}
}

function rowOutEffect(object) {
  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}

function validateDiscussion()
{
name=trimSpaces(document.discForm.name.value);
if(name.length<=0)
{
  alert("Please enter your name");
  document.discForm.name.focus();
   return false;
}

email=trimSpaces(document.discForm.email.value);
if(email.length<=0)
 {
  alert("Please enter your email");
  document.discForm.email.focus();
  return false;
 }
 else
 {
	 if(email.length>0)
	 {
		 if(!checkEmail(email))
		 {
		  document.discForm.email.focus();
		  return false;
		 }
	 }
  }
  
if(document.discForm.description.value.length<=0)
{
  alert("Please Enter your comments");
  document.discForm.description.focus();
   return false;
}
document.discForm.frmAction.value = "discussion";  
return true;
}

function markAsObjecction(forum_id,linkid,fid)
{
	if (!confirm("Do you really want to mark this entry \n as objectionable?"))
	return;
	else
	{
		window.location.href='../FilmDetails-'+linkid+'/Discussion.html?filmid='+fid+'&forum_id='+forum_id+'&frmAction=objection&val=dis&val1=';
	}
}

function validateRating()
{
	anySelected = 0;
	len = document.ratingForm.rating.length;
	for (i=0;i<len;i++)
	{
		if (document.ratingForm.rating[i].checked)	
		anySelected ++;
	}
	
	if (anySelected <=0)
	{
	alert("Please select your rating");
	return false;
	}
	else
	document.ratingForm.frmAction.value = "rating"
}

function checkVote() 
{ 
	count = document.poll.poll_option_id.length;  
	pollSelect = false;
	for(i = 0; i < count; ++i) {
		if(document.poll.poll_option_id[i].checked) {
			pollSelect = true; 
			break;
		}
	}
	if(!pollSelect) {
		alert("Select an answer to vote");
		return false;
	}
	document.poll.action ='index.php';
	document.poll.frmAction.value = 'Vote'; 
	//document.poll.submit(); 
}

function searchClicked(frm){
	words = trimSpaces(document.searchForm.keywords.value);
	if(words.length <= 0){
		alert("Please enter keyword");
		document.searchForm.keywords.focus();
		return false;
	}else{
		if(frm=="h")
			document.searchForm.action="SearchResults-0/Search.html";
		if(frm=="s")
			document.searchForm.action="../SearchResults-0/Search.html"; 
	}
}
function ChkReg(f){
	
	userreg.first_name.value = trimSpaces(userreg.first_name.value);
	if(userreg.first_name.value.length <= 0) {
		alert("Please enter your first name");
		userreg.first_name.focus();
		return false;
	}
	userreg.last_name.value = trimSpaces(userreg.last_name.value);
	if(userreg.last_name.value.length <= 0) {
		alert("Please enter your last name");
		userreg.last_name.focus();
		return false;
	}
	userreg.email.value = trimSpaces(userreg.email.value);
	if(!checkEmail(userreg.email.value)) {
		userreg.email.focus();
		return false;
	}
	
	userreg.city.value = trimSpaces(userreg.city.value);
	if(userreg.city.value.length <= 0) {
		alert("Please enter your city");
		userreg.city.focus();
		return false;
	}
	if(trimSpaces(userreg.birth_mon.options[userreg.birth_mon.selectedIndex].value).length <= 0) 
	{
		alert("Please select the birth month");
		userreg.birth_mon.focus();
		return false;
	}	
	if(trimSpaces(userreg.birth_year.options[userreg.birth_year.selectedIndex].value).length <= 0) 
	{
		alert("Please select the birth year");
		userreg.birth_year.focus();
		return false;
	}

	document.userreg.frmAction.value = "register";
	document.userreg.submit();
}

function chkuserlogin(toDo,linkid,f)
{	
	switch(linkid){
		case 6:
			if(!checkGB(f))
				return false;
			break;
		case 25:
			if(!checkGB(f))
				return false;
			break;
		case 15:
			if(!validateDiscussion())
				return false;
			break;
	}
	if(toDo=="add")
	{	
		if(f.username.value=="")
		{
		alert("Enter Email address");
		f.username.focus();
		return false;
		}
	
		if(f.password.value=="")
		{
		alert("Enter password");
		f.password.focus();
		return false;
		
   		}
	}
	f.frmAction.value = "login";
	f.submit();	
}
	
function Login(f){
	f.username.value = trimSpaces(f.username.value);
	if(!checkEmail(f.username.value)) {
		f.username.focus();
		return false;
	}
	f.password.value = trimSpaces(f.password.value);
	if(f.password.value.length <= 0) {
		alert("Please enter your login password");
		f.password.focus();
		return false;
	}
	
}
function checkGB(f) {
	f.visitorName.value = trimSpaces(f.visitorName.value);
	if(f.visitorName.value.length <= 0) {
		alert("Please enter your name");
		f.visitorName.focus();
		return false;
	}

	f.emailAddress.value = trimSpaces(f.emailAddress.value);
	if(f.emailAddress.value.length <= 0) {
		alert("Please enter your email address");
		f.emailAddress.focus();
		return false;
	}
	if(!checkEmail(f.emailAddress.value)) {
		f.emailAddress.select();
		return false;
	}

	f.visitorComments.value = trimSpaces(f.visitorComments.value);
	if(f.visitorComments.value.length <= 0) {
		alert("Please enter your comments");
		f.visitorComments.focus();
		return false;
	}
	
	if(f.thecode.value==""){
		alert("The verification number must be entered as in the above image");
		f.thecode.select();
		return false;
	}
	f.frmAction.value = "update";
	return true;
}