
 function form_show(id,proceedid)
 {
  if($("#"+id).is(':visible') == false)
  {
     $("#"+id).show();
	 $("#"+id).focus();
	 $("#"+proceedid).html("Proceed To Payment");
	 $("#"+proceedid).addClass("paymentbg");
	 if(id=="customwebdesignblank")
	 {
	 	$("#web").focus();
		//web_blur();
	 }
	 if(id=="customlogodesignblank")
	 {
	 	$("#logolk").focus();
	 }
	 if(id=="orderdetailsblank")
	 {
	 	swfUploadLoaded_orders();
	 	$("#orders").focus();
	 }
	 return false;
  }
  if($("#"+id).is(':visible') == true)
  {    
	 if(id=="customwebdesignblank")
	 {
	 	validate_customweb();
	 }
	 if(id=="customlogodesignblank")
	 {
	 	validateForm_logo();
	 }
	 if(id=="orderdetailsblank")
	 {
	 	//swfUploadLoaded_orders();
	 }	 
	 return false;
  }	 
  }
  
 function form_close(id,proceedid)
 {  
     $("#"+id).hide();
	 $("#"+proceedid).html("Order Now");
	 $("#"+proceedid).removeClass("paymentbg");
	 if(id=="customwebdesignblank")
	 {
	 	customweb_clear();
	 }
	 if(id=="customlogodesignblank")
	 {
	 	customlogo_clear();
	 }
	 if(id=="orderdetailsblank")
	 {
	 	customorder_clear();
	 }	 
	 return false;
  }

function validate_customweb() {
	//alert(document.getElementById("txtFileName").value);	
	//alert("val");
	var isValid = true;
	var num = "";
			if((($("#customweb_name").val()) == "* Your Name:" ) || (($("#customweb_name").val()) == "" ))
			{
				$("#customweb_name").addClass('error');				
				return false;
			}
			else
			if((echeck($("#customweb_email").val()) == false))
			{
				$("#customweb_email").addClass('error');				
				return false;
			}
			else			
			if((isNumber($("#customweb_ahp").val()) == false))
			{
				$("#customweb_email").removeClass('error');	
				$("#customweb_ahp").addClass('error');				
				return false;
			}
			else
			if((isNumber($("#customweb_rhp").val()) == false))
			{
				$("#customweb_ahp").removeClass('error');
				$("#customweb_rhp").addClass('error');				
				return false;
			}
			else
			if((isNumber($("#customweb_ap").val()) == false))
			{
				$("#customweb_rhp").removeClass('error');
				num = $("#customweb_ahp").val();				
				num = num*100;
				num = "$"+num;
                $("#customweb_ahpdA").val(num);
				custom_web();
				$("#customweb_ap").addClass('error');				
				return false;
			}
			else
			if((isNumber($("#customweb_AScfo").val()) == false))
			{
				$("#customweb_ap").removeClass('error');
				num = $("#customweb_ap").val();
				if ((num == 4) || (num <= 4)) {
					$("#customweb_apA").val("Included");
				}
				else {
					num = (num-4) * 50;
					num = "$" + num;
					$("#customweb_apA").val(num);
				}				
				$("#customweb_AScfo").addClass('error');				
				custom_web();
				return false;				
			}
			else
			{				
				update();
			}

}

function validateForm_logo() {
	var num = "";
		if((($("#customlogo_name").val()) == "* Your Name:" ) || (($("#customlogo_name").val()) == "" ))
			{							
				$("#customlogo_name").addClass('error');				
				return false;
			}
		else
		if((echeck($("#customlogo_email").val()) == false))
			{
				$("#customlogo_name").removeClass('error');	
				$("#customlogo_email").addClass('error');				
				return false;
			}
			else				
			if((isNumber($("#customlogo_AHPDC").val()) == false))
			{
				$("#customlogo_email").removeClass('error');
				$("#customlogo_AHPDC").addClass('error');				
				return false;
			}			
			else{
				//alert("s called,,");
				update_logo();
			}			
}

