String.prototype.trim = function() {
	return this.replace(/(^\s*)|(\s*$)/g, "");
}

String.prototype.byte = function() {
var cnt = 0;
	for (var i = 0; i < this.length; i++) {
		if (this.charCodeAt(i) > 127)
			cnt += 2;
		else
			cnt++;
	}
	return cnt;
}

var email = function(){
	GZ.$('email2').value = GZ.$('email3').value;
	if(GZ.$('email3').value == ""){
		GZ.$('email2').readOnly = false;
		GZ.$('email2').focus();
	}else{
		GZ.$('email2').readOnly = true;
	}
}

var sameAdd = function(){
	GZ.$('reserv_name').value = GZ.$('pre_reserv_name').value;
	GZ.$('sbStep1_zip3').value = GZ.$('sbStep1_zip1').value;
	GZ.$('sbStep1_zip4').value = GZ.$('sbStep1_zip2').value;
	GZ.$('sbStep1_addr3').value = GZ.$('sbStep1_addr1').value;
	GZ.$('sbStep1_addr4').value = GZ.$('sbStep1_addr2').value;

	GZ.$('h_p1').value = GZ.$('pre_h_p1').value;
	GZ.$('h_p2').value = GZ.$('pre_h_p2').value;
	GZ.$('h_p3').value = GZ.$('pre_h_p3').value;
	GZ.$('s_p1').value = GZ.$('pre_s_p1').value;
	GZ.$('s_p2').value = GZ.$('pre_s_p2').value;
	GZ.$('s_p3').value = GZ.$('pre_s_p3').value;
}


var newAdd = function(){
	GZ.$('reserv_name').value = "";
	GZ.$('sbStep1_zip3').value = "";
	GZ.$('sbStep1_zip4').value = "";
	GZ.$('sbStep1_addr3').value = "";
	GZ.$('sbStep1_addr4').value = "";

	GZ.$('h_p1').value = "";
	GZ.$('h_p2').value = "";
	GZ.$('h_p3').value = "";
	GZ.$('s_p1').value = "";
	GZ.$('s_p2').value = "";
	GZ.$('s_p3').value = "";
}
var flag_cau = false;

