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 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 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(){
      if (document.form1.order.value== "")

{

alert ("Please Fill Your Order");

document.form1.order.focus();

return false;

}



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

{



alert ("Please Enter Your Name");

document.form1.fullname.focus();

return false;

}

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

{



alert ("Please Enter Your Email");

document.form1.email.focus();

return false;

}

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



alert("Invalid Email Address")



document.form1.email.focus();



return false;



}

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

{

alert ("Please Enter Your Contact Number");

document.form1.contactno.focus();

return false;



}



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



alert("Invalid Contact Number")



document.form1.contactno.focus();



return false;



}



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

{

alert ("Please Enter Your House Number");

document.form1.hno1.focus();

return false;

}

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

{

alert ("Please Enter Street Address");

document.form1.strt.focus();

return false;

//name,email,contactno,hno,strt,city,state,zip

}



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



{



alert ("Please Enter Your City Name.");



document.form1.city.focus();



return false;


}

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

{

alert ("Please Fill Your State Name");

document.form1.state.focus();

return false;

}

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

{

alert ("Please Enter Zip Code");

document.form1.zip.focus();

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




}