function cms_show(id,proceedid,data)
 {
  if($("#"+id).is(':visible') == false)
  {
     $("#"+id).show();
	 $("#"+id).focus();
	 $("#"+proceedid).html("Proceed To Payment");
	 $("#"+proceedid).addClass("paymentbg");
	 swfUploadLoaded_cms();	 
	 return false;
  }
  if($("#"+id).is(':visible') == true)
  {
  	 if (data == 'close') {
	 	$("#" + id).hide();			
	 	$("#" + proceedid).html("Order Now");
	 	$("#" + proceedid).removeClass("paymentbg");
		cms_clear();					
	 	return false;
	 }
	 else {
	 	$("#"+id).focus();
	 	return false;		
	 }
  }	 

  }

function cms_total()
{   
	var tot=0;	
	if (document.getElementById('wp').checked == true) {					
			tot += parseInt("270");
		}
	if (document.getElementById('bl').checked == true) {			
			tot += parseInt("220");
		}
	if (document.getElementById('mt').checked == true) {			
			tot += parseInt("270");
		}
	if (document.getElementById('osc').checked == true) {			
			tot += parseInt("370");
		}
	if (document.getElementById('zc').checked == true) {			
			tot += parseInt("370");
		}
	if (document.getElementById('cc').checked == true) {			
			tot += parseInt("470");
		}
	if (document.getElementById('sb').checked == true) {			
			tot += parseInt("470");
		}
	if (document.getElementById('xc').checked == true) {			
			tot += parseInt("470");
		}
	if (document.getElementById('dr').checked == true) {			
			tot += parseInt("270");
		}
	if (document.getElementById('pl').checked == true) {			
			tot += parseInt("220");
		}
	if (document.getElementById('t3').checked == true) {			
			tot += parseInt("270");
		}
	if (document.getElementById('jm').checked == true) {			
			tot += parseInt("470");
		}
	if (document.getElementById('vb').checked == true) {			
			tot += parseInt("470");
		}
	if (document.getElementById('pbb').checked == true) {			
			tot += parseInt("470");
		}
	if (document.getElementById('emn').checked == true) {			
			tot += parseInt("90");
		}
	$("#cmstotal").val("");
	$("#cmstotal").val("$"+tot);	
}

function cms_paypal()
{
	
	var datas="";	
	var cms_name = $("#cms_name").val();
	var cms_email = $("#cms_email").val();
	//var cms_nop = $("#cms_nop").val();
	var cms_link = $("#cms_link").val();
	var cms_notes = $("#cms_notes").val();
	var filename = $("#hidFileID_cms").val();	
	datas = "name="+cms_name+"&email="+cms_email+"&link="+cms_link+
			"&notes"+cms_notes+"&filename="+filename+"&";
	//alert(filename);
	if (document.getElementById('wp').checked == true) {					
			datas += "PSD to WorkPress = PSD to WorkPress&";
		}
	if (document.getElementById('bl').checked == true) {			
			datas += "PSD to Blogger = PSD to Blogger&";
		}
	if (document.getElementById('mt').checked == true) {			
			datas += "PSD to Movabletype = PSD to Movabletype&";
		}
	if (document.getElementById('osc').checked == true) {			
			datas += "PSD to osCommerce = PSD to osCommerce&";
		}
	if (document.getElementById('zc').checked == true) {			
			datas += "PSD to ZenCart = PSD to ZenCart&";
		}
	if (document.getElementById('cc').checked == true) {			
			datas += "PSD to Cubecart = PSD to Cubecart&";
		}
	if (document.getElementById('sb').checked == true) {			
			datas += "PSD to Shopify = PSD to Shopify&";
		}
	if (document.getElementById('xc').checked == true) {			
			datas += "PSD to X-Cart =PSD to X-Cart&";
		}
	if (document.getElementById('dr').checked == true) {			
			datas += "PSD to Drupal = PSD to Drupal&";
		}
	if (document.getElementById('pl').checked == true) {			
			datas += "PSD to Pligg = PSD to Pligg&";
		}
	if (document.getElementById('t3').checked == true) {			
			datas += "PSD to Typo3 = PSD to Typo3&";
		}
	if (document.getElementById('jm').checked == true) {			
			datas += "PSD to Joomla = PSD to Joomla&";
		}
	if (document.getElementById('vb').checked == true) {			
			datas += "PSD to vBulletin = PSD to vBulletin&";
		}
	if (document.getElementById('pbb').checked == true) {			
			datas += "PSD to phpBB = PSD to phpBB&";
		}
	if (document.getElementById('emn').checked == true) {			
			datas += "PSD to Email = PSD to Email&";
		}
		tot = $("#cmstotal").val();
		datas +="field=cmsintegration&total="+tot; 
		
		
	$.ajax({
	   type: "POST",
	   url: "update.php",
	   data: datas,
	   success: function(msg){
		   		$("#cmsintegration_anchor").focus();
			    $("#file_status_cms").html("<img src='images/loading_green.gif' alt='Loading..'></img>");
				$("#paypalform").html(msg);
				//alert(msg);
				document.frm.submit();
				}		
	 });
}

