function goNext()

{

	page = parseInt(document.forms[1].page.value) + 1 

	document.forms[1].page.value = page;

	document.forms[1].submit();

}

// function to go previous page

function goPrevious()

{

	document.forms[1].page.value = document.forms[1].page.value - 1;

	i1=parseInt(document.forms[1].i1.value);

	i1=i1+5;

	document.forms[1].i.value = document.forms[1].i.value - i1;

	document.forms[1].submit();

}

function closeWindow() {

	parent.window.opener.window.focus();

	parent.window.close();

}



function openCustWindow(href,winWidth,winHeight) {

	sWidth = screen.availWidth;

	sHeight = screen.availHeight;

	

	sLeft = (sWidth - winWidth) / 2;

	sTop = (sHeight - winHeight) / 2;



	window.open(href, "tellAFriend", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=yes,resizable=0");

	return;

}



function printWindow() {

	parent.mainFrame.focus();

	window.print(parent.mainFrame);

}

function checkSearch() {

	document.forms[0].searchKey.value = trimSpaces(document.forms[0].searchKey.value);

	if(document.forms[0].searchKey.value.length <= 0) {

		alert("Please enter searchKey");

		document.forms[0].searchKey.focus();

		return false;

	}

	document.forms[0].searchSt.value='search';



}

function checkSubscription(action)

{



 if(action=="sub")

  {

	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].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].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();

 }

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

		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 checkRegistration() {

	

	for (var i=0; i < document.forms[0].q.length; i++)

   {

   if (document.forms[0].q[i].checked)

      {

      var rad_val = document.forms[0].q[i].value;

      }

   }

	email = trimSpaces(document.forms[0].username.value);

	if (email.length <= 0) {

		  alert("Please enter emailID");

		  document.forms[0].username.focus();

		  return false;

	} else {

		if (!checkEmail(document.forms[0].username.value)) {

			document.forms[0].username.focus();

			return false;

		}

	}

	pwd = trimSpaces(document.forms[0].pwd.value);

	if (pwd.length <= 0) {

		alert("Please enter password");

		document.forms[0].pwd.focus();

		return false;

	} else if (pwd.length < 6) {

		alert("Please make sure that the password field has atleast 6 characters");

		document.forms[0].pwd.focus();

		return false;

	} 

	if (checkAllowedChars(pwd,'AN_') == false){

		alert("Please make sure that the password field has atleast 2 digits & 4 alphabets");

		document.forms[0].pwd.focus();

		return false;

	}

	cpwd = trimSpaces(document.forms[0].cpwd.value);

	if (cpwd.length <= 0) {

		alert("Please re-enter password");

		document.forms[0].cpwd.focus();

		return false;

	} else if (cpwd != pwd) {

		alert("Your confirmed Password is not matching with previously entered Password");

		document.forms[0].cpwd.focus();

		return false;

	}



	fname = trimSpaces(document.forms[0].fname.value);

	lname = trimSpaces(document.forms[0].lname.value);

	/*month = trimSpaces(document.forms[0].month.value);

	day = trimSpaces(document.forms[0].day.value);

	year = trimSpaces(document.forms[0].year.value);

	if (month != "00" || day != "00" || year != "Year"){

		if(month == "00" || day == "00" || year == "Year"){

			alert("Please enter the date correctly");

		 	document.forms[0].month.focus();

		 	return false;

		}

		if (isNaN(year) || year <= 1000) {

			alert("please enter the year properly\n Format : XXXX (eg:2001)");

			document.forms[0].year.focus();

			return false; 

		}

	}*/

	address = trimSpaces(document.forms[0].address1.value);

	city = trimSpaces(document.forms[0].city.value);

	zip = trimSpaces(document.forms[0].zip.value);

	/*phone = trimSpaces(document.forms[0].phone1_A.value);*/

	state = trimSpaces(document.forms[0].state.value);

	state1 = trimSpaces(document.forms[0].state1.value);









	if (fname.length <= 0) {

		alert("Enter your first name");

	  	document.forms[0].fname.focus();

	   	return false;

	}

	if (lname.length <= 0) {

	  	alert("Enter your last name");

	  	document.forms[0].lname.focus();

	   	return false;

	}

	if (address.length <= 0) {

	  	alert("Enter your address");

	  	document.forms[0].address1.focus();

	   	return false;

	}

	



	if (city.length <= 0) {

	  	alert("Enter your city");

	  	document.forms[0].city.focus();

	   	return false;

	}

	if (zip.length <= 0) {

	  	alert("Enter your Zip Code");

	  	document.forms[0].zip.focus();

	   	return false;

	}

	/*if (phone.length <= 0) {

	  	alert("Enter your phone number");

	  	document.forms[0].phone1_A.focus();

	   	return false;

	}*/

		if (rad_val=="N") {

	  	alert("To continue further it is required that you read our terms and conditions and agree with them.");

	   	return false;

	}

	document.forms[0].frmAction.value="update";

	return true;

}

