<!--
function MM_findObj(n, d) { //v4.01
  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);
 if(!x && d.getElementById) x=d.getElementById(n); return x;

}


function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
   obj.visibility=v; }

}

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_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 move_box() {
    var offset = 0; // set offset (likely equal to your css top)
    var element = document.getElementById('alarm');

    element.style.top = (document.documentElement.scrollTop + offset) + 'px';
}

function vmpopup(image,nWidth,nHeight,sTilte,nColor,nMargin)
{
	if (nColor=="") {
		nColor="#FFFFFF";
	}
	var adj=10;
	var w = screen.width;
	var h = screen.height;
var agent=navigator.userAgent.toLowerCase();
if(agent.indexOf("opera") != -1){
w = document.body.clientWidth;
h = document.body.clientHeight;
}
	var byFactor=1;
	if(w<740){
		var lift=0.90;
	}
	if(w>=740 & w<835){
	var lift=0.91;
	}
 if(w>=835){
var lift=0.93;
}

// comment these because we need real size, 20091217
/*
if (nWidth>w){	
byFactor = w / nWidth;
nWidth = w;
nHeight = nHeight * byFactor;
}
if (nHeight>h-adj){
byFactor = h / nHeight;
nWidth = (nWidth * byFactor);
nHeight = h; 
}
*/

var scrWidth = w-adj;
var scrHeight = (h*lift)-adj;
 
if (nHeight>scrHeight){
nHeight=nHeight*lift;
nWidth=nWidth*lift;
}
var posLeft=0;
var posTop=0;
if (nMargin < 0){nMargin=0}
nMargin*=2;
var nTemp = parseInt(nHeight) + nMargin;
if (nTemp < scrHeight) {
scrHeight = nTemp;
} 
nTemp = parseInt(nWidth) + nMargin;
if (nTemp < scrWidth) {
scrWidth = nTemp;
}
if (scrHeight<100){scrHeight=100;}
if (scrWidth<100){scrWidth=100;}
posTop =  ((h-(scrHeight/lift)-adj)/2);
posLeft = ((w-(scrWidth)-adj)/2);
if (nHeight > (h*lift)-adj || nWidth > w-adj){
nHeight=nHeight-adj;
nWidth=nWidth-adj;
}
posTop = parseInt(posTop);
posLeft = parseInt(posLeft);		
scrWidth = parseInt(scrWidth); 
scrHeight = parseInt(scrHeight);
newWindow = window.open("","","width="+Math.min(scrWidth+40,800)+",height="+Math.min(scrHeight,600)+",left="+posLeft+",top="+posTop+",scrollbars=yes");
//newWindow = window.open("","","width=800,height=600,left="+posLeft+",top="+posTop+",scrollbars=yes");
if(newWindow!=null){
	newWindow.document.open();
	newWindow.document.write('<html><title>'+sTilte+'</title>'); 
	newWindow.document.write('<meta http-equiv="imagetoolbar" content="false">');
	newWindow.document.write('<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+nColor+'>');
  //newWindow.document.write('<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+nColor+' onBlur="self.close()" onClick="self.close()">'); 
	newWindow.document.write('<table width='+nWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
	newWindow.document.write('<img src="'+image+'" width='+nWidth+' height='+nHeight+' alt="Click to close window" >');
	newWindow.document.write('</td></tr></table></body></html>');
	newWindow.document.close();
	newWindow.focus();
}
return false;
}

function init_dw_Scroll() {
    var wndo = new dw_scrollObj('coupon_container', 'coupon_content');
    wndo.setUpScrollControls('scroll_links');
}

function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
}
//-->
