var count = 0;
var new_win;

function get_coupon(url) {
		alert("Print Coupon");

	/*
	if (count==0) {
		count++;
		
		

		_link = $('update');
		

		if (_link) {
			_link.addClass('bold');
			_link.empty();
			_link.appendText('Thank you from Quarterdeck.');			
			//alert(new_win);			
		}
		
		
		new_win = NewWindow(url);
		new_win.onload = winLoaded();

	}
	*/
	
}

function winLoaded() 
{
		if (window.focus) {new_win.focus()}
		if (Browser.Engine.trident) { 
			
		//	alert("Your coupon should automaticly print."); 
			//new_win.onafterprint = close()
		}
			
		//new_win.print();
		//new_win.setTimeout("printPage()",450);
 	//	new_win.setTimeout("close()",3850);
		
		
}

function printCoupon() {
	if (count==0) {
		count++;

		print();
	}
}


function isInteger (s)
   {
      var i;

      if (isEmpty(s))
      if (isInteger.arguments.length == 1) return 0;
      else return (isInteger.arguments[1] == true);

      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);

         if (!isDigit(c)) return false;
      }

      return true;
   }

 function isEmpty(s)
   {
      return ((s == null) || (s.length == 0))
   }

   function isDigit (c)
   {
      return ((c >= "0") && (c <= "9"))
   }

