

function printSavingVoucher(url,contextPath){
	(new Ajax(url + "?" + (new Date()).getTime(),{method:'get',update:$('FormWindow'),onComplete:function(response){printSavingVoucherResponse(response,contextPath)}})).request();
}

function printSavingVoucherResponse(response,contextPath){
	var res=Json.evaluate(response);
	if(res.Status == 'Success'){
		var cardObj = parent.printPage.document.getElementById("cardNum");
		var grpObj = parent.printPage.document.getElementById("groupNum");
		cardObj.innerHTML = res.CardNumber;
		grpObj.innerHTML = res.GroupNumber;

		if(window.ie)  { 
			parent.printPage.focus();
			parent.printPage.document.body.style.zoom = 0.599; 
			
			parent.printPage.print(); 

			parent.printPage.document.body.style.zoom = 0; 
		} else  { 

			parent.printPage.focus();
			parent.printPage.print();
		} 


		myContextPath = contextPath;
		timedOut = redirectToThankYou.delay(5000);
		
	}else{
		alert(res.Message);
	}
}

	function redirectToThankYou(){
		parent.location.href = myContextPath+'/info/offer/voucherThankYou.jsp';
	}