// JavaScript Document

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

/*var message="Copyright MusicIndiaMovies.com";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")



/***********************************************
* Disable select-text script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//form tags to omit in NS6+:
/*var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}*/


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 false;
		}
		if (pass.length <= 0) {
			alert("Please enter a valid password");
			document.frmULogin1.m_password.focus();
			return false;
		}
		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";
	document.forms[0].submit();
}
}
function checkFeedBack() {
	document.forms[0].visitorName.value = trimSpaces(document.forms[0].visitorName.value);
	if(document.forms[0].visitorName.value.length <= 0) {
		alert("Please enter your name");
		document.forms[0].visitorName.focus();
		return false;
	}

	document.forms[0].emailAddress.value = trimSpaces(document.forms[0].emailAddress.value);
	if(document.forms[0].emailAddress.value.length <= 0) {
		alert("Please enter your email address");
		document.forms[0].emailAddress.focus();
		return false;
	}
	if(!checkEmail(document.forms[0].emailAddress.value)) {
		document.forms[0].emailAddress.focus();
		document.forms[0].emailAddress.select();
		return false;
	}

	document.forms[0].visitorComments.value = trimSpaces(document.forms[0].visitorComments.value);
	if(document.forms[0].visitorComments.value.length <= 0) {
		alert("Please enter your comments");
		document.forms[0].visitorComments.focus();
		return false;
	}
	document.forms[0].frmAction.value = "update";
}


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 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?section=view";
	document.forms[0].submit();
}

function populateShipping()
{
	if (document.orderForm.doSame.checked)
	{
	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.othship_state.value = document.orderForm.othbill_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);
	bill_country = document.orderForm.bill_country.options[document.orderForm.bill_country.selectedIndex].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);
	ship_country = document.orderForm.ship_country.options[document.orderForm.ship_country.selectedIndex].value;
	
	ship_type = document.orderForm.ship_type.options[document.orderForm.ship_type.selectedIndex].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_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_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(ship_type.length <= 0){
			alert("Please select the shipment type");
			document.orderForm.ship_type.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();	
	}//alert(document.orderForm.frmAction.value);
}	

function showShipType(js_shipmentArr,js_shipmentArr_index)
{
	country	=	document.orderForm.ship_country.options[document.orderForm.ship_country.selectedIndex].value;
	document.orderForm.ship_type.options.length=0;
	document.orderForm.ship_type.options[0]=new Option('Select', '', true, false);
	
	if (country == 'US'){
		for (i=1;i<=3;i++)
		{
		document.orderForm.ship_type.options[i]=new Option(js_shipmentArr[i],js_shipmentArr_index[i], true, false)	
		}
	}
	else
	{
		document.orderForm.ship_type.options[1]=new Option(js_shipmentArr[0],js_shipmentArr_index[0], true, false)	
	}
}

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 openMailWindow(id)
{
		var myWin = window.open("mailRequest.php?id="+id,"MailInfo","toolbars=no,scrollbars=yes,width=400,height=250,left=10,top,3")

}
function valUserEnquiry()
{
	name	= trimSpaces(document.forms[0].name.value);
	if (name.length <= 0) {
		alert("Please enter your name.");
		document.forms[0].name.focus();
		return false;
	}

	email	= trimSpaces(document.forms[0].email.value);
	if (email.length <= 0) {
		alert("Please enter your email.");
		document.forms[0].email.focus();
		return false;
	}
	else{
		   if(!checkEmail(document.forms[0].email.value))
		    {
			document.forms[0].email.focus();
			return false;
		   }
	}

	if (document.forms[0].comments.value == "") {
		alert("Please enter your comments.");
		document.forms[0].comments.focus();
		return false;
	}
	document.forms[0].frmAction.value = "update";
	document.forms[0].submit();
}
function openWindow(url,window_name,winWidth,winHeight,fscroll) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;

	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	
	if(fscroll == '') {fscroll = 1}
	window.open(url,window_name,"width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=" + fscroll + ",resizable=0");
}
function translator(pattern) {
	var open_in_same_window = 1;
	var my_location = unescape(document.location.toString());
	var new_location ='';
	var new_pattern = '';
	if (my_location.indexOf('translate_url_content?') != -1) {
		/// From google...
		var indexof_u = my_location.indexOf('trurl=');
		if (indexof_u == -1) {
			new_location = document.location;
		}
		else {
			var subs = my_location.substring(indexof_u, my_location.length);
			var ss = subs.split('&');
			new_location = ss[0].substring(2, ss[0].length);
			
			var indexof_url = new_location.indexOf('=url=');
			new_location=new_location.substring(indexof_url+5, new_location.length);
		}
	}
	else {
		new_location = document.location;
	}

	indexof_p = pattern.indexOf('|');

	var isen = '';
	if (indexof_p == -1) {
		indexof_p1 = pattern.indexOf('><');
		if (indexof_p1 == -1) {
			new_pattern = pattern;
			if (pattern == 'en') {
				isen = 1;
			}
		}
		else {
			var psplit =pattern.split('><');
			new_pattern = psplit[0]+'|'+psplit[1];
			if (psplit[1] == 'en') {
				isen = 1;
			}
		}
	}
	else {
		var psplit = pattern.split('|');
		new_pattern = psplit[0]+'|'+psplit[1];
		if (psplit[1] == 'en') {
			isen = 1;
		}
	}

	var thisurl = '';
	if (isen == 1) {
		thisurl = new_location;
	}
	else {
		//http://translate.google.com/translate?u=http%3A%2F%2Fwww.rediff.com&langpair=en%7Ces&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools
		//thisurl = 'http://translate.google.com/translate?hl='+psplit[0]+'&ie=UTF-8&oe=UTF-8&langpair='+psplit[0]+'%7C'+psplit[1]+'&u='+ new_location+'&prev=%2Flanguage_tools';
		thisurl = 'http://74.6.146.244/babelfish/translate_url_content?trurl='+new_location+'&lp='+psplit[0]+'_'+psplit[1];
	}

	if (open_in_same_window == 1) {
		window.location.href = thisurl;
	}
	else {
		if (CanAnimate ){
			msgWindow=window.open('' ,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
			msgWindow.focus();
			msgWindow.location.href = thisurl;
		}
		else {
			msgWindow=window.open(thisurl,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
		}
	}
}