function emailSubcription() {

	fname = trimSpaces(document.forms[0].fname.value);

	lname = trimSpaces(document.forms[0].lname.value);

	month = trimSpaces(document.forms[0].month.value);

	day = trimSpaces(document.forms[0].day.value);

	year = trimSpaces(document.forms[0].year.value);



	

	//address = trimSpaces(document.forms[0].address1.value);

	city = trimSpaces(document.forms[0].city.value);

///	zip = trimSpaces(document.forms[0].zip.value);

//	phone = trimSpaces(document.forms[0].phone1_A.value);

	state = trimSpaces(document.forms[0].state.value);

	state1 = trimSpaces(document.forms[0].state1.value);









	if (fname.length <= 0) {

		alert("Enter your first name");

	  	document.forms[0].fname.focus();

	   	return false;

	}

	if (lname.length <= 0) {

	  	alert("Enter your last name");

	  	document.forms[0].lname.focus();

	   	return false;

	}

	email = trimSpaces(document.forms[0].email.value);

	if (email.length <= 0) {

		  alert("Please enter emailID");

		  document.forms[0].email.focus();

		  return false;

	} else {

		if (!checkEmail(document.forms[0].email.value)) {

			document.forms[0].email.focus();

			return false;

		}

	}

		if (month != "00" || day != "00" || year != "Year"){

		if(month == "00" || day == "00" || year == "Year"){

			alert("Please enter the date correctly");

		 	document.forms[0].month.focus();

		 	return false;

		}

		if (isNaN(year) || year <= 1000) {

			alert("please enter the year properly\n Format : XXXX (eg:2001)");

			document.forms[0].year.focus();

			return false; 

		}

	}

//	if (address.length <= 0) {

	 // 	alert("Enter your address");

	  //	document.forms[0].address1.focus();

	  // 	return false;

	//}

		if (city.length <= 0) {

	  	alert("Enter your city");

	  	document.forms[0].city.focus();

	   	return false;

	}

		if (state.length <= 0 && state1.length <= 0 ) {

	  	alert("Enter State");

	  	document.forms[0].state.focus();

	   	return false;

	}





	//if (zip.length <= 0) {

	  //	alert("Enter your Zip Code");

	 //	document.forms[0].zip.focus();

	 //  	return false;

	//}

	//if (phone.length <= 0) {

	  //	alert("Enter your phone number");

	  //	document.forms[0].phone1_A.focus();

	  // 	return false;

	//}



	document.forms[0].frmAction.value="update";

	return true;

}



function verifyLogin1() {

	password = trimSpaces(document.forms[0].password.value);

	if (password.length <= 0) {

		alert("Please enter password");

		document.forms[0].password.focus();

		return false;

	}

	document.forms[0].frmAction.value = 'chklogin';

	document.forms[0].submit();

	return true;

}

function verifyLogin() {

	uname = trimSpaces(document.forms[0].uname.value);

	if (uname.length <= 0) {

		alert("Please enter emailID");

		document.forms[0].uname.focus();

		return false;

	} else {

		if (!checkEmail(document.forms[0].uname.value)) {

			document.forms[0].uname.focus();

			return false;

		}

	}

	password = trimSpaces(document.forms[0].password.value);

	if (password.length <= 0) {

		alert("Please enter password");

		document.forms[0].password.focus();

		return false;

	}

	document.forms[0].frmAction.value = 'chklogin';

	document.forms[0].submit();

	return true;

}

