function openWindow(url, width, height)
{
	var popup = window.open(url,"shoppingcart","menubar=no,toolbar=yes,location=no,directories=no,status=no,left=0,top=0,scrollbars=yes,width=" + width + ",height=" + height);
    popup.focus();
}

//¸´ÏÈ¿òÈ«Ñ¡
function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		e.checked == true ? e.checked = false : e.checked = true;
	}
}

titleDropListUpImg = new Image();
titleDropListDownImg = new Image();
titleDropListUpImg.src = "/admin/images/title_droplist_up.gif";
titleDropListDownImg.src = "/admin/images/title_droplist_down.gif";
function titleDropList(e, self){
	if("none" == e.style.display){
		e.style.display = "";
		self.src = titleDropListUpImg.src;
	}else{
		e.style.display = "none";	
		self.src = titleDropListDownImg.src;
	}
}



//----------- float message class start ------------//
/**
   Class Object function
 */
function floatMsg(floatBoxID, contentLabelID, bgColor){
	this.brOK = navigator.javaEnabled()?true:false
	this.ns4 = (document.layers)?true:false
	this.ie4 = (document.all)?true:false

	//property
	this.floatBoxID = "";
	this.floatBoxShadowID = "";
	this.contentLabelID = "";
	this.contentLabelShadowID = "";
	this.floatBox = null;
	this.floatBoxShadow = null;
	this.contentLabel = null;
	this.contentLabelShadow = null;
	this.bgColor = "";

	//member function
	this.floatConfig = floatConfig;
	this.floatShow = floatShow;
	this.floatHidden = floatHidden;
	this.floatFill = floatFill;
	this.floatPreDraw = floatPreDraw;

	//initialize
	this.floatConfig(floatBoxID, contentLabelID, bgColor);
	this.floatPreDraw();

	if(!this.ns4){
		this.floatBox = document.all[this.floatBoxID];
		this.floatBoxShadow = document.all[this.floatBoxShadowID];
		this.contentLabel = document.all[this.contentLabelID];
		this.contentLabelShadow = document.all[this.contentLabelShadowID];
	}else{
		this.floatBox = document.layers[this.floatBoxID];
		this.floatBoxShadow = document.layers[this.floatBoxShadowID];
		this.contentLabel = document.layers[this.contentLabelID];
		this.contentLabelShadow = document.layers[this.contentLabelShadowID];	
	}
}

function floatConfig(floatBoxID, contentLabelID, bgColor){
	if("" == floatBoxID || "undefined" == floatBoxID || null == floatBoxID) floatBoxID = "_calendarFloatBox";
	if("" == contentLabelID || "undefined" == contentLabelID || null == contentLabelID) contentLabelID = "_calendarContentLabel";
	if("" == bgColor || "undefined" == bgColor || null == bgColor) bgColor = "#FFFFFF";
	this.floatBoxID = floatBoxID;
	this.contentLabelID = contentLabelID;
	this.contentLabelShadowID = this.contentLabelID + "Shadow";
	this.floatBoxShadowID = this.floatBoxID + "Shadow";
	this.bgColor = bgColor;
}

function floatPreDraw(){
	table = "<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=0 BGCOLOR=\"#000000\">\n" +
			"<TR>\n<TD>\n" +
			"<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=4 WIDTH=\"100%\" BGCOLOR=\"" + this.bgColor + "\">\n" +
			"<TR>\n" +
			"<TD>\n<FONT face=\"verdana,arial\" size=\"1\" COLOR=\"black\"><SPAN ID=" + this.contentLabelID + "></SPAN></TD>\n" +
			"<TD WIDTH=12 VALIGN=top><INPUT TYPE=button VALUE='X' STYLE='font-size:8pt;' ONCLICK='javascript:{" + this.floatBoxID + ".style.visibility = \"hidden\"; " + this.floatBoxShadowID + ".style.visibility = \"hidden\";}'></TD>\n" +
			"</TR>\n" +
			"</TABLE>\n" +
			"</TD>\n" +
			"</TR>\n" +
			"</TABLE>\n";
	table1 = "<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=0>\n" +
			"<TR>\n<TD>\n" +
			"<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=4 WIDTH=\"100%\" BGCOLOR=\"#808080\">\n" +
			"<TR>\n" +
			"<TD>\n<FONT face=\"verdana,arial\" size=\"1\" COLOR=\"black\"><SPAN ID=" + this.contentLabelShadowID + "></SPAN></TD>\n" +
			"<TD WIDTH=12 VALIGN=top><INPUT TYPE=button VALUE='X' STYLE='font-size:8pt;'></TD>\n" +
			"</TR>\n" +
			"</TABLE>\n" +
			"</TD>\n" +
			"</TR>\n" +
			"</TABLE>\n";

	if(this.ns4){
		document.write('<layer id="' + this.floatBoxShadowID + '" visibility="hide">' + table1 + '<\/layer>');
		document.write('<layer id="' + this.floatBoxID + '" visibility="hide">' + table + '<\/layer>');
	}else{
		document.write('<div id="' + this.floatBoxShadowID + '" style="position:absolute; visibility:hidden; ">' + table1 + '<\/div>');
		document.write('<div id="' + this.floatBoxID + '" style="position:absolute; visibility:hidden; ">' + table + '<\/div>');
	}
}