var FormSubmit = function(){
	if(GZ.$('pre_zip_code1').value == ""){
		alert("¿ìÆí¹øÈ£¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
	}else if(isNaN(GZ.$('pre_zip_code1').value)){
		alert("¿ìÆí¹øÈ£°¡ Àß¸ø ÀÔ·ÂµÇ ÀÖ½À´Ï´Ù.");
	}else if(GZ.$('pre_zip_code2').value == ""){
		alert("¿ìÆí¹øÈ£¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
	}else if(isNaN(GZ.$('pre_zip_code2').value)){
		alert("¿ìÆí¹øÈ£°¡ Àß¸ø ÀÔ·ÂµÇ ÀÖ½À´Ï´Ù.");
	}else if(GZ.$('pre_addr1').value == ""){
		alert("ÁÖ¼Ò¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
	}else if(GZ.$('pre_addr2').value.trim() == ""){
		alert("»ó¼¼ ÁÖ¼Ò¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('pre_addr2').value ="";
		GZ.$('pre_addr2').focus();
	}else if(GZ.$('email1').value == ""){
		alert("emailÀ» µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('email1').focus();
	}else if(GZ.$('email2').value == ""){
		alert("emailÀ» µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('email2').focus();
	}else if(GZ.$('pre_h_p2').value == ""){
		alert("ÀÚÅÃ¹øÈ£ µÎ¹øÂ° ¹øÈ£¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('pre_h_p2').focus();
	}else if(isNaN(GZ.$('pre_h_p2').value)){
		alert("ÀÚÅÃ¹øÈ£ µÎ¹øÂ° ¹øÈ£´Â ¼ýÀÚ¸¸ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('pre_h_p2').focus();
	}else if(GZ.$('pre_h_p2').value.length <3){
		alert("ÀÚÅÃ¹øÈ£ µÎ¹øÂ° ¹øÈ£´Â 3ÀÚÀÌ»ó µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('pre_h_p2').focus();
	}else if(GZ.$('pre_h_p3').value == ""){
		alert("ÀÚÅÃ¹øÈ£ ¼¼¹øÂ° ¹øÈ£¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('pre_h_p3').focus();
	}else if(isNaN(GZ.$('pre_h_p3').value)){
		alert("ÀÚÅÃ¹øÈ£ ¼¼¹øÂ° ¹øÈ£´Â ¼ýÀÚ¸¸ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('pre_h_p3').focus();
	}else if(GZ.$('pre_h_p3').value.length <3){
		alert("ÀÚÅÃ¹øÈ£ ¼¼¹øÂ° ¹øÈ£´Â 3ÀÚÀÌ»ó µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('pre_h_p3').focus();
	}else if(GZ.$('pre_s_p2').value == ""){
		alert("ÈÞ´ëÆù¹øÈ£ µÎ¹øÂ° ¹øÈ£¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('pre_s_p2').focus();
	}else if(isNaN(GZ.$('pre_s_p2').value)){
		alert("ÈÞ´ëÆù¹øÈ£ µÎ¹øÂ° ¹øÈ£´Â ¼ýÀÚ¸¸ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('pre_s_p2').focus();
	}else if(GZ.$('pre_s_p2').value.length <3){
		alert("ÈÞ´ëÆù¹øÈ£ µÎ¹øÂ° ¹øÈ£´Â 3ÀÚÀÌ»ó µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('pre_s_p2').focus();
	}else if(GZ.$('pre_s_p3').value == ""){
		alert("ÈÞ´ëÆù¹øÈ£ ¼¼¹øÂ° ¹øÈ£¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('pre_s_p3').focus();
	}else if(isNaN(GZ.$('pre_s_p3').value)){
		alert("ÈÞ´ëÆù¹øÈ£ ¼¼¹øÂ° ¹øÈ£´Â ¼ýÀÚ¸¸ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('pre_s_p3').focus();
	}else if(GZ.$('pre_s_p3').value.length <3){
		alert("ÈÞ´ëÆù¹øÈ£ ¼¼¹øÂ° ¹øÈ£´Â 3ÀÚÀÌ»ó µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('pre_s_p3').focus();

	}else if(GZ.$('zip_code1').value == ""){
		alert("¿ìÆí¹øÈ£¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
	}else if(isNaN(GZ.$('zip_code1').value)){
		alert("¿ìÆí¹øÈ£°¡ Àß¸ø ÀÔ·ÂµÇ ÀÖ½À´Ï´Ù.");
	}else if(GZ.$('zip_code2').value == ""){
		alert("¿ìÆí¹øÈ£¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
	}else if(isNaN(GZ.$('zip_code2').value)){
		alert("¿ìÆí¹øÈ£°¡ Àß¸ø ÀÔ·ÂµÇ ÀÖ½À´Ï´Ù.");
	}else if(GZ.$('addr1').value == ""){
		alert("ÁÖ¼Ò¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
	}else if(GZ.$('addr2').value.trim() == ""){
		alert("»ó¼¼ ÁÖ¼Ò¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('addr2').value ="";
		GZ.$('addr2').focus();
	}else if(GZ.$('h_p2').value == ""){
		alert("ÀÚÅÃ¹øÈ£ µÎ¹øÂ° ¹øÈ£¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('h_p2').focus();
	}else if(isNaN(GZ.$('h_p2').value)){
		alert("ÀÚÅÃ¹øÈ£ µÎ¹øÂ° ¹øÈ£´Â ¼ýÀÚ¸¸ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('h_p2').focus();
	}else if(GZ.$('h_p2').value.length <3){
		alert("ÀÚÅÃ¹øÈ£ µÎ¹øÂ° ¹øÈ£´Â 3ÀÚÀÌ»ó µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('h_p2').focus();
	}else if(GZ.$('h_p3').value == ""){
		alert("ÀÚÅÃ¹øÈ£ ¼¼¹øÂ° ¹øÈ£¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('h_p3').focus();
	}else if(isNaN(GZ.$('h_p3').value)){
		alert("ÀÚÅÃ¹øÈ£ ¼¼¹øÂ° ¹øÈ£´Â ¼ýÀÚ¸¸ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('h_p3').focus();
	}else if(GZ.$('h_p3').value.length <3){
		alert("ÀÚÅÃ¹øÈ£ ¼¼¹øÂ° ¹øÈ£´Â 3ÀÚÀÌ»ó µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('h_p3').focus();
	}else if(GZ.$('s_p2').value == ""){
		alert("ÈÞ´ëÆù¹øÈ£ µÎ¹øÂ° ¹øÈ£¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('s_p2').focus();
	}else if(isNaN(GZ.$('s_p2').value)){
		alert("ÈÞ´ëÆù¹øÈ£ µÎ¹øÂ° ¹øÈ£´Â ¼ýÀÚ¸¸ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('s_p2').focus();
	}else if(GZ.$('s_p2').value.length <3){
		alert("ÈÞ´ëÆù¹øÈ£ µÎ¹øÂ° ¹øÈ£´Â 3ÀÚÀÌ»ó µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('s_p2').focus();
	}else if(GZ.$('s_p3').value == ""){
		alert("ÈÞ´ëÆù¹øÈ£ ¼¼¹øÂ° ¹øÈ£¸¦ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('s_p3').focus();
	}else if(isNaN(GZ.$('s_p3').value)){
		alert("ÈÞ´ëÆù¹øÈ£ ¼¼¹øÂ° ¹øÈ£´Â ¼ýÀÚ¸¸ µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('s_p3').focus();
	}else if(GZ.$('s_p3').value.length <3){
		alert("ÈÞ´ëÆù¹øÈ£ ¼¼¹øÂ° ¹øÈ£´Â 3ÀÚÀÌ»ó µî·ÏÇØ ÁÖ½Ê½Ã¿À");
		GZ.$('s_p3').focus();
	}
}

var check_cau = function(obj){
	if(flag_cau == false){
		obj.value = "";
		flag_cau = true;
	}
}


var changeBG = function(obj){
	if(obj.src.indexOf("off")>-1){
		obj.src = obj.src.replace("off","on");
	}else{
		obj.src = obj.src.replace("on","off");
	}
}

function mouseover(e, obj) {
    var from = e?e.relatedTarget:event.fromElement; 
    while(from) { 
        if(from == obj) return; 
        from = from.parentNode; 
    }
	GZ.$('bg_navi').src = "images/b2c/btn_b2c_navi_on.gif";
		//obj.src = obj.src.replace("off","on");

} 

function mouseout(e, obj) {
    var to = e?e.relatedTarget:event.toElement; 
    while(to) { 
        if(to == obj) return; 
        to = to.parentNode; 
    }
	GZ.$('bg_navi').src = "images/b2c/btn_b2c_navi_off.gif";
	//obj.src = obj.src.replace("on","off");
} 

//¿ìÃø¿µ¿ªÀÇ ³ôÀÌ °è»ê
var minHeight;
var marginB = 10;			//¿ìÃø ÄÃ·º¼Ç°£ °øÅë ¿©¹é
function getRightAreaHeight(){
	minHeight = 40;		//¹Ì´Ï´ÙÀ½, ·Î°í, °Ë»öÃ¢ ³ôÀÌÀÇ ÇÕ
	return minHeight;
}

var rightArea_scroll_act = true;
var topSpace, bottomSpace;
function pre_MoveBox(){	
	var recomKW_b_num = GetkwNum('recomKW_b');		// ÀÚÅ°ÃßÃµÅ°¿öµå ³ëÃâ °¹¼ö
	
	//È®Àå°Ë»ö¾î³ª ÃßÃµÅ°¿öµå Áß ÇÏ³ª¸¸ ³ª¿Ã °æ¿ì & Å°¿öµå ³ëÃâ °¹¼ö¿¡ µû¸¥ À§Ä¡ Á¶Á¤
	
	if(GZ.$('recomKW_b')){
		topSpace = 82 + 10 + (recomKW_b_num * 22);	// À§ÂÊ À§Ä¡
		bottomSpace = 82 + 10 +(recomKW_b_num * 22);	// ÇÏ´Ü¿¡¼­ÀÇ °íÁ¤ À§Ä¡°ª		
	}
	MoveBox();
}

function GetkwNum(el){
	if(document.getElementById(el) != null)
		num = GZ.$(el).getElementsByTagName("a").length;			
	else
		num = 0;	
	return num;
}


function init_recomKW(){
	if(!GZ.$("recomKW")){
		return false;
	}else{
		getRightAreaHeight();
		var recomHeight = 0;
				
		if(GZ.$('recomKW_b')){
//			recomKW_bNum = GZ.$('recomKW_b').getElementsByTagName("a").length;
//			recomHeight += 42 + 22 * recomKW_bNum + marginB;
			recomHeight += 42 + 22  + marginB;
		}
		var bottomSpace = 0;

		if(document.body.scrollHeight-bottomSpace <= minHeight + recomHeight){
			GZ.$('recomKW').style.position = 'relative';
			GZ.$('recomKW').style.height = recomHeight+"px";
			GZ.$('recomKW').style.marginBottom = 10;
		}else{
			GZ.$('recomKW').style.top = minHeight+"px";
			GZ.$('recomKW').style.visibility = "visible";
			pre_MoveBox();
		}
		return true;
	}
}


function MoveBox(){
	getRightAreaHeight();

	var yFrom, yTo, yOffset;	
	var pageH = document.documentElement.scrollHeight;
	var scrollT = document.documentElement.scrollTop;
	var clientH = document.documentElement.clientHeight;
	var timeout = 100;
	var el_recomKW = GZ.$("recomKW");

	var recomKW_top;
	if(rightArea_scroll_act){
	//»ó´Ü °Ë»ö¹Ù ¿µ¿ª¿¡ divÀÇ topÀÌ °áÁ¤(?)µÇ¸é À§Ä¡ °íÁ¤À¸·Î ÁöÁ¤
		
		yFrom = parseInt (el_recomKW.style.top, 10);	//recomKW.style.top¸¦ 10Áø¼ö·Î ÆÄ½Ì	
		yTo   = scrollT -  topSpace;		// À§ÂÊ À§Ä¡

		if(scrollT == 0){	
			GZ.$('recomKW').style.top = minHeight+"px";
		}else if((pageH - (scrollT+clientH) <= 112) || (pageH - (scrollT+clientH) == 0)){
			GZ.$('recomKW').style.top = pageH-clientH-170+"px";
//			el_recomKW.style.top = clientH - bottomSpace-170+"px"; //ÃÖÇÏ´Ü¿¡¼­ ¶³¾îÁö´Â À§Ä¡ Á¶Á¤.
			timeout = 20;
		}else{
			if (yFrom != yTo){
				yOffset = Math.ceil(Math.abs( yTo - yFrom ) / 20);
				if (yTo < yFrom)
					yOffset = -yOffset;
								
				recomKW_top = parseInt(el_recomKW.style.top, 10) + yOffset;
				timeout = 20;				
				
				//¿ìÃø ÄÁÅÙÃ÷ÀÇ ÇÏ´Ü¿¡ ³ª¿Àµµ·Ï...
				if(minHeight >= parseInt(recomKW_top)){
					el_recomKW.style.top  = minHeight+"px";
				}else{
					el_recomKW.style.top = recomKW_top+"px";
				}
			}
		}
	}
	setTimeout ("MoveBox()", timeout);
}


// 2009.05.11 ¿ÂÀÎ¼± Ãß°¡
// °ø°¨UP
function setRecommend(wishNo) {
	var recommDoc = document.recommActForm;
	recommDoc.wishNo.value = wishNo;
	recommDoc.submit();
}

// °®°í½Í´Ù º¸±â
function showWishList(pdtWeekNo, isWishShow, currentPage) {
	if (isWishShow == "True") {
		var url = "/golping/bbs/wish/wish_proc.asp";
		var params = "pdtWeekNo=" + pdtWeekNo + "&currentPage=" + currentPage + "&isWishShow=" + isWishShow;
		new parent.Ajax.Request (
			url,
			{
				parameters	: params,
				onSuccess	: function (res){
					parent.$('wishListContainer').innerHTML = res.responseText;
				},
				onFailure	: function (res){
					alert("Ajax Åë½Å½ÇÆÐ\n" + res.responseText);
				}
			}
		);
	}
}

// °®°í½Í´Ù ÄÚ¸àÆ® µî·Ï
function addComment(wishNo) {
	if (checkLogin())
	{
		var commentDoc = document.commentActForm;
		var textArea = parent.document.getElementById("replyText_" + wishNo);

		if (textArea.value == "ÃÖ´ë ÇÑ±Û 300ÀÚ, ¿µ¹® 600ÀÚ±îÁö ÀÛ¼º °¡´ÉÇÕ´Ï´Ù." || String(textArea.value).strip() == "")
		{
			alert("´ñ±Û ³»¿ëÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
			return false;
		}

		commentDoc.mode.value = "ADD";
		commentDoc.wishNo.value = wishNo;

		var url = "/golping/bbs/wish/comment_wish_proc.asp?mode=ADD&wishNo=" + wishNo + "&contents=" + escape(textArea.value);
		jx.bind({
			"url":url,
			"onSuccess":function (res) {
				parent.$('cmtbox_' + wishNo).innerHTML = res;
			},
			"onError":function(res){alert("Ajax Åë½Å½ÇÆÐ\n" + res);},
			"format":'text',
			"method":'post'
		});
	}
}

// °®°í½Í´Ù ÄÚ¸àÆ® »èÁ¦
function delComment(wishNo, commentNo) {
	if (checkLogin())
	{
		var commentDoc = document.commentActForm;

		commentDoc.mode.value = "DEL";
		commentDoc.wishNo.value = wishNo;
		commentDoc.commentNo.value = commentNo;

		var url = "/golping/bbs/wish/comment_wish_proc.asp?mode=DEL&wishNo=" + wishNo + "&commentNo=" + commentNo;
		jx.bind({
			"url":url,
			"onSuccess":function (res) {
				parent.$('cmtbox_' + wishNo).innerHTML = res;
			},
			"onError":function(res){alert("Ajax Åë½Å½ÇÆÐ\n" + res);},
			"format":'text',
			"method":'post'
		});
	}
}

// Áö³­»óÇ° ¹Ù·Î°¡±â
function goPassProduct(pdtWeekNo, isDirectLink) {
	var pdtControlFrm = document.pdtControlFrm;
	if (pdtWeekNo != "" && typeof(pdtWeekNo) != "undefined" && typeof(pdtControlFrm) != "undefined")
	{
		pdtControlFrm.pdtWeekNo.value = pdtWeekNo;
		$('GZShopNavigator').getWeek(pdtWeekNo, isDirectLink);		// flash callback
		// flash·Î ÄÁÆ®·Ñ ±ÇÇÑ ³Ñ±è.
		//menuShop('index');
	}
}

// »ç¿ë±â º¸±â
function showReviewList(pdtWeekNo, currentPage) {
	var url = "/golping/index_review_proc.asp";
	var params = "pdtWeekNo=" + pdtWeekNo + "&currentPage=" + currentPage;
	new parent.Ajax.Request (
		url,
		{
			parameters	: params,
			onSuccess	: function (res){
				parent.$('productReview').innerHTML = res.responseText;
			},
			onFailure	: function (res){
				alert("Ajax Åë½Å½ÇÆÐ\n" + res.responseText);
			}
		}
	);
}

// »ç¿ë±â »èÁ¦
function delReview(reviewNo) {
	if (checkLogin())
	{
		var pdtWeekNo = document.pdtControlFrm.pdtWeekNo.value;

		if (pdtWeekNo.strip() == "" || !pdtWeekNo)
		{
			alert("ÁÖ°£»óÇ° ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
			return false;
		}

		if (!reviewNo)
		{
			alert("»èÁ¦ÇÒ »óÇ°¹®ÀÇ °Ô½Ã¹° ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
			return false;
		}

		var url = "/golping/index_review_proc.asp?mode=DEL&pdtWeekNo=" + pdtWeekNo + "&reviewNo=" + reviewNo;

		jx.bind({
			"url":url,
			"onSuccess":function (res) {
				parent.$('productReview').innerHTML = res;
			},
			"onError":function(res){alert("Ajax Åë½Å½ÇÆÐ\n" + res);},
			"format":'text',
			"method":'post'
		});
	}
}

// »óÇ°¹®ÀÇ µî·Ï ÇÃ·¡±× ¼³Á¤
var qna = false;
function checkAddQnaFlag(){
	qna = true;
}

// »óÇ°¹®ÀÇ µî·Ï
function showQnaList(pdtWeekNo, currentPage) {
	var url = "/golping/index_qna_proc.asp";
	var params = "pdtWeekNo=" + pdtWeekNo + "&currentPage=" + currentPage;
	new parent.Ajax.Request (
		url,
		{
			parameters	: params,
			onSuccess	: function (res){
				parent.$('productQna').innerHTML = res.responseText;
			},
			onFailure	: function (res){
				alert("Ajax Åë½Å½ÇÆÐ\n" + res.responseText);
			}
		}
	);
}

// »óÇ°¹®ÀÇ µî·Ï
function addQna() {
	if (checkLogin())
	{
		var pdtWeekNo = document.pdtControlFrm.pdtWeekNo.value;
		var contents = document.getElementById("qna_textarea");

		if (pdtWeekNo.strip() == "" || !pdtWeekNo)
		{
			alert("ÁÖ°£»óÇ° ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
			return false;
		}
		
		// ³»¿ë Ã¼Å© Ãß°¡
		if (contents.value == "ÃÖ´ë ÇÑ±Û 300ÀÚ, ¿µ¹® 600ÀÚ±îÁö ÀÛ¼º °¡´ÉÇÕ´Ï´Ù." || String(contents.value).strip() == "")
		{
			alert("¹®ÀÇ ³»¿ëÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
			return false;
		}

		var url = "/golping/index_qna_proc.asp?mode=ADD&question=" + escape(contents.value) + "&pdtWeekNo=" + pdtWeekNo;

		jx.bind({
			"url":url,
			"onSuccess":function (res) {
				parent.$('productQna').innerHTML = res;
			},
			"onError":function(res){alert("Ajax Åë½Å½ÇÆÐ\n" + res);},
			"format":'text',
			"method":'post'
		});
	}
}

// »óÇ°¹®ÀÇ »èÁ¦
function delQna(qnaNo) {
	if (checkLogin())
	{
		var pdtWeekNo = document.pdtControlFrm.pdtWeekNo.value;

		if (pdtWeekNo.strip() == "" || !pdtWeekNo)
		{
			alert("ÁÖ°£»óÇ° ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
			return false;
		}

		if (!qnaNo)
		{
			alert("»èÁ¦ÇÒ »óÇ°¹®ÀÇ °Ô½Ã¹° ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
			return false;
		}

		var url = "/golping/index_qna_proc.asp?mode=DEL&pdtWeekNo=" + pdtWeekNo + "&qnaNo=" + qnaNo;

		jx.bind({
			"url":url,
			"onSuccess":function (res) {
				parent.$('productQna').innerHTML = res;
			},
			"onError":function(res){alert("Ajax Åë½Å½ÇÆÐ\n" + res);},
			"format":'text',
			"method":'post'
		});
	}
}

// ÃÖÀú°¡ ½Å°í µî·Ï
var reply = false;
function checkLowPriceFlag(){
	reply = true;
}

function addLowPrice() {
	if (checkLogin())
	{
		var pdtWeekNo = document.pdtControlFrm.pdtWeekNo.value;
		var contents = document.getElementById("lowPrice_textarea");
		if(reply == false){
			alert("ÃÖÀú°¡½Å°í ³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			return false;
		}

		if (pdtWeekNo.strip() == "" || !pdtWeekNo)
		{
			alert("ÁÖ°£»óÇ° ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
			return false;
		}

		if (contents.value.strip() == "" || !contents.value)
		{
			alert("½Å°íÇÒ »çÀÌÆ® ÁÖ¼Ò¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
			contents.focus();
			return false;
		}

		var url = "/golping/index_lowPriceReport_proc.asp?mode=ADD&pdtWeekNo=" + pdtWeekNo + "&contents=" + escape(contents.value);
		jx.bind({
			"url":url,
			"onSuccess":function (res) {
				parent.$('productLowPriceReport').innerHTML = res;
			},
			"onError":function(res){alert("Ajax Åë½Å½ÇÆÐ\n" + res);},
			"format":'text',
			"method":'post'
		});
	}
}

// ÃÖÀú°¡ ½Å°í »èÁ¦
function delLowPrice(lowPriceNo) {
	if (checkLogin())
	{
		var pdtWeekNo = document.pdtControlFrm.pdtWeekNo.value;

		if (pdtWeekNo.strip() == "" || !pdtWeekNo)
		{
			alert("ÁÖ°£»óÇ° ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
			return false;
		}

		if (!lowPriceNo)
		{
			alert("»èÁ¦ÇÒ ÃÖÀú°¡ ½Å°í °Ô½Ã¹° ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
			return false;
		}

		var url = "/golping/index_lowPriceReport_proc.asp?mode=DEL&pdtWeekNo=" + pdtWeekNo + "&lowPriceNo=" + lowPriceNo;
		jx.bind({
			"url":url,
			"onSuccess":function (res) {
				parent.$('productLowPriceReport').innerHTML = res;
			},
			"onError":function(res){alert("Ajax Åë½Å½ÇÆÐ\n" + res);},
			"format":'text',
			"method":'post'
		});
	}
}

/* B2C SHOP */
function menuShop(linkName, pdtWeekNo2) {
	GZ.setCookie("menu_pre",linkName ,"0");
	GZ.setCookie("menu_pre",GZ.getCookie("menu_pre") ,"0");

	var pdtControlFrm = document.pdtControlFrm;
	var pdtWeekNo = "";

	if (pdtWeekNo2 != "undefined" && String(pdtWeekNo2).length == 6)
	{
		pdtControlFrm.pdtWeekNo.value = pdtWeekNo2;
	}

	pdtWeekNo = pdtControlFrm.pdtWeekNo.value;

	// ¸Þ´º»óÅÂ À¯Áö ÄíÅ°
	if (GZ.getCookie("linkname")!=""){
		linkname = GZ.getCookie("linkname");
		if(GZ.getCookie("pdtWeekNo") == pdtWeekNo){
			pdtWeekNo = GZ.getCookie("pdtWeekNo");
		}
	}

	// select control »óÅÂ À¯ÁöÇÏ±â
	var selPdtObj = $('sel_pass_product');
	var selPdtObj2 = $('sel_pass_product2');
	for (var i = 2; i < selPdtObj.length ; i++)
	{
		if (selPdtObj[i].value == pdtWeekNo)
		{
			selPdtObj.selectedIndex = i;
			selPdtObj2.selectedIndex = i;
			break;
		}
	}
	
	// ´ÙÀ½ÁÖ »óÇ° Ã³¸®
	if (parseInt(pdtControlFrm.toWeekNo.value) < parseInt(pdtWeekNo))
	{
		linkName = (linkName == "index") ? "index_nextweek" : linkName;
		$('middleQuickMenu_0').style.display = "none";
		$('middleQuickMenu_1').style.display = "";
	} else {
		// ´ÙÀ½ÁÖ »óÇ°ÀÇ ¸Þ´º¸¦ ºÐ¸®ÇÑ´Ù.
		$('middleQuickMenu_0').style.display = "";
		$('middleQuickMenu_1').style.display = "none";
	}

	switch (linkName)
	{
		case "index":
			hiddenfrm.location.href = '/golping/PageContainers/index.asp?pdtWeekNo=' + pdtWeekNo;					// B2C INDEX

			// acecounter tracking
			//_PL(_UL('http://www.golfzon.com/golping/PageContainers/index.asp?pdtWeekNo=' + pdtWeekNo));
			break;
		case "index_nextweek":
			hiddenfrm.location.href = '/golping/PageContainers/index_nextweek.asp?pdtWeekNo=' + pdtWeekNo;			// B2C INDEX - ´ÙÀ½ÁÖ

			// acecounter tracking
			//_PL(_UL('http://www.golfzon.com/golping/PageContainers/index_nextweek.asp?pdtWeekNo=' + pdtWeekNo));
			break;
		case "mypage":
			if (checkLogin())
			{
				hiddenfrm.location.href = '/golping/PageContainers/mypage/mypage.asp?pdtWeekNo=' + pdtWeekNo;		// B2C ¸¶ÀÌÆäÀÌÁö

				// acecounter tracking
				//_PL(_UL('http://www.golfzon.com/golping/PageContainers/mypage/mypage.asp?pdtWeekNo=' + pdtWeekNo));
			}
			break;
		case "list_wish":
			hiddenfrm.location.href = '/golping/PageContainers/bbs/wish_list.asp?pdtWeekNo=' + pdtWeekNo;			// B2C °®°í½Í´Ù °Ô½ÃÆÇ

			// acecounter tracking
			//_PL(_UL('http://www.golfzon.com/golping/PageContainers/bbs/wish_list.asp?pdtWeekNo=' + pdtWeekNo));
			break;
		case "buy_step1":			
			if (checkLogin())
			{			
				hiddenfrm.location.href = '/golping/PageContainers/buy/buy_step1.asp?pdtWeekNo=' + pdtWeekNo;		// »óÇ°±¸¸Å

				// °áÁ¦ ActiveX Ã¼Å©
				initXPay();

				// acecounter tracking
				//_PL(_UL('http://www.golfzon.com/golping/PageContainers/buy/buy_step1.asp?pdtWeekNo=' + pdtWeekNo));
			}
			break;
	}
	GZ.setCookie("linkname", linkName, "0");
	GZ.setCookie("pdtWeekNo", pdtWeekNo, "0");

	// 2009.08.06 ¿ÂÀÎ¼±
	// °ñÇÎ ÁÖÂ÷º° ¸µÅ© Á¦°ø¿ë
	goPassProduct(pdtWeekNo, false);
}


var tabHref = function(_tab){
	if(GZ.getCookie("linkname") == "list_wish" || GZ.getCookie("linkname") == "mypage" || GZ.getCookie("linkname") == "buy_step1" || GZ.getCookie("linkname") == "buy_ok"){
		menuShop('index');
		try{
				var item = $(_tab.replace("#",""));
				Element.scrollTo(item); 
	/*			setTimeout(function(){
				var item = $(_tab.replace("#",""));
				Element.scrollTo(item); 
				var h = location.href.split("#");
				location.href = h[0]+_tab;
			},1000);				*/
		}
		catch (e){}
	}else{
		try{
			var item = $(_tab.replace("#",""));
			Element.scrollTo(item); 
/*
			setTimeout(function(){
				var item = $(_tab.replace("#",""));
				Element.scrollTo(item); 
			},1000);			*/
		}
		catch (e){}
	}
}


// ÇÃ·¡½Ã ÀÌ¹ÌÁö Å©°Ôº¸±â
function showProductLayer(layerPath) {
	new GZ.Modal(layerPath, {alt:'»óÇ°ÀÌ¹ÌÁö', opacity:70, status:'width:500 height:300'});
}

function setMainNavi(pdtWeekNo) {
	var swfTag = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='1000' height='336' id='GZShopNavigator' name='GZShopNavigator' align='middle'>";
	swfTag += "<param name='allowScriptAccess' value='always' />";
	swfTag += "<param name='allowFullScreen' value='true' />";
	swfTag += "<param name='movie' value='/flash/golping/GZShopNavigator.swf' />";
	swfTag += "<param name='FlashVars' value='pdtWeekNo=" + pdtWeekNo + "' />";
	swfTag += "<param name='wmode' value='transparent' />";
	swfTag += "<param name='menu' value='false' />";
	swfTag += "<param name='scaleMode' value='noScale' />";
	swfTag += "<param name='showMenu' value='false' />";
	swfTag += "<param name='align' value='CT' />";
	swfTag += "<param name='quality' value='high' />";
	swfTag += "<param name='bgcolor' value='#fff' />";
	swfTag += "<embed src='/flash/golping/GZShopNavigator.swf' FlashVars='pdtWeekNo=" + pdtWeekNo + "' wmode='transparent' menu='false' quality='high' bgcolor='#fff' width='1000' height='336' name='swfOrderPrice' id='swfOrderPrice' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	swfTag += "</object>";

	$('b2cMainNaviContainer').innerHTML = swfTag;
}

// »ç¿ë±â ±Û¾²±âÃ¢ ·±Ã³
function reviewLauncher() {
	if (checkLogin()) {
		var pdtControlFrm = document.pdtControlFrm;

		tabHref("#pdtReview");

		var ele = document.getElementById("btnReview");
		ele.href = "/golping/PageContainers/review_write_pop.asp?pdtWeekNo=" + pdtControlFrm.pdtWeekNo.value;
		return hs.htmlExpand(ele, { objectType: 'iframe', scrolling:1, width: 480, height:400, outlineType:null, align: 'center'} );
	}
}

// °®°í½Í´Ù µî·Ï
function AddWishWithFlag(pdtWeekNo) {
	// ´õºíÅ¬¸¯ ¹æÁö Flag ÃÊ±âÈ­
	$('addLimitFlag').value = 1;
	
	hs.cacheAjax = false;
	hs.preserveContent = false;

	var ele = document.getElementById("lnkAddObj");
	ele.href = "/golping/PageContainers/bbs/wish_write_pop.asp?pdtWeekNo=" + pdtWeekNo;
	return hs.htmlExpand(ele, { objectType: 'iframe', scrolling:1, width: 480, height:400, outlineType:null, align: 'center'} );
}

// »ç¿ë±â µî·Ï
function AddReviewWithFlag(pdtWeekNo) {
	// ´õºíÅ¬¸¯ ¹æÁö Flag ÃÊ±âÈ­
	$('addLimitFlag').value = 1;
	
	hs.cacheAjax = false;
	hs.preserveContent = false;

	var ele = document.getElementById("lnkAddObj");
	ele.href = "/golping/PageContainers/review_write_pop.asp?pdtWeekNo=" + pdtWeekNo;
	return hs.htmlExpand(ele, { objectType: 'iframe', scrolling:1, width: 480, height:400, outlineType:null, align: 'center'} );
}

GZ.Graph_B2C = function(id, setSc){
	this.id = id;
	this.setSc = setSc;
	this.left_title = '';
	this.num = '';
	this.m_result = '';
	this.w_result = '';
	for(var i=0;i<this.setSc.length;i++){
		this.left_title = this.setSc[0];
		this.num = this.setSc[1];
		this.m_result = this.setSc[2];
		this.w_result = this.setSc[3];
	}
};
GZ.Graph_B2C.prototype={
	print:function(){
		var s=this.skin();
	},
	skin:function(){
		var s =
		'<div class="gage_sex">'+
		'	<div class="tltle_gage_bar_s"><img src="http://image.golfzon.com/images/b2c_shop/tit_graph_sex.gif" width="87" height="13" alt="¼ºº°±¸¸ÅºñÀ²" /></div>'+
		'		<div class="index_gage_sex">';
		var sex = "";
		var precent = "";
		var meter = 0;
		for(var i=0;i<this.left_title.length;i++){
			if(i==0){
				sex = "m";
				precent = this.m_result;
				meter = parseFloat(this.m_result)/100*239;
			}else{
				sex = "w";
				precent = this.w_result;
				meter = parseFloat(this.w_result)/100*239;
			}
		s +='			<ul class="gage_per">'+
			'				<li class="value_sex">'+this.left_title[i]+'</li>'+
			'				<li class="value_sex_gage gage_border"><div class="gage_'+sex+'"><img src="http://image.golfzon.com/images/golping/new_graph_bar_'+sex+'.jpg" width="'+meter+'" height="13" alt=""><span>'+precent+'</span></div></li>'+
			'			</ul>';
		}
		s +='		</div>'+
		'		<div class="gage_percent"><img src="http://image.golfzon.com/images/golping/new_graph_bottom_line.gif" width="290" height="6"></div>'+
		'	<div class="gage_percent_num"><span>0</span><span>20</span><span>40</span><span>60</span><span>80</span><span>100</span></div>'+
		'</div>';
		GZ.$(this.id).innerHTML = s;
	}
};


var tabLocation = function(_id){
	Element.scrollTo(_id); 
}