function emailLogin() {

	firstName = trimSpaces(document.emailsi.firstName.value);

	if (firstName.length <= 0) {

		alert("Please enter First Name");

		document.emailsi.firstName.focus();

		return false;

	}

	emailS = trimSpaces(document.emailsi.emailS.value);

	if (emailS.length <= 0) {

		alert("Please enter emailID");

		document.emailsi.emailS.focus();

		return false;

	} else {

		if (!checkEmail(document.emailsi.emailS.value)) {

			document.emailsi.emailS.focus();

			return false;

		}

	}

	

	document.emailsi.frmAction1.value = 'chklogin';

	document.emailsi.submit();

	return true;

}

function showWindow(id) {

	sWidth = screen.availWidth;

	sHeight = screen.availHeight;

	

	winWidth = 450;

	winHeight = 400;

	

	sLeft = (sWidth - winWidth) / 2;

	sTop = (sHeight - winHeight) / 2;

	

	window.open("showDetails.php#"+id,"Help","width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");

}

function showPresentation(pagepath) {

	sWidth = screen.availWidth;

	sHeight = screen.availHeight;

	

	winWidth = 650;

	winHeight = 450;

	

	sLeft = (sWidth - winWidth) / 2;

	sTop = (sHeight - winHeight) / 2;

	

	window.open(pagepath,"Help","width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");

}

function checkQuiz(count)

{

	rowSelected = new Array();

	for (i = 1; i <= parseInt(count) ; i++) {

		rowSelected[i] = false;

		for(itemCount = 0; itemCount < document.forms[0].elements["hqo_id"+i+"[]"].length; itemCount++) {

			if(document.forms[0].elements["hqo_id"+i+"[]"][itemCount].checked) {

				rowSelected[i] = true;

			}

		}

	}

	for (i = 1 ; i <= count; i++) {

		if(!rowSelected[i]) {

			alert("Please answer all the questions");

			return false;

		}

	}

	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 = 0}

	window.open(url,window_name,"width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=" + fscroll + ",resizable=0");

}

function addfav()

{

   if (document.all) {

      	window.external.AddFavorite("http://www.mydiseasemanagement.com","Diseasemanagement")

   }

}

function checkOut()

{

	document.forms[0].action="showOrder.php";

	document.forms[0].submit();

}



function checkState()

{

	if (document.forms[0].ship_state.options[document.forms[0].ship_state.selectedIndex].value == "New York")

	alert("An additional service tax of 8.625 % \nwill be added for delivery in New York")

	document.forms[0].target="";

	document.forms[0].action="showOrder.php";

	document.forms[0].submit();

}



function checkState1()

{

	if (document.forms[0].doSame.checked)

	{

		if (document.forms[0].bill_state.options[document.forms[0].bill_state.selectedIndex].value == "New York")

		{

			alert("An additional service tax of 8.625 % \nwill be added for delivery in New York")

			document.forms[0].submit();

		}

	}

}



function populateShipping()

{

	document.forms[0].ship_fname.value = document.forms[0].bill_fname.value;

	document.forms[0].ship_lname.value = document.forms[0].bill_lname.value;

	document.forms[0].ship_address.value = document.forms[0].bill_address.value;

	document.forms[0].ship_city.value = document.forms[0].bill_city.value;

	document.forms[0].ship_state.value = document.forms[0].bill_state.value;

	document.forms[0].ship_zip.value = document.forms[0].bill_zip.value;

	document.forms[0].ship_country.value = document.forms[0].bill_country.value;

	document.forms[0].ship_phone.value = document.forms[0].bill_phone.value;

	document.forms[0].ship_email.value = document.forms[0].bill_email.value;

}