function floatShow(message, width, height){
	if(this.brOK){
		this.floatFill(message);
		var floatBoxShadowLeft, floatBoxShadowRight, floatBoxShadowTop, floatBoxShadowBottom;
		var floatBoxLeft, floatBoxRight, floatBoxTop, floatBoxBottom;
		var bodyRight, bodyBottom;
		floatBoxShadowWidth = width;
		floatBoxShadowHeight = height;
		floatBoxWidth = width;
		floatBoxHeight = height;
		if(this.ns4){
			if("" != width && "undefined" != width && null != width) this.floatBoxShadow.width = width;
			if("" != height && "undefined" != height && null != height) this.floatBoxShadow.height = height;
			this.floatBoxShadow.visibility = "show";
			if(event) this.floatBoxShadow.left = event.clientX + 10;
			if(event) this.floatBoxShadow.top = event.clientY + 10;

			if("" != width && "undefined" != width && null != width) this.floatBox.width = width;
			if("" != height && "undefined" != height && null != height) this.floatBox.height = height;
			this.floatBox.visibility = "show";
			if(event) this.floatBox.left = event.clientX + 10;
			if(event) this.floatBox.top = event.clientY + 10;
		}else{
			//if("" != width && "undefined" != width && null != width) this.floatBoxShadow.style.width = width;
			//if("" != height && "undefined" != height && null != height) this.floatBoxShadow.style.height = height;

			//if("" != width && "undefined" != width && null != width) this.floatBox.style.width = width;
			//if("" != height && "undefined" != height && null != height) this.floatBox.style.height = height;

			this.floatBox.style.visibility = "visible";
			this.floatBoxShadow.style.visibility = "visible";
			//floatBoxLeft = document.body.scrollLeft + event.clientX;
			//floatBoxTop = document.body.scrollTop + event.clientY;
//alert(event);
			if(event){
				leftEdge = event.clientX;
				rightEdge = document.body.clientWidth - event.clientX;
				topEdge = event.clientY;
				bottomEdge = document.body.clientHeight - event.clientY;

				if(this.floatBox.offsetWidth > rightEdge && rightEdge < leftEdge){
					this.floatBox.style.left = document.body.scrollLeft + event.clientX - this.floatBox.offsetWidth;
					this.floatBoxShadow.style.left = document.body.scrollLeft + event.clientX - this.floatBox.offsetWidth + 5;
				}else{
					this.floatBox.style.left = document.body.scrollLeft + event.clientX;
					this.floatBoxShadow.style.left = document.body.scrollLeft + event.clientX + 5;
				}

				if(this.floatBox.offsetHeight > bottomEdge && bottomEdge < topEdge){
					this.floatBox.style.top = document.body.scrollTop + event.clientY - this.floatBox.offsetHeight;
					this.floatBoxShadow.style.top = document.body.scrollTop + event.clientY - this.floatBox.offsetHeight + 5;
				}else{
					this.floatBox.style.top = document.body.scrollTop + event.clientY;
					this.floatBoxShadow.style.top = document.body.scrollTop + event.clientY + 5;
				}
			}
		}
	}
}

function floatHidden(){
	if(this.brOK){
		if(this.ns4){
			this.floatBox.visibility = "hide";
			this.floatBoxShadow.visibility = "hide";
		}else{
			this.floatBox.style.visibility = "hidden";
			this.floatBoxShadow.style.visibility = "hidden";
		}
	}
}

function floatFill(message){
	// Replace the contents of the tooltip
	if (!this.ns4){
		this.contentLabel.innerHTML = message;
		this.contentLabelShadow.innerHTML = message;
		this.contentLabelShadow.style.visibility = "hidden";
	}else {
		// In NS, insert a table to work around
		// stylesheet rendering bug.
		// NS fails to apply style sheets when writing
		// contents into a positioned element.
		this.contentLabel.document.open();
		this.contentLabel.document.write(message);
		this.contentLabel.document.close();
		this.contentLabelShadow.document.open();
		this.contentLabelShadow.document.write(message);
		this.contentLabelShadow.document.close();
		this.contentLabelShadow.visibility = "hide";
	}
}
//----------- float message class end ------------//