var PopupWindow			= null;

function popupWindowNoMenu(URL,height,width,modeless) {
//	var URL = PathToRoot + "Store/Index.cfm?Render=Cart_Add_PopupCart&Spec_ID=" + form.Spec_ID.value + "&Quantity=" + form.Quantity.value;
	var Options = "dependent=no,height="+height+",width="+width+",hotkeys=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no";

	if(!modeless)
		PopupWindow = open(URL, "PopupWindow", Options);
	else
	{
		PopupWindowModeless = open(URL, "_blank", Options);
	}
}

function popupWindow(URL,height,width,modeless) {
//	var URL = PathToRoot + "Store/Index.cfm?Render=Cart_Add_PopupCart&Spec_ID=" + form.Spec_ID.value + "&Quantity=" + form.Quantity.value;
	var Options = "dependent=no,height="+height+",width="+width+",hotkeys=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no";

	popupWindowResizable(URL,height,width,modeless);
	return;
	
	if(!modeless)
		PopupWindow = open(URL, "PopupWindow", Options);
	else
	{
		PopupWindowModeless = open(URL, "_blank", Options);
	}
}

function popupWindowResizable(URL,height,width,modeless) {
//	var URL = PathToRoot + "Store/Index.cfm?Render=Cart_Add_PopupCart&Spec_ID=" + form.Spec_ID.value + "&Quantity=" + form.Quantity.value;

	var Options = "dependent=no,height="+height+",width="+width+",hotkeys=no,menubar=yes,resizable=yes,scrollbars=yes,status=no,toolbar=no";

	if(!modeless)
		PopupWindow = open(URL, "PopupWindow", Options);
	else
	{
		PopupWindowModeless = open(URL, "_blank", Options);
	}
}

function popupWindowString(string,height,width,modeless) {
//	var URL = PathToRoot + "Store/Index.cfm?Render=Cart_Add_PopupCart&Spec_ID=" + form.Spec_ID.value + "&Quantity=" + form.Quantity.value;
	var Options = "dependent=no,height="+height+",width="+width+",hotkeys=no,menubar=yes,resizable=yes,scrollbars=yes,status=no,toolbar=no";

	if(!modeless)
	{	
		PopupWindow = open('', "PopupWindow", Options);
		PopupWindow.document.write(string);
		PopupWindow.document.close();
	}
	else
	{
		PopupWindowModeless = open('', "_blank", Options);
		PopupWindowModeless.document.write(string);
		PopupWindowModeless.document.close();
	}
}

function killPopupWindow() {
	if (PopupWindow != null && PopupWindow.closed == false)
		PopupWindow.close();
	if (top.newWin != null && top.newWin.closed == false)
		top.newWin.close();
}

function clickToEnlarge(height,width,url) {
//	popupWindow(url,height+20,width+20,false);
	popupWindowResizable(url,height,width,false);
}

onfocus = killPopupWindow;