function cms_clear()
{
	$("#cms_name").val("* Name");
	$("#cms_name").removeClass('error');
	$("#cms_email").val("* Email");
	$("#cms_email").removeClass('error');
	$("#cms_nop").val("* Number of Pages");
	$("#cms_link").val("http://");
	$("#cms_nop").removeClass('error');
	$("#fileorlink_cms").css({'color' : '#464646'});
	$("#cms_notes").val("* Notes");
	$("#txtFileName_cms").val("");	
	document.getElementById('wp').checked = false;
	document.getElementById('bl').checked = false;
	document.getElementById('mt').checked = false;
	document.getElementById('osc').checked = false;
	document.getElementById('zc').checked = false;
	document.getElementById('cc').checked = false;
	document.getElementById('sp').checked = false;
	document.getElementById('xc').checked = false;
	document.getElementById('dr').checked = false;
	document.getElementById('pl').checked = false;
	document.getElementById('t3').checked = false;
	document.getElementById('jm').checked = false;
	document.getElementById('vb').checked = false;
	document.getElementById('pbb').checked = false;
	document.getElementById('emn').checked = false;	
	$("#cmstotal").val("");
	return true;
}

function customweb_clear()
{
	$("#customweb_name").val("* Your Name:");
	$("#customweb_name").removeClass('error');	
	$("#customweb_email").val("* E-mail");
	$("#customweb_email").removeClass('error');		
	$("#customweb_pn").val("Phone:");
	$("#customweb_pn").removeClass('error');
	$("#customweb_link").val("Website URL:");
	$("#fileorlink_web").css({'color' : '#464646'});
	$("#customweb_note").val("* Note/Message:");
	$("#customweb_note").removeClass('error');
	$("#customweb_ahp").removeClass('error');		
	$("#customweb_ahp").val("0");
	$("#customweb_ahpdA").val("$0");
	$("#customweb_rhp").val("5");
	$("#customweb_rhp_inc").val("Included");
	$("#customweb_ap").removeClass('error');	
	$("#customweb_rhp").val("5");
	$("#customweb_rhp").removeClass('error');
	$("#customweb_AScfo").removeClass('error');
	$("#customweb_ap").val("4");
	$("#customweb_apA").val("Included");
	$("#customweb_AScfo").val("1");	
	$("#customweb_AScfoA").val("Included");	
	$("#txtFileName").val(" ");
	custom_web();
}

function customlogo_clear()
{
	$("#customlogo_name").val("* Your Name:");
	$("#customlogo_name").removeClass('error');
	$("#customlogo_email").val("* E-mail");
	$("#customlogo_email").removeClass('error');
	$("#customlogo_pn").val("Phone:");
	$("#customlogo_pn").removeClass('error');
	$("#customlogo_link").val("Website URL:");
	$("#fileorlink_logo").css({'color' : '#464646'});
	$("#customlogo_note").val("* Note/Message:");
	$("#customlogo_note").removeClass('error');
	$("#customlogo_AHPDC").val("0");
	$("#customlogo_AHPDC_amount").val("$100");
	$("#customlogo_AHPDC").removeClass('error');
	$("#customlogo_AP").val("1");
	$("#customlogo_AP").removeClass('error');
	$("#customlogo_ASCF").val("1");
	$("#customlogo_RHPD").val("5");
	$("#customlogo_RHPD_include").val("Included");
	$("#customlogo_ASCF").removeClass('error');
	$("#txtFileName_logo").val(" ");	
	custom_logo();
}

