

$(function() {
	$("a.BUY").css("cursor", "pointer").click(function() { 
		$("#buyNow").load("mypurchase.html #purchase", function() {
		$("#buyNow").dialog({
			resizeable: false,
			autostart: false,
			closeOnEscape: false,
			modal: true,
			width: 775,
			height: 550,
			buttons: {
                "Cancel": function() {
			$(this).dialog("close");
		    
               	},
		" Subscribe Now": function() {
			window.location.href="register.html";
			$(this).dialog("close");	

		}
        	}
		});
	});
	});
});

function testMap() {
	alert("Map test complete.");
}

function Validate() {

	
	if ($('#ind :selected').val() <= 0) {
		alert("Please Select Your Industry");
	} else if ($('#emp :selected').val() <= 0) { 
		alert("Please Select Number of Employeed");
	} else if ($('#METH :selected').val() <= 0) {
		alert("Please Select Your Preferred Method of Payment.");
	} else {

		$.cookie('SID', Math.uuid(32));
		$.cookie('NIND',$('#ind :selected').val());
		$.cookie('price', $('#emp :selected').val());
		$.cookie('METH', $('#METH :selected').val());
		$("#reg-dialog").dialog("close");
	}
}

function validateMain() {

	if ($('#ind :selected').val() <= 0) {
		alert("Please Select Your Industry");
	} else if ($('#emp :selected').val() <= 0) { 
		alert("Please Select Number of Employeed");
	} else if ($('#METH :selected').val() <= 0) {
		alert("Please Select Your Preferred Method of Payment.");
	} else {

		$.cookie('SID', Math.uuid(32));
		$.cookie('NIND',$('#ind :selected').val());
		$.cookie('price', $('#emp :selected').val());
		$.cookie('METH', $('#METH :selected').val());
		window.location.href="register.html";
		$(this).dialog("close");
	}

}

function showOpening() {

$(function() {
	//$("a.BUY").css("cursor", "pointer").click(function() { 
		$("#reg-dialog").load("reg1.html #TOG", function() {
		$("#reg-dialog").dialog({
			resizeable: false,
			autostart: false,
			closeOnEscape: false,
			modal: true,
			width: 550,
			height: 500,
			buttons: {
		"Cancel": function() {
			window.location.href="index.html";
			$(this).dialog("close");
		    
               	},
		"Continue": function() {
			Validate();
						
		}
        	}
		});
	});
	//});
});


}

function toBuy() {
	$("#buyNow").load("mypurchase.html #purchase", function() {
		$("#buyNow").dialog({
			resizeable: false,
			autostart: false,
			closeOnEscape: false,
			modal: true,
			width: 775,
			height: 550,
			buttons: {
                "Cancel": function() {
			$(this).dialog("close");
		    
               	},
		" Subscribe Now": function() {
			window.location.href="register.html";
			$(this).dialog("close");	

		}
        	}
		});
	});
}




function verify() {
		
		if($("#inv").attr("checked")) { 
		if (confirm("You've checked the \"Invoice Me\" box. By checking this box, you are choosing to receive an invoice before payment. This Choice May Delay Activation of Your Red Flags solution! If you would like to receive an invoice and pay by company check, click \"OK\" below. ")) {
   		} else {
		uncheck();
		}
		}
		
	}

	function uncheck() {

		var box = eval("document.order.inv"); 
		if (box.checked == true) box.checked = false;

	}	



	function Agree() {

		var STATUS = $("#lic").attr("checked");
		
		
		//if(STATUS) {
		var FAQ_width = 760;		
		var FAQ_height 	= 600;	
		var day = new Date();
		var id = day.getTime();
		var faqscrollbarS = "0";
		var URL = 'http://www.onescanid.com/agreement.html';
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=' + faqscrollbarS + ',location=0,statusbar=0,menubar=0,resizable=1,width='+FAQ_width+',height='+FAQ_height+'');");
		//}
		if(!status) { $("#lic").attr("checked", "checked"); $("#submitbutton").removeAttr("disabled"); }
	}



