  function swap(container,id)  {
   document.getElementById(container,id).innerHTML='<table cellspacing="0" cellpadding="0" border="0" width="500" height="500"><tr><td valign="middle" align="center"><img src="images/'+id+'"></td></tr></table>';
//   alert(id);
  }
  function swap2(container,id)  {
   document.getElementById(container,id).innerHTML='<table cellspacing="0" cellpadding="0" border="0" style="width:752px;height:500px;"><tr><td valign="middle" align="center"><img alt="pic" title="pic"  src="'+id+'"></td></tr></table>';
//   alert(id);
  }
  
  function printcoupon() {
   window.print();
  }  


  pastid="";
  paststylename="";

  function swapstyle(id,action,mode,stylename) {

   if (action==0) {
      if (pastid!=id) {
         document.getElementById(id).className=stylename;
        }
   } else if (action==1) {
      if (pastid!=id) {
         document.getElementById(id).className=stylename+'_hover';
      }
   } else if (action==2) {
      if ((pastid.length>1) && (mode==0) && (stylename==paststylename)) {
         document.getElementById(pastid).className=stylename;
      }
      document.getElementById(id).className=stylename+'_down';


      if (mode==0) {
       pastid=id;
       paststylename=stylename;
      }
   }
  }

 function goto(id) {
//   alert(id);
  location=id;
 }

//  0.5 0.1

 function fadeout(object,startop,fadefactor,fadedest,fadespeed) {
  var fd=fadedest*1;
  var sop=startop*1;
  var ff=fadefactor*1;
  var c=sop-ff;
  var cie=c*100;
    if (c>=fd) {
    setTimeout("fadeout('"+object+"','"+c+"','"+ff+"','"+fd+"','"+fadespeed+"')",fadespeed);
     var object = document.getElementById(object).style;
        object.MozOpacity = c;
        object.Opacity = c;
        object.KhtmlOpacity = (cie);
        object.filter = "alpha(opacity=" + cie + ")";
   }


}


function fadein(object,startop,fadefactor,fadedest,fadespeed) {
  var fd=fadedest*1;
  var sop=startop*1;
  var ff=fadefactor*1;
  var c=sop+ff;
  var cie=c*100;

    if (c<=fd) {
    setTimeout("fadein('"+object+"','"+c+"','"+ff+"','"+fd+"','"+fadespeed+"')",fadespeed);
     var object = document.getElementById(object).style;
        object.MozOpacity = c;
        object.Opacity = c;
        object.KhtmlOpacity = (cie);
        object.filter = "alpha(opacity=" + cie + ")";
   }

}


function hidecoupon() {
     document.getElementById('couponsss').style.visibility = "hidden";
}

  pastid2="";