function customorder_clear()
{	
	$("#orders_name").val("* Name");
	$("#orders_name").removeClass('error');
	$("#orders_email").val("* Email");
	$("#orders_email").removeClass('error');
	$("#orders_nop").val("* Number of Pages");
	$("#orders_link").val("http://");
	$("#orders_nop").removeClass('error');
	$("#fileorlink_order").css({'color' : '#464646'});
	$("#orders_notes").val("* Notes");
	$("#txtFileName_orders").val("");	
	document.getElementById('package_opt2').checked = true;	
}

 function custom_web()
 {
 	
	 var hpA = $('#customweb_ahpdA').val().replace("$",""); 
	 var c = $('#customweb_apA').val();
	 if($('#customweb_apA').val() == "Included")
	 {
	 	c = "$0";
	 }
	 var customweb_apA = c.replace("$",""); 
	 var customweb_AScfoA = $('#customweb_AScfoA').val().replace("$",""); 
	 var customweb_hpd = $('#customweb_hpd').val().replace("$","");
	 var customweb_nor = "";
	 var ca = $('#customweb_AScfoA').val();
	 if (ca == 'Included') {
	    customweb_AScfoA = 0;
	 }
	 else {
	 	customweb_AScfoA = ca.replace("$", "");
	 }	
	 var t = ($('#customweb_rhp_inc').val());
	 if (t == 'Included') {
	    customweb_nor = 0;
	 }
	 else {
	 	customweb_nor = t.replace("$", "");
	 }		 	 
	 var tot = parseInt(hpA) + parseInt(customweb_apA) + parseInt(customweb_AScfoA) + parseInt(customweb_hpd)+
	 parseInt(customweb_nor); 
	 tot = "$"+tot;
     $('#customwebdesigntotal').val(tot);
 }
 
 function custom_logo()
 {
	 var HPD = $('#customlogo_HPD').val().replace("$",""); 
	 //customlogo_AHPDC
	var AHPDC = $('#customlogo_AHPDC_amount').val().replace("$",""); 
	 //var BCD = $('#customlogo_BCD').val().replace("$",""); 
	 var BCD = 0;
	// var AP = $('#customlogo_AP_amount').val().replace("$",""); 
	// var ASCF = $('#customlogo_ASCF_amount').val().replace("$",""); 
	 var customlogo_nor = "";
     var customlogo_bc = "";
	 var t = $('#customlogo_RHPD_include').val();
	 if (t == 'Included') {
	    customlogo_nor = 0;
	 }
	 else {
	 	customlogo_nor = t.replace("$", "");
	 }	
	 if (document.getElementById('buz_logo').checked == true) {
	    customlogo_bc = 100;
	 }
	 else {
	 	customlogo_bc = 0;
	 }	
	 var tot = parseInt(HPD) + parseInt(AHPDC) + parseInt(BCD) + parseInt(customlogo_nor) + parseInt(customlogo_bc); 
	 tot = "$"+tot;	 
     $('#customlogodesigntotal').val(tot);
 }

/* function custom_order()
{
	if (document.getElementById('package_opt1').checked == true) {		
		tot = parseInt("100");
	}
	else 
		if (document.getElementById('package_opt2').checked == true) {			
			tot = parseInt("150");
		}
	if (document.getElementById('orders_DHTMLACSSM_opt1').checked == true) {
				tot += parseInt('75');
			}
	else 
	if (document.getElementById('orders_DHTMLACSSM_opt2').checked == true) {
		tot += parseInt('75');
	}
	
	if (document.getElementById('SWintegration_opt1').checked == true) {
			tot = tot;
		}
	else 
	{
		tot += parseInt('475');
	}
			
	tot = "$"+tot;
	$('#customordertotal').val(tot);	
}

*/