function valOrderForm(toDo)

 {

	bill_firstname = trimSpaces(document.forms[0].bill_fname.value);

	bill_lastname = trimSpaces(document.forms[0].bill_lname.value);

    bill_address = trimSpaces(document.forms[0].bill_address.value);

	bill_city = trimSpaces(document.forms[0].bill_city.value);

	bill_state = trimSpaces(document.forms[0].bill_state.value);

	bill_zip = trimSpaces(document.forms[0].bill_zip.value);

	bill_phone = trimSpaces(document.forms[0].bill_phone.value);

	bill_email = trimSpaces(document.forms[0].bill_email.value);

	

	ship_firstname = trimSpaces(document.forms[0].ship_fname.value);

	ship_lastname = trimSpaces(document.forms[0].ship_lname.value);

	ship_address = trimSpaces(document.forms[0].ship_address.value);

	ship_city = trimSpaces(document.forms[0].ship_city.value);

	ship_state = trimSpaces(document.forms[0].ship_state.value);

	ship_zip = trimSpaces(document.forms[0].ship_zip.value);

	ship_phone = trimSpaces(document.forms[0].ship_phone.value);

	ship_email = trimSpaces(document.forms[0].ship_email.value);



	

	if(bill_firstname.length <= 0) {

		alert("Please enter First name");

		document.forms[0].bill_fname.focus();

		return false;

	}

	

	if(bill_lastname.length <= 0) {

		alert("Please enter Last name");

		document.forms[0].bill_lname.focus();

		return false;

	}

	

	

	if(bill_address.length <= 0) {

		alert("Please enter Address");

		document.forms[0].bill_address.focus();

		return false;

	}

	

	if(bill_city.length <= 0) {

		alert("Please enter City");

		document.forms[0].bill_city.focus();

		return false;

	}

	

	if(bill_state.length <= 0) {

		alert("Please enter State");

		document.forms[0].bill_state.focus();

		return false;

	}

	

	

	if(bill_zip.length <= 0) {

		alert("Please enter zip");

		document.forms[0].bill_zip.focus();

		return false;

	}

		

	if(bill_phone.length <= 0) {

		alert("Please enter Phone no.");

		document.forms[0].bill_phone.focus();

		return false;

	}

	

	if(bill_email.length<=0){

			  alert("Please enter emailID");

			  document.forms[0].bill_email.focus();

			  return false;

	}else{

		   if(!checkEmail(document.forms[0].bill_email.value))

		    {

			 document.forms[0].bill_email.focus();

			return false;

		   }

	}

	

		if(ship_firstname.length <= 0) {

		alert("Please enter First name");

		document.forms[0].ship_fname.focus();

		return false;

	}

	

	if(ship_lastname.length <= 0) {

		alert("Please enter Last name");

		document.forms[0].ship_lname.focus();

		return false;

	}

	

	if(ship_address.length <= 0) {

		alert("Please enter Address");

		document.forms[0].ship_address.focus();

		return false;

	}

	

	if(ship_city.length <= 0) {

		alert("Please enter City");

		document.forms[0].ship_city.focus();

		return false;

	}

	

	if(ship_state.length <= 0) {

		alert("Please enter State");

		document.forms[0].ship_state.focus();

		return false;

	}

	

	if(ship_zip.length <= 0) {

		alert("Please enter zip");

		document.forms[0].ship_zip.focus();

		return false;

	}

		

	if(ship_phone.length <= 0) {

		alert("Please enter Phone no.");

		document.forms[0].ship_phone.focus();

		return false;

	}

	if(ship_email.length<=0){

			  alert("Please enter emailID");

			  document.forms[0].ship_email.focus();

			  return false;

	}else{

		   if(!checkEmail(document.forms[0].ship_email.value))

		    {

			document.forms[0].ship_email.focus();

			return false;

		   }

	}

	

	if (toDo == "update")

	{

	document.forms[0].frmAction.value = toDo;

	}

	else if (toDo == "Preview")

	{

	document.forms[0].action = "previewOrder.php";

	document.forms[0].target = "Photos";

	document.forms[0].submit();	

	}

}	



/* Note: The javascript statement "window.external.AddFavorite(..." should be a single line



The part in red color in the above code is the URL and the blue is the Name you want to give to the link.



The function can be placed inside the document head or an external .js file and will be called from the link as:



<A HREF="javascript:addfav()">Add To Favorites</A>



This creates a link like - Add To Favorites

<a href="javascript:window.external.addFavorite('http://www.website.com','Website Title');">

Click here to add the homepage to your favorites!</a>



*/
