function sendToNewWindow(thisform) {
	
	
	var em = $("#tbEmail").val();
	var zp = $("#tbPostalCode").val();
	var dataString = 'email='+ em +'&zip='+zp;

if (em == "" || zp == ""){
	alert("Please enter both your e-mail address and ZIP code.");
return false
}else{
//	alert(dataString);
	$("#trackingForm").hide();
	
	 window.open("http://orders.churchchairs4less.com/customerordertracking/ondemand.aspx?" + dataString  , "myNewWin" , "location=1,status=1,scrollbars=1,width=800,height=700"); 

}

} 



function hideForm(){
		$("#trackingForm").hide();    
}

function showTrackingForm() {

var newContent = '';


newContent += '<a href="javascript:void(0);" onClick="hideForm();" id="closeTrForm" style="display:block; position:absolute; float:right; clear:none; top:0; right:0;  color:#ffffff !important; cursor:pointer !important; text-decoration:none; margin:0; padding:16px;">Close X</a><form name="form1" id="form1" style="display:block; width:340px; height:auto; float:left; clear:both; margin:30px; padding-top:95px"><div class="container"><h2 class="style3" style="color:#306dab;"></h2><table class="style1"><tr><td style = "text-align: right; width:50%; height=40px;  color:#ffffff;">Email:</td><td align="left" width="320px" height="40px"><input name="tbEmail" type="text" id="tbEmail" style="padding:4px; border:none; width:200px; font-size:18px;" /></td></tr><tr><td style = "text-align: right; width:50%; height=40px; color:#ffffff;">Billing or Shipping Zip Code:</td><td align="left" width="260px" height="40px"><input name="tbPostalCode" type="text" id="tbPostalCode" style="width:100px; float:left; padding:4px; border:none;  font-size:18px; " /></td></tr></table><br clear="all"><div align="center"><input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTg3NzE3MTYxNg9kFgICAw9kFgICBw8WBB4JaW5uZXJodG1sZR4Fc3R5bGUFDGNvbG9yOmJsYWNrO2Rk3boidD6gmTo+2mbdXeZtMwGnNM0=" /><input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBAL/wPdJAoyostoOApWj5IAHAsKL2t4Dy3TlAKgh3CDpEW+SrYek4PzDgoI=" /><input type="submit" onClick="sendToNewWindow(); hideForm();" name="btnSubmit" value="" id="btnSubmit" style="display:block; width:110px; height:57px; margin:0; padding:0; border:none !important; background: url(http://cdn.bizchair.com/trForSub5.png) no-repeat right top; background-color:none !important; border:none !important;"></div><br clear="all"><div style="text-align:center;font-size:11px;font-style:italic; color:#ffffff;padding-bottom:20px;">Please enter your email address and zip code. You can enter either your billing or shipping zip code.</div></div></form>'; 

$("#main-content").css({'position':'relative'});
$("#main-content").prepend('<div id="trackingForm" style="display:block; width:400px; height:400px; background-color:none; background-image:url(http://cdn.bizchair.com/trForBk2.png); background-repeat:no-repeat; position:absolute; z-index:300; ">' + newContent + '</div>');
$('#trackingForm').CenterIt();

	$("#btnSubmit, #closeTrForm").click(function () {
	$("#trackingForm").hide();    
	});
} 