function custom_order()
{
	$('#customordertotal').val("");	
	//alert("called..");
	if (document.getElementById('package_opt1').checked == true) {		
		tot = parseInt("100");
	}
	else 
		if (document.getElementById('package_opt2').checked == true) {			
			tot = parseInt("150");
		}
	if ($("#markupopts_hidable").is(':visible') == true) {
		if (document.getElementById('orders_DHTMLACSSM_opt1').checked == true) {
			tot += parseInt('40');
		}
		else 
		if (document.getElementById('orders_DHTMLACSSM_opt2').checked == true) {
			tot += parseInt('60');
		}
	}
	if ($("#swintgrtns_hidable").is(':visible') == true) {				
		if (document.getElementById('SWintegration_opt1').checked == true) {
			tot = tot;
		}
		else if (document.getElementById('SWintegration_opt5').checked == true) {
			tot += parseInt('470');
		}
		else {
			tot += parseInt('270');
		}
	}
			
	   tot = "$"+tot;
	   
	$('#customordertotal').val(tot);	
}

function layout_rqremts(id , thisid)
{
	//alert(thisid);
	if($("#"+id).is(':visible') == false)
  {
     if ($("#" + id).show()) {	 	
	 	custom_order();
	 }
	 document.getElementById(thisid).src="images/openbullet_minus.jpg";
  }
  else
  {
     if ($("#" + id).hide()) {		
	 	custom_order();		
	 }
	 if(id=="requirements_hidable")
	 {
	 	requirements_clear();
	 }
	 if(id=="markupopts_hidable")
	 {
	 	markupopts_clear();
	 }
	 if(id=="swintgrtns_hidable")
	 {
	 	swintgrtns_clear();
	 }
	 //alert(id);
	 //requirements_hidable
	 //markupopts_hidable
	 //swintgrtns_hidable
	 document.getElementById(thisid).src="images/openbullet.jpg";
  }
  
}

function requirements_clear()
{
	document.getElementById('orders_LW_opt2').checked = true;
	document.getElementById('orders_HA_opt2').checked = true;
	document.getElementById('orders_HFD_opt2').checked = true;
	document.getElementById('orders_VA_opt2').checked = true;	
}

function markupopts_clear()
{
	document.getElementById('orders_DHTMLRE_opt2').checked = true;
	document.getElementById('orders_DHTMLACSSM_opt3').checked = true;
	document.getElementById('orders_FORF_opt2').checked = true;
	document.getElementById('orders_FOsIFR_opt2').checked = true;
	document.getElementById('orders_COCT_opt2').checked = true;
	document.getElementById('orders_COTLM_opt2').checked = true;
}

function swintgrtns_clear()
{
	document.getElementById('SWintegration_opt1').checked = true;
}

function update()
{	
	custom_web();
	var customweb_name = $("#customweb_name").val();
	var customweb_email = $("#customweb_email").val();
	var customweb_pn = $("#customweb_pn").val();
	if((customweb_pn == "Phone:" ) || (customweb_pn == "" ))
	{
		customweb_pn = " ";
	}
	var customweb_link = $("#customweb_link").val();
	if((customweb_link == "Website URL:" ) || (customweb_link == "" ))
	{
		customweb_link = " ";
	}
	var customweb_note = $("#customweb_note").val();
	if((customweb_note == "Note/Message:" ) || (customweb_note == "" ))
	{
		customweb_note = " ";
	}
	var customweb_HPD = $("#customweb_hpd").val();
	var customweb_AHPD = $("#customweb_ahp").val();
	var customweb_RHP = $("#customweb_rhp").val();
	var customweb_APS = $("#customweb_ap").val();
	var customweb_AScfo = $("#customweb_AScfo").val();
	var customwebdesignTOTAL = $("#customwebdesigntotal").val();
	var filename = $("#hidFileID").val();	
  // alert(customwebdesignTOTAL);
		$.ajax({
	   type: "POST",
	   url: "update.php",	     
	   data:"field=customweb&customweb_name="+customweb_name+
	         "&customweb_email="+customweb_email+
			 "&customweb_pn="+customweb_pn+
	         "&customweb_link="+customweb_link+"&customweb_note="+customweb_note+		   			             "&customweb_HPD="+customweb_HPD+"&customweb_AHPD="+customweb_AHPD+
			 "&customweb_RHP="+customweb_RHP+"&customweb_APS="+customweb_APS+			      			 			 "&customweb_AScfo="+customweb_AScfo+
			 "&customwebdesignTOTAL="+customwebdesignTOTAL+
			 "&filename="+filename,
	   success: function(msg){	   	
	   	$("#file_status").html("<img src='images/loading_green.gif' alt='Loading..'></img>");
        $("#paypalform").html(msg);
	    document.frm.submit();		
	   }
	 });
}

