// popup.js 
// expects :
//			url - of the window to be called
//			Title -  for the window, each unique title spawns a new window
//			width - in pixels of the desired window
//			height - in pixels of the desired window
//	hence a legal call would look like:
// <a href="JavaScript:popWindow('myurl.htm','popupwindowname','520','615')" >click here to spawn window</a>
//

oHTMLWin = null;

function centerWindow(url, name, w, h, scroll, menu, resizable, all)
{
	if (window.screen)
	{
		var chasm = screen.availWidth;
		var mount = screen.availHeight;
		var allprops = "";

	      if(all=="1") allprops = ",directories=yes,location=yes,status=yes,toolbar=yes";

		winprops = 'width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5) + ',scrollbars=' + scroll + ',menubar=' + menu + ',resizable=' + resizable + allprops;
		
		oHTMLWin = window.open(url, name, winprops);
		oHTMLWin.window.focus();
	}
}

function popWindowMenus(url,title,width,height){
		centerWindow(url, title, width, height, "yes", "yes", "yes", "1");
}

function popWindow(url,title,width,height){
		centerWindow(url, title, width, height, "yes", "no", "no", "0");
}

function popWindowResizeable(url,title,width,height){
		centerWindow(url, title, width, height, "yes", "no", "yes", "0");
}

function popWindowNoScroll(url,title,width,height){
		centerWindow(url, title, width, height, "no", "no", "no", "0");
}

function popWindowNoScrollResizeable(url,title,width,height){
		centerWindow(url, title, width, height, "no", "no", "yes", "0");
}

function getPromo(){
	popWindow('http://promo.iqadvantage.com/common/e.jsp?e=0&ref=IQREPLACETEXT&vcm=IQREPLACETEXT&vgid=83754&p=ScheringPlough','Save $3.00 on any Non-Drowsy Claritin Allergy Product','600','400');
}

/*
Enable dropdown menus on IE -- Suckerfish dropdown menus
*/

sfHover = function() {
  if (document.getElementById("module-menu")) {
	var sfEls = document.getElementById("module-menu").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
  }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
