var delayb4scroll = 0;	//Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed = 1;		//Specify marquee scroll speed (larger is faster 1-10)
var pauseit = 0;			//Pause marquee onMousever (0=no. 1=yes)?

var copyspeed = marqueespeed;
var pausespeed=(pauseit==0)? copyspeed: 0;
var actualheight='';

function confirmchange(deviceid, pin){
	var message = "The discount code that you have entered is not applicable to the new device you've chosen.  If you proceed, your discount code will be removed.  Would you like to proceed?";
	if(confirm(message)){
		window.location = "/account/dsp_account_cleardiscount.cfm?deviceid=" + deviceid + "&pin=" + pin;
	} else {
		history.back();	
	}
}

function scrollmarquee(){
	if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8)) //if scroller hasn't reached the end of its height
		cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"; //move scroller upwards
	else //else, reset to original position
		cross_marquee.style.top=parseInt(marqueeheight)+8+"px";
}

function initializemarquee(){
	cross_marquee=document.getElementById("vmarquee");
	cross_marquee.style.top=0;
	marqueeheight=document.getElementById("ratescroller").offsetHeight;
	actualheight=cross_marquee.offsetHeight; //height of marquee content (much of which is hidden from view)
	if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
		cross_marquee.style.height=marqueeheight+"px";
		cross_marquee.style.overflow="scroll";
		return
	}
	setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll);
}

var openedonce = false;

function popPlayer(deviceid, pin, message, desc){
	if (openedonce){
		webmailplayer = open('','webmailplayer').close();
	}
	openedonce = true;
	window.open("/account/globalmail/player.cfm?r=1&deviceid=" + deviceid + "&pin=" + pin + "&message=" + message + "&desc=" + desc, "webmailplayer", "width=250, height=250, menubars=no, statusbar=no, scrollbars=no, resizable=no");
}

function enlargeitem(id){
	window.open("/shop/enlarge.cfm?id=" + id, "enlargeitem", "resizable=0,HEIGHT=200,WIDTH=200");
}

function showInline (elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "inline";
	}
}
function hideInline (elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "none";
	}
}