function update_logo()
{
	//alert($("#customlogodesigntotal").val());
	//alert("ll update");
	custom_logo();
	var customlogo_name = $("#customlogo_name").val();
	var customlogo_email = $("#customlogo_email").val();
	var customlogo_pn = $("#customlogo_pn").val();
	if((customlogo_pn == "Phone:" ) || (customlogo_pn == "" ))
	{
		customlogo_pn = " ";
	}
	var customlogo_link = $("#customlogo_link").val();
	if((customlogo_link == "Website URL:" ) || (customlogo_link == "" ))
	{
		customlogo_link = " ";
	}
	var customlogo_note = $("#customlogo_note").val();
	if((customlogo_note == "Note/Message:" ) || (customlogo_note == "" ))
	{
		customlogo_note = " ";
	}
	var customlogo_HPD = $("#customlogo_HPD").val();
	var customlogo_HPD_include = $("#customlogo_HPD_include").val();
	var customlogo_AHPDC = $("#customlogo_AHPDC").val();
	var customlogo_AHPDC_amount = $("#customlogo_AHPDC_amount").val();
	var customlogo_RHPD = $("#customlogo_RHPD").val();
	var customlogo_RHPD_include = $("#customlogo_RHPD_include").val();
	var customlogo_BCD = $("#customlogo_BCD").val();
	var customlogo_AP = $("#customlogo_AP").val();
	var customlogo_AP_amount = $("#customlogo_AP_amount").val();
	var customlogo_ASCF = $("#customlogo_ASCF").val();
	var customlogo_ASCF_amount = $("#customlogo_ASCF_amount").val();
	var customlogodesignTOTAL = $("#customlogodesigntotal").val();
	var filename = $("#hidFileID_logo").val();	
   //alert(customlogodesignTOTAL);
		$.ajax({
	   type: "POST",
	   url: "update.php",
	   data: "field=customlogo&customlogo_name="+customlogo_name+"&customlogo_email="+customlogo_email+
	   			"&customlogo_pn="+customlogo_pn+
			   "&customlogo_link="+customlogo_link+"&customlogo_note="
			   +customlogo_note+"&customlogo_HPD="+customlogo_HPD+
			   "&customlogo_HPD_include="+customlogo_HPD_include+
			   "&customlogo_AHPDC="+customlogo_AHPDC+
			   "&customlogo_AHPDC_amount="+customlogo_AHPDC_amount+"&customlogo_RHPD="
			   +customlogo_RHPD+"&customlogo_RHPD_include="+customlogo_RHPD_include+
			   "&customlogo_BCD="+customlogo_BCD+"&customlogo_AP="+customlogo_AP+
			   "&customlogo_AP_amount="+customlogo_AP_amount+
			   "&customlogo_ASCF="+customlogo_ASCF+
			   "&customlogo_ASCF_amount=" +customlogo_ASCF_amount+
			   "&customlogodesignTOTAL="+customlogodesignTOTAL+"&filename="+filename,
	   success: function(msg){
	   //	alert(msg);
	   	$("#file_status_logo").html("<img src='images/loading_green.gif' alt='Loading..'></img>");
        $("#paypalform").html(msg);
		document.frm.submit();
		//alert( msg );
	   }
	 });

}


