<!--
var submitted = false;

function pop_verisign()
{
	var b="https://trustsealinfo.verisign.com";
	var c=b+"/splash?form_file=fdf/splash.fdf&dn=www.christmascardsdirect.com&lang=en";
	newWin(c,560,500);
}

function loadAjax(requestUrl, params, divId)
{
	$.ajax({
		type: "POST",
		url: requestUrl,
   		data: params,
		success: function(response){
			document.getElementById(divId).html(response);
		},
		error: function() {
			$('#'+divId).html('Failed to load request!');
		}
	});
}

	function checkKey(evt) {
  		var evt = (evt) ? evt : ((event) ? event : null);
  		var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
  		if ((evt.keyCode == 13) && (node.type=="text"))  {updateQuantity(); return false;}
	}

	function checkSpaceKey(evt) {
  		var evt = (evt) ? evt : ((event) ? event : null);
  		var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
  		if ((evt.keyCode == 32) && (node.type=="text"))  { return true; }
  		else { return false; }
	}

	function updateShippingMethods(shipping_method) {
		var quantity = $('#quantity').attr('value');
		var product_code = $('#product_code').attr('value');
		var state = '';
		if ( $('#shipto_state') )
			state = $('#shipto_state').attr('value');
		var url = "../incl/js_update_shipping_methods.req.php";
		var pars = "state="+state+"&product_code="+product_code+"&quantity="+quantity+"&shipping_method="+shipping_method;
		
		$.ajax({
			type: "GET",
			url: url,
   			data: pars,
			success: function(msg) {
				updateShippingMethodsResponse(msg);
			}
		});
	}
	function updateShippingMethodsResponse(request)
	{
		var shipping_methods_div = $('#shipping_methods_div');
		shipping_methods_div.html(request);
	}

	function updateQuoteQuantity()
	{
		var product_code = $('#product_code').attr('value');
		var url = "../incl/js_update_quote_quantity.req.php";
		var pars = "product_code="+product_code;

		$.ajax({
			type: "GET",
			url: url,
   			data: pars,
			success: function(msg) {
				updateQuoteQuantityResponse(msg);
			}
		});
	}

	function updateQuoteQuantityResponse(request)
	{
		var quote_quantity = $('#quote_quantity');
		quote_quantity.html(request);
	}

	function updateQuantity()
	{
		var quantity = $('#quantity').attr('value');
		var product_code = $('#product_code').attr('value');

		var url = "../incl/js_update_quantity.req.php";
		var pars = "quantity="+quantity+"&product_code="+product_code;

		$.ajax({
			type: "GET",
			url: url,
   			data: pars,
			success: function(msg) {
				updateQuantityResponse(msg);
				
			}
		});
	}

	function updateQuantityResponse(msg)
	{
		$('#quantity').attr('value',msg);
		updatePrice();
		updateShippingMethods();
	}

	function updatePrice()
	{
		var quantity = $('#quantity').attr('value');
		var product_code = $('#product_code').attr('value');
		var card_sku = $('#card_sku').attr('value');

		var url = "../incl/js_update_price.req.php";
		var pars = "quantity="+quantity+"&product_code="+product_code+"&card_sku="+card_sku;
		
		$.ajax({
			type: "GET",
			url: url,
   			data: pars,
			success: function(msg) {
				updatePriceResponse(msg);
			}
		});
	}

	function updatePriceResponse(msg)
	{
		$('#price').attr('value',msg);
	}

	function popit(page, wWidth, wHeight) {
		fileURL=page;
		winopts = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,width=" + wWidth + ",height=" + wHeight + ",copyhistory=0,";
	    if (parseInt(navigator.appVersion) < 4) {
    	    if (smallwindow != null) smallwindow.close();
    	}
		timerID= setTimeout('Opener(fileURL)',100);
	}
	function newWin(doc, wWidth, wHeight) {
   		nWin = window.open(doc, 'newwin', "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=" + wWidth + ",height=" + wHeight + ",left=150,top=225");
	}

	function Opener(winname){
		filename = winname;
  		winname = "mywin"
 		smallwindow = window.open(filename,winname,winopts)

		//if( navigator.appVersion.indexOf("(X11") != -1 || navigator.appVersion.indexOf("(Mac") != -1)
		//	smallwindow = window.open(filename,winname,winopts)

		//if( navigator.appVersion.indexOf("MSIE") == -1 )
		//	smallwindow.mainWin = this;
		//WindowFocus();
	}
	function WindowFocus(){
		if( navigator.appVersion.indexOf("2.") == -1 &&  navigator.appVersion.indexOf("MSIE") == -1 )
			smallwindow.focus();
	}
//-->
