function getvalue(optionval){

  if(optionval=="abhishek"){

              var list="<td align=left height=25>Pick up Location</td>";

              list+="<td align=left height=25>&nbsp;</td>";

              list+="<td align=left height=25>";

              list+="<select name=pickup style=width:130px;>";

              list+="<option value=Any>Any</option>";

              list+="<option value='Any Liquor Store'>Any Liquor Store</option>";

              list+="<option value='Any Grocery Store'>Any Grocery Store</option>";

              list+="<option value='Always Pizza'>Always Pizza</option>";

              list+="<option value='A&amp;W'>A &amp; W</option>";

              list+="<option value='Burger King'>Burger King</option>";

              list+="<option value='Boston Pizza'>Boston Pizza</option>";

              list+="<option value='Canadian Pizza Ultimate'>Canadian Pizza Ultimate</option>";

              list+="<option value='Chicago Deep Pizza'>Chicago Deep Pizza</option>";

              list+="<option value='Chinese Restaurent'>Chinese Restaurent</option>";

              list+="<option value='Glory Pizza'>Glory Pizza</option>";

              list+="<option value='Indian Restaurent'>Indian Restaurent</option>";

              list+="<option value='Macs Store'>Macs Store</option>";

              list+="<option value='Mcdonalds'>Mcdonalds</option>";

              list+="<option value='Royal Canadian Pizza'>Royal Canadian Pizza</option>";

              list+="<option value='Seven &amp; Eleven'>Seven &amp; Eleven</option>";

              list+="<option value='Taco Bell'>Taco Bell</option>";

              list+="<option value='Timhortons'>Timhortons</option>";

              list+="<option value='Wendys'>Wendys</option>";

              list+="</select></td>";

 

      document.getElementById("PICKUPFROM").innerHTML=list;

  }else{

      document.getElementById("PICKUPFROM").innerHTML='<td align=left height=25 valign=top>Pick up Location</td><td align=left height=25>&nbsp;</td><td><textarea name=pickup style=width:130px;></textarea></td>';

  }

}

	function ReadCookie(cookieName) {

		var theCookie=""+document.cookie;

		var ind=theCookie.indexOf(cookieName);

		if (ind==-1 || cookieName=="") return "";

			var ind1=theCookie.indexOf(';',ind);

		if (ind1==-1) ind1=theCookie.length;

			return unescape(theCookie.substring(ind+cookieName.length+1,ind1));

}





	function getDetails(tag){

	  var xmlhttp=null;

		xmldocument="";

		obj_div=document.getElementById("customer_details");

		obj_div.innerHTML="";

		                xmlhttp=getXmlHttpRequestObject();

                url1="customerinfo.php?btnaction="+tag;



                xmlhttp.open('POST',url1,true);

                xmlhttp.onreadystatechange = function(){

			if(xmlhttp.readyState!=4  || xmlhttp.status!=200){

				ShowLoading();

			}

                        if (xmlhttp.readyState == 4) {

                                if (xmlhttp.status == 200){

					HideLoading();

					xmldocument=xmlhttp.responseText;

					obj_div.innerHTML="";

					obj_div.innerHTML=xmldocument;

                                }

                        }

                };

                xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

                xmlhttp.send(null);

	}

	

	function submitdetails(name,email,contact,msg){

	var tag="detailsubmit_franchise";

    var xmlhttp=null;

		xmldocument="";

		obj_div=document.getElementById("customer_details");

		                xmlhttp=getXmlHttpRequestObject();

                url1="customerinfo.php?btnaction="+tag+"&name="+name+"&msg="+msg+"&email="+email+"&contact="+contact;

                //alert(url1);





                xmlhttp.open('POST',url1,true);

                xmlhttp.onreadystatechange = function(){

			if(xmlhttp.readyState!=4  || xmlhttp.status!=200){

				ShowLoading();

			}

                        if (xmlhttp.readyState == 4) {

                                if (xmlhttp.status == 200){

					HideLoading();

					xmldocument=xmlhttp.responseText;

					obj_div.innerHTML="";

					obj_div.innerHTML=xmldocument;

                                }

                        }

                };

                xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

                xmlhttp.send(null);



  

  }



	function odersubmit(order,fullname,email,contactno,hno,streat,city,state,zip,pickuplocation,paymethod){

	  var tag="ordersubmit";

    var xmlhttp=null;

		xmldocument="";

		obj_div=document.getElementById("customer_details");

		                xmlhttp=getXmlHttpRequestObject();

                url1="customerinfo.php?btnaction="+tag+"&order="+order+"&fullname="+fullname+"&email="+email+"&contactno="+contactno+"&hno="+hno+"&streat="+streat+"&city="+city+"&state="+state+"&zip="+zip+"&pickuplocation="+pickuplocation+"&paymethod="+paymethod;

                //alert(url1);





                xmlhttp.open('POST',url1,true);

                xmlhttp.onreadystatechange = function(){

			if(xmlhttp.readyState!=4  || xmlhttp.status!=200){

				ShowLoading();

			}

                        if (xmlhttp.readyState == 4) {

                                if (xmlhttp.status == 200){

					HideLoading();

					xmldocument=xmlhttp.responseText;

					obj_div.innerHTML="";

					obj_div.innerHTML=xmldocument;

                                }

                        }

                };

                xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

                xmlhttp.send(null);



  }



	function ShowLoading(){

		span_obj=document.getElementById("loading");



		main_div_obj=document.getElementById("transparent_div");

		main_div_obj.style.visibility="visible";

		span_obj.style.visibility="visible";

		document.body.style.cursor="wait";

	}



	function HideLoading(){

		span_obj=document.getElementById("loading");

		main_div_obj=document.getElementById("transparent_div");

		main_div_obj.style.visibility="hidden";

		span_obj.style.visibility="hidden";

		document.body.style.cursor="default";

	}



	function change_code(msg){

		if(msg==1){

	        	var message=confirm("Are you sure you want to Change the Activation Code?");

			var resetaction="resetActivationCode";

		}if(msg==2){

		        var message=confirm("Are you sure you want to Reset the LIVE Channel Access Code?");

			var resetaction="resetLiveChannelAccessCode";

		}if(msg==3){

		        var message=confirm("Are you sure you want to Reset the VOD Channel Access Code?");

			var resetaction="resetVodAccessCode";

		}if(msg==4){

		        var message=confirm("Are you sure you want to Reset the MOD Channel Access Code?");

			var resetaction="resetModAccessCode";

		}

		if(message){

			Access_code(resetaction);

		        return true;

		}else{

			alert("rejected"+resetaction);

	        	return false;

		}

	}











	function sendmessage(){

		var obj_stb=GetElement("stbid");

                stbid=obj_stb.value;

                var xmlhttp,sid;

                xmlhttp=null;

                xmldocument="";

                obj_div=GetElement("boxholder");

                sid=GetElement("sid").value;

                xmlhttp=getXmlHttpRequestObject();

                url1="customerinfo.php?btnaction=sendmessage&sid="+sid+"&stbid="+stbid;

                xmlhttp.open('POST',url1,true);

                xmlhttp.onreadystatechange = function(){

                        if(xmlhttp.readyState!=4  || xmlhttp.status!=200){

                                ShowLoading();

                        }

                        if (xmlhttp.readyState == 4) {

                                if (xmlhttp.status == 200){

                                        HideLoading();

                                        xmldocument=xmlhttp.responseText;

                                        obj_div.innerHTML="";

                                        obj_div.innerHTML=xmldocument;

                                }

                        }

                };

                xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

                xmlhttp.send(null);





	}