function update_orders(){
	//alert("test");
	
	var packages = "";
	var total = "";
	var layout_width = "";
	var harizantal_alignment = "";
	var headerfooterdimension = "";
	var verticalalignment = "";
	var dhtml_rollovereffects = "";
	var dhtml_advancedcssmenu = "";
	var FO_resizablefonts = "";
	var FO_sFIR = "";
	var CO_codingtypes = "";
	var tablelessmarkup = "";
	var swintegration = "";
	var orders_name = $("#orders_name").val();
	var orders_email = $("#orders_email").val();
	var orders_nop = $("#orders_nop").val();
	var orders_link = $("#orders_link").val();
	var orders_notes = $("#orders_notes").val();
	var filename = $("#hidFileID_orders").val();
	
	
	if (document.getElementById('package_opt1').checked == true) {
		packages = "Basic Package";
		total = "$100";
	}
	else 
		if (document.getElementById('package_opt2').checked == true) {
			packages = "Advanced Package";
			total = "$150";
		}
	if ($("#requirements_hidable").is(':visible') == true) {
	
			if (document.getElementById('orders_LW_opt1').checked == true) {
				layout_width = "Fixed";
			}
			else 
				if (document.getElementById('orders_LW_opt2').checked == true) {
					layout_width = "Liquid";
				}
			if (document.getElementById('orders_HA_opt1').checked == true) {
				harizantal_alignment = "Left";
			}
			else 
				if (document.getElementById('orders_HA_opt2').checked == true) {
					harizantal_alignment = "Center";
				}
				else 
					if (document.getElementById('orders_HA_opt3').checked == true) {
						harizantal_alignment = "Right";
					}
			if (document.getElementById('orders_HFD_opt1').checked == true) {
				headerfooterdimension = "No";
			}
			else 
				if (document.getElementById('orders_HFD_opt2').checked == true) {
					headerfooterdimension = "Yes";
				}
			if (document.getElementById('orders_VA_opt1').checked == true) {
				verticalalignment = "Top";
			}
			else 
				if (document.getElementById('orders_VA_opt2').checked == true) {
					verticalalignment = "Middle";
				}
				else 
					if (document.getElementById('orders_VA_opt3').checked == true) {
						verticalalignment = "Bottom";
					}
	
		}	
		
		if ($("#markupopts_hidable").is(':visible') == true) {
			if (document.getElementById('orders_DHTMLRE_opt1').checked == true) {
				dhtml_rollovereffects = "No";
			}
			else 
				if (document.getElementById('orders_DHTMLRE_opt2').checked == true) {
					dhtml_rollovereffects = "Yes";
				}
			if (document.getElementById('orders_DHTMLACSSM_opt1').checked == true) {
				dhtml_advancedcssmenu = "Single-Level Drop Down Menu";
			}
			else 
				if (document.getElementById('orders_DHTMLACSSM_opt2').checked == true) {
					dhtml_advancedcssmenu = "Multi-Level Drop Down Menu";
				}
				else 
				if (document.getElementById('orders_DHTMLACSSM_opt3').checked == true) {
					dhtml_advancedcssmenu = "Not Required";
				}
			
			if (document.getElementById('orders_FORF_opt1').checked == true) {
				FO_resizablefonts = "No";
			}
			else 
				if (document.getElementById('orders_FORF_opt2').checked == true) {
					FO_resizablefonts = "Yes";
				}
			
			if (document.getElementById('orders_FOsIFR_opt1').checked == true) {
				FO_sFIR = "No";
			}
			else 
				if (document.getElementById('orders_FOsIFR_opt2').checked == true) {
					FO_sFIR = "Yes";
				}
			
			if (document.getElementById('orders_COCT_opt1').checked == true) {
				CO_codingtypes = "W3C Valid HTML 4.01";
			}
			else 
				if (document.getElementById('orders_COCT_opt2').checked == true) {
					CO_codingtypes = "W3C Valid XHTML 1.0 Transitional";
				}
				else 
					if (document.getElementById('orders_COCT_opt3').checked == true) {
						CO_codingtypes = "W3C Valid XHTML 1.0 Transitional";
					}
			
			if (document.getElementById('orders_COTLM_opt1').checked == true) {
				tablelessmarkup = "No";
			}
			else 
				if (document.getElementById('orders_COTLM_opt2').checked == true) {
					tablelessmarkup = "Yes";
				}
		}
	
	if ($("#swintgrtns_hidable").is(':visible') == true) {
		if (document.getElementById('SWintegration_opt1').checked == true) {
			swintegration = "Regular Markup";
		}
		else 
			if (document.getElementById('SWintegration_opt2').checked == true) {
				swintegration = "Wordpress";
			}
			else 
				if (document.getElementById('SWintegration_opt3').checked == true) {
					swintegration = "Movable Type";
				}
				else 
					if (document.getElementById('SWintegration_opt4').checked == true) {
						swintegration = "Drupal";
					}
					else 
						if (document.getElementById('SWintegration_opt5').checked == true) {
							swintegration = "Joomla";
						}
	}
	
	
	var datas = "field=orders&total="+total+"&orders_name="+orders_name+"&orders_email="+orders_email+
	"&orders_nop="+orders_nop+"&orders_link="+orders_link+"&orders_note="+orders_notes+      "&packages="+packages+"&layout_width="+layout_width+"&harizantal_alignment="+harizantal_alignment+
"&headerfooterdimension="+headerfooterdimension+"&verticalalignment="+verticalalignment+
"&dhtml_rollovereffects"+dhtml_rollovereffects+	   "&dhtml_advancedcssmenu="+dhtml_advancedcssmenu+"&FO_resizablefonts="+FO_resizablefonts+
		   "&FO_sFIR="+FO_sFIR+"&CO_codingtypes="+CO_codingtypes+"&tablelessmarkup="+tablelessmarkup+
		   "&swintegration="+swintegration+"&filename="+filename;
	//alert("funchkk"+datas);
	$.ajax({
	   type: "POST",
	   url: "update.php",
	   data: datas,
	   success: function(msg){
	   	//alert(msg);
	   	$("#file_status_orders").html("<img src='images/loading_green.gif' alt='Loading..'></img>");
        $("#paypalform").html(msg);
		document.frm.submit();
		}
	 });
	
	
}

