// JavaScript Document
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0 var p,i,x; 
if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) 
{ d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) 
x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
x=MM_findObj(n,d.layers[i].document); return x; } 

function MM_swapImage() { //v3.0 
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) 
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; 
x.src=a[i+2];} } 

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header

function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}

function getOrderInfo(idPosition){
	var idArray = idPosition.split('_');
	if (idArray.length != 2) return;
	return $.ajax({
			  type: "POST",
			  url: "/updateClick.cfm",
			  contentType: "application/x-www-form-urlencoded", //default is application/x-www-form-urlencoded
			  dataType: "text", //The type of data that you're expecting back from the server: xml,html,script,json,text
			  data: '&aduid='+idArray[0]+'&adPosition='+idArray[1],
			  async: false
			 }).responseText;	
}

function couponClick(cid,clickType){
	return $.ajax({
			  type: "POST",
			  url: "/couponClick.cfm",
			  contentType: "application/x-www-form-urlencoded", //default is application/x-www-form-urlencoded
			  dataType: "text", //The type of data that you're expecting back from the server: xml,html,script,json,text
			  data: '&cid='+cid+'&clickType='+clickType, 
			  async: false
			 }).responseText;	
}
function businessClick(bid,title,href){
	return $.ajax({
			  type: "POST",
			  url: "/businessClick.cfm",
			  contentType: "application/x-www-form-urlencoded", //default is application/x-www-form-urlencoded
			  dataType: "text", //The type of data that you're expecting back from the server: xml,html,script,json,text
			  data: '&bid='+bid+'&title='+title+'&href='+href, 
			  async: false
			 }).responseText;	
}
function spotlightClick(sid,title,href){
	return $.ajax({
			  type: "POST",
			  url: "/spotlightClick.cfm",
			  contentType: "application/x-www-form-urlencoded", //default is application/x-www-form-urlencoded
			  dataType: "text", //The type of data that you're expecting back from the server: xml,html,script,json,text
			  data: '&sid='+sid+'&title='+title+'&href='+href, 
			  async: false
			 }).responseText;	
}
$(document).ready(function(){
	$(".printclick").bind("click", function(){     
	  couponClick(this.id,'print'); 
	  printWindow();
	  return false;
    });
	$(".couponclick").bind("click", function(){
      couponClick(this.id,'coupon');
    });
	$(".clickthru").bind("click", function(){
      getOrderInfo(this.id);
    });
	$(".businessclick").bind("click", function(){     
	  businessClick(this.id,this.title,this.href);
    });
	$(".spotlightclick").bind("click", function(){     
	  spotlightClick(this.id,this.title,this.href);
    });
});


//
-->