function submit_testimonial(){

		var name=document.getElementById("name").value;

		var email=document.getElementById("email").value;

		var message=document.getElementById("message").value;

		var str="";

	var flag="true";

      if (name== ""){

         str+="Please Fill Your Order.\n";

         flag="false";

      }

      

      if (email==""){

         str+="Please Enter Your Email.\n";

         flag="false";

      }

	  if (!emailFilter.test(email)){

         str+="Invalid Email Address.\n";

         flag="false";

      }

	  if (message==""){

         str+="Please Enter Your Name.\n";

         flag="false";

      }

	  if(str!="" || flag=="false"){

      	       alert(str);

      	       return false;

      }

		

		var tag="detailsubmit_testimonial";

    	var xmlhttp=null;

		xmldocument="";

		obj_div=document.getElementById("customer_details");

		                xmlhttp=getXmlHttpRequestObject();

                url1="customerinfo.php?btnaction="+tag+"&name="+name+"&msg="+message+"&email="+email;

                //alert(url1);

                xmlhttp.open('POST',url1,true);

                xmlhttp.onreadystatechange = function(){

			if(xmlhttp.readyState!=4  || xmlhttp.status!=200){

				ShowLoading();

			}

                        if (xmlhttp.readyState == 4) {

                                if (xmlhttp.status == 200){

					HideLoading();

					xmldocument=xmlhttp.responseText;

					obj_div.innerHTML="";

					obj_div.innerHTML=xmldocument;

                                }

                        }

                };

                xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

                xmlhttp.send(null);



  

		

	}





	function sendmailsms(){

		var customername=GetElement("c_name").value;

                var customermobile=GetElement("c_mob").value;

                var customermail=GetElement("c_email").value;

                var message=GetElement("c_message").value;

		var sendername="abhishek";

		var sendermail="uimabhishek@gmail.com";

		var subject="Message From Mybbtv CustomerCare";

		var admin_mail="info@mybbtv.com";

		var sendermobile="09702011571";

		var obj_stb=GetElement("stbid");

                stbid=obj_stb.value;

                var xmlhttp,sid;

                xmlhttp=null;

                xmldocument="";

                obj_div=GetElement("boxholder");

                sid=GetElement("sid").value;

                xmlhttp=getXmlHttpRequestObject();

                url1="customerinfo.php?btnaction=sendthemail&sid="+sid+"&stbid="+stbid+"&customername="+customername+"&customermobile="+customermobile+"&customermail="+customermail+"&message="+message+"&sendername="+sendername+"&sendermail="+sendermail+"&subject="+subject+"&admin_mail="+admin_mail+"&sendermobile="+sendermobile;

                xmlhttp.open('POST',url1,true);

                xmlhttp.onreadystatechange = function(){

                        if(xmlhttp.readyState!=4  || xmlhttp.status!=200){

                                ShowLoading();

                        }

                        if (xmlhttp.readyState == 4) {

                                if (xmlhttp.status == 200){

                                        HideLoading();

                                        xmldocument=xmlhttp.responseText;

					alert(xmldocument);

                                }

                        }

                };

                xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

                xmlhttp.send(null);







	}



        function getXmlHttpRequestObject() {

                if (window.XMLHttpRequest) {

                        return new XMLHttpRequest();

                } else if(window.ActiveXObject) {

                        return new ActiveXObject("Microsoft.XMLHTTP");

                } else {

                        alert("Your Browser Does Not Support AJAX!!!");

                }

        }



	function mapenterkey(e){

		if(e){

			e = e

		} else {

			e = window.event

		}



		if(e.which){

			var keycode = e.which

		} else {

			var keycode = e.keyCode

		}



		if(keycode == 13) {

			getCustomerDetails();

		}

	}