function isNumber(data)
{
	var numStr="1234567890";
	var thisChar;
	var counter=0;
	for(var i=0; i < data.length; i++)
		{
			thisChar=data.substring(i,i+1);
			if(numStr.indexOf(thisChar)!=-1)
			{counter++;}
		}
		if(counter==data.length)
		{return true;}
		else
		return false;
}


function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
	}


function QCsubmit() {  
   $("#QCerror").html("sending..");
   $("#QCerror").show(); 
   var email = $("#QCmail").val();   
   var comment = $("#QCcomments").val();
   var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
   //alert(filter.test(email));
   if(filter.test(email) == false) {	
		$("#QCerror").html("Invalid Email.");	
	}
	else if(email == "enter your email") {	
		$("#QCerror").html("Invalid Email.");		
	}	 
	else if(comment.length < 4) {		
		$("#QCerror").html("Minimum 3 characters required.");		
	}
	else if(comment.length > 500) {		
		$("#QCerror").html("Maximum 500 characters only.");		
	}
	else if(comment == "comments") {	
		$("#QCerror").html("Enter Comments..");		
	}
	else
	{
		var datas = "email="+email+"&comment="+comment;
		$.ajax({
		   type: "POST",
		   url: "QCmail.php",
		   data: datas,
		   success: function(msg){
		   	$("#QCerror").html("Message has been successfully sent.");	
			$("#QCmail").val("enter your email");
			$("#QCcomments").val("comments");
			$("#QCerror").fadeOut(10000);
		}
	 });
	}
 }