var emailFilter=/^.+@.+\..{2,3}$/;



var num=/^([0-9])+$/;





	function valid(){

	var str="";

	var flag="true";

      if (document.form1.order.value== ""){

         str+="Please Fill Your Order.\n";

         flag="false";

      }

      if (document.form1.fullname.value==""){

         str+="Please Enter Your Name.\n";

         flag="false";

      }

      if (document.form1.email.value==""){

         str+="Please Enter Your Email.\n";

         flag="false";

      }

      if (!emailFilter.test(document.form1.email.value)){

         str+="Invalid Email Address.\n";

         flag="false";

      }

      if (document.form1.contactno.value== ""){

         str+="Please Enter Your Contact Number.\n";

         flag="false";

      }

      if (!num.test(document.form1.contactno.value)){

         str+="Invalid Contact Number.\n";

         flag="false";

         

      }

      if (document.form1.hno1.value== ""){

         str+="Please Enter Your House Number.\n";

         flag="false";

         

      }

      if (document.form1.strt.value== ""){

         str+="Please Enter Street Address.\n";

         flag="false";

         

      }

      if (document.form1.city.value== ""){

         str+="Please Enter Your City Name.\n";

         flag="false";

         

      }

      if (document.form1.state.value== ""){

         str+="Please Fill Your State Name.\n";

         flag="false";

         

      }

      if (document.form1.zip.value== ""){

         str+="Please Enter Zip Code.\n";

         flag="false";

         

      }

      

      if(str!="" || flag=="false"){

      	       alert(str);

      	       return false;

      }

      var order=document.form1.order.value;

      var fullname=document.form1.fullname.value;

      var email=document.form1.email.value;

      var contactno=document.form1.contactno.value;

      var hno=document.form1.hno1.value;

      var streat=document.form1.strt.value;

      var city=document.form1.city.value;

      var state=document.form1.state.value;

      var zip=document.form1.zip.value;

      var pickuplocation=document.form1.pickup.value;

      var paymethod=document.form1.paymethod.value;



odersubmit(order,fullname,email,contactno,hno,streat,city,state,zip,pickuplocation,paymethod);









}









function submit_fran_info(){

var name=document.getElementById("name").value;

var email=document.getElementById("email").value;

var contact=document.getElementById("contact").value;

var msg=document.getElementById("msg").value;

if(name=="" || email=="" || contact=="" || msg==""){

var str="Please Check Following Details \n\n";



if(name==""){

    str+="Please Enter Your Name.\n\n";

}

if(email==""){

    str+="Please Enter Your Email.\n\n";

}

if(contact==""){

    str+="Please Enter Your Contact Details.\n\n";

}

if(msg==""){

    str+="Please Enter Details\n\n";

}



alert(str);

}else{

     submitdetails(name,email,contact,msg);

}

}
