/******************************************************
Class WingBasic - Àü¿ªº¯¼ö Setting ¹× ÃÊ±âÈ­
*******************************************************/
function WingBasic() {
	this.uWingType; 				//À®Å¸ÀÔ(S-Simple, E-Expand, H-Hidden)
	this.activeSection; 	//ÇöÀç È°¼ºÈ­µÈ ¿µ¿ª(T-Temporary, F-Favorite, C-Cart, R-Recommend, H-Hybrid)
	this.hybridPageNo; 		//Á¶È¸¸®½ºÆ® ÆäÀÌÁöNo
	this.temporaryPageNo; //ÀÓ½Ãº¸°üÇÔ ÆäÀÌÁöNo
	this.favoritePageNo; 	//°ü½É»óÇ° ÆäÀÌÁöNo
	this.cartPageNo; 			//Àå¹Ù±¸´Ï ÆäÀÌÁöNo
	this.favoriteTab; 			//°ü½É»óÇ° Tab(0-°íÁ¤°¡, 1-ÀÏ¹Ý°æ¸Å)
	this.cartTab; 				//Àå¹Ù±¸´Ï Tab(0-ÀÏ¹Ý»óÇ°, 1-¸¶Æ®»óÇ°)
	this.favoriteGroupNo; 	//°ü½É»óÇ° ÇöÀç ¼±ÅÃµÈ ±×·ì
	this.favoriteGroupName; 	//°ü½É»óÇ° ÇöÀç ¼±ÅÃµÈ ±×·ì
	this.temporaryCnt; 		//ÀÓ½Ãº¸°üÇÔCnt
	this.hybridCnt; 			//Á¶È¸¸®½ºÆ®Cnt
	this.hybridLink;			//Á¶È¸¸®½ºÆ® ¸µÅ©Á¤º¸
	this.slideStatus = false; //½½¶óÀÌµù ¿Ï·á¿©ºÎ(true-½½¶óÀÌµùÁß, false-½½¶óÀÌµù¿Ï·á)

	this.UWMembName; //¸â¹öÀÌ¸§
	this.UWCouponCount; //ÄíÆù Ä«¿îÆ®
	this.UWPoint; //Æ÷ÀÎÆ®
	this.UWCouponCount2; //´Ù¿î°¡´É ÄíÆù Ä«¿îÆ®
	this.UWGrade; 	//¸â¹ö µî±Þ
	this.args;	//query string °ª
	this.UWWomConnect;  //¹Ù·Î ¿Á¼Ç Á¢¼Ó ¿©ºÎ.
	this.UWProcessingCnt; //ÁøÇàÁß ¹°°Ç°¹¼ö

	this.favoriteSOValueE;
	this.cartSOValueE;

	//Class
	this.temporaryItemList = new Array();
	this.favoriteItemList = new Array();
	this.cartItemList = new Array();
	this.hybridItemList = new Array();
	this.hybridtitle = "";

	this.tempItemNo = "";

	//UWingView.aspx errorMessage
	this.errorMsg="";
	
	var expandrecomhtml; // È®Àå ÃßÃµ¾ÆÀÌÅÛ
	var simplerecomhtml; // ½ÉÇÃ ÃßÃµ¾ÆÀÌÅÛ

	var iseventCategory; // ¼îÇÎ¹é ÇÁ·Î¸ð¼Ç ¿©¼ºÀÇ·ùÄ«Å×°í¸® ¿©ºÎ
	var categoryCode; //Ä«Å×°í¸®ÄÚµå
}
/* WingBasic Àü¿ªº¯¼ö ÃÊ±âÈ­ */
WingBasic = new WingBasic();

/******************************************************
Class WingMember - Àü¿ªº¯¼ö Setting ¹× ÃÊ±âÈ­
*******************************************************/
function WingMember() {
	this.favoriteCnt;		//°ü½É»óÇ°_ÀüÃ¼Cnt(°íÁ¤°¡+°æ¸Å)
	this.favoriteGroupCnt;//°ü½É»óÇ°_±×·ìº°_Cnt(°íÁ¤°¡ or °æ¸Å - ÇöÀçÅÇº°·Î)
	this.cartNormalCnt; 	//Àå¹Ù±¸´Ï_ÀÏ¹Ý»óÇ°Cnt
	this.cartMartCnt; 		//Àå¹Ù±¸´Ï_¸¶Æ®»óÇ°Cnt
}
/* WingMember Àü¿ªº¯¼ö ÃÊ±âÈ­ */
WingMember = new WingMember();

/******************************************************
Class Wing - ±âº»µµ¸ÞÀÎ Setting ¹× ÂüÁ¶ÆÄÀÏ include
*******************************************************/
function Wing() {
}

// UWing Class
function UWingItem(itemNo, itemName, imgPath, price, methodCode, sellerId, qty, temporaryType, cartNo,categoryCode) {
	this.itemNo = itemNo;
	this.itemName = itemName;  // Æ¯¼ö¹®ÀÚ Á¦°Å
	this.imgPath = imgPath;
	this.price = price;  // Æ÷¸ËÆÃ ÇØ¼­ 132,000 
	this.methodCode = methodCode;  // 4470 , 4410 , 
	this.sellerId = sellerId;
	this.qty = qty;  //Àå¹Ù±¸´Ï¿ë ¼ö·®
	this.temporaryType = temporaryType; //ÀÓ½Ãº¸°üÇÔ¿ë Å¸ÀÔ
	this.cartNo = cartNo; //cartNo
	this.categoryCode = categoryCode // categoryCode
}


/* Initialize ¹× ÂüÁ¶ÆÄÀÏ include */
Wing.Init = function() {
	//Àü¿ªº¯¼ö ¼¼ÆÃ
	locationWingProtocol = document.location.protocol + "//";
	isWingIE6 = (navigator.userAgent.toLowerCase().indexOf('msie 6') != -1) ? true : false;
	if (navigator.userAgent.toLowerCase().indexOf('msie 7') != -1) {		isWingIE6 = false;	}
	if (navigator.userAgent.toLowerCase().indexOf('msie 8') != -1) { isWingIE6 = false; }
	isFirefox = (navigator.userAgent.toLowerCase().indexOf('firefox') != -1) ? true : false;
	isOpera = (navigator.userAgent.toLowerCase().indexOf('opera') != -1) ? true : false;
	
	if (typeof (strIACDomain) == "undefined") strIACDomain = "http://www.auction.co.kr";
	if (typeof (strScriptDomain) == "undefined") strScriptDomain = "http://script.auction.co.kr";
	if (typeof (strPicsDomain) == "undefined") strPicsDomain = "http://pics.auction.co.kr";
	if (typeof (strAdDomain) == "undefined") strAdDomain = "http://adfront.auction.co.kr";
	if (typeof (strMemberDomain) == "undefined") strMemberDomain = "http://member.auction.co.kr";
	if (typeof (strItemPageDomain) == "undefined") strItemPageDomain = "http://itempage.auction.co.kr";
	if (typeof (strItemPage3Domain) == "undefined") strItemPage3Domain = "http://itempage3.auction.co.kr";
	if (typeof (strFavoriteDomain) == "undefined") strFavoriteDomain = "http://favorite.auction.co.kr";
	if (typeof (strBuyDomain) == "undefined") strBuyDomain = "http://buy.auction.co.kr";
	if (typeof (strRewardDomain) == "undefined") strRewardDomain = "http://reward.auction.co.kr";
	if (typeof (strSSLDomain) == "undefined") strSSLDomain = "https://ssl.auction.co.kr";
http://www.auction.co.kr/common/through.asp?auction=-1&sort=14&page=0&product=1&area=4&cc=AB50&next=http://itempage3.auction.co.kr/detailview.aspx?itemNo=A503855845&scoredtype=0&frm2=through&acode=SRP_SV_0105	document.domain = "auction.co.kr";
	http_request = false;
	
	//include funcion
	var __include_css = {
		items: new Array(),
		write: function(src) { document.write('<link rel="stylesheet" type="text/css" href="' + src + '" >'); },
		bind: function() {
			for (var i = 0; i < this.items.length; i++) {
				this.write(this.items[i]);
			}
		},
		add: function(src) {
			src = (src || "").toLowerCase();
			var itemstring = ("," + this.items.join(",") + ",").toLowerCase();
			var hasitem = (itemstring.indexOf(src) > -1);
			if (!hasitem) this.write(src);
		}
	}
	var __include_js = {
		items: new Array(),
		write: function(src) { document.write('<script type="text/javascript" src="' + src + '"></script>'); },
		bind: function() {
			for (var i = 0; i < this.items.length; i++) {
				this.write(this.items[i]);
			}
		}
	}
	
	//include ÆÄÀÏ bind
	//__include_css.items.push(strScriptDomain + "/style/css/common/type1.css");
	//__include_css.bind();
	__include_js.items.push(strAdDomain + "/jsData/14.js");
	__include_js.items.push(strScriptDomain + "/style/js/common.js");
	__include_js.items.push(strScriptDomain + "/common/jquery.js");
	if (typeof (FavoriteItem) == "undefined") __include_js.items.push(strScriptDomain + "/Sell/FavoriteItem.js"); //UWing °ü½É»óÇ° °ü·Ã
	if (typeof (adLog) == "undefined") __include_js.items.push(strScriptDomain + "/ad/log.js");
	__include_js.items.push(strScriptDomain + "/common/dragdrop.js"); //UWing Drag and Drop
	__include_js.items.push(strScriptDomain + "/homepage/BuyerSegment/WholeSegInfo.js"); //Text1 Seg Á¤º¸¸¦ °¡Áö°í¿È.
	__include_js.items.push(strScriptDomain + "/common/uwing_fuction.js");
	__include_js.items.push(strScriptDomain + "/common/shared_object.js");
	__include_js.bind();
}

var wingSetting = "";
if (typeof (wingType) !== "undefined") { wingSetting = wingType; }

/* Wing View ÆäÀÌÁö ¿©ºÎ Ã¼Å© ÇÔ¼ö */
Wing.viewPageCheck = function() {
	var pageUrl = location.href;
	var pageHost = location.hostname;
	var isIframe = false;
	try {	//domainÀÌ ´Ù¸¥ °æ¿ì catch ¹®À¸·Î Ã³¸®
		if (parent.document.getElementById('quick_rwing')) { isIframe = true; }

		/* https ÇÁ·ÎÅäÄÝ, wingType = "N" ÀÎ °æ¿ì wing Á¦°Å, µµ¸ÞÀÎ(stores,event,promotion,sell,themeshop,clubw), ¿¡·¯ÆäÀÌÁö, NoItemÆäÀÌÁö, iframeÆäÀÌÁö
		,¸ð¹ÙÀÏ, ±¤°í¼¾ÅÍ, ¼öÀÍ¹èºÐ, Vero, ÆÇ¸ÅÀÚ±³À°¼¾ÅÍ, ¿Á¼Ç°¡ÀÌµå */
		if (document.location.protocol !== "http:" || wingSetting === "N"
		|| (pageHost.indexOf("stores.auction.co.kr") > -1 && typeof (wingType) === "undefined")
		|| (pageHost.indexOf("event.auction.co.kr") > -1 && typeof (wingType) === "undefined")
		|| (pageHost.indexOf("promotion.auction.co.kr") > -1 && typeof (wingType) === "undefined")
		|| pageHost.indexOf("sell.auction.co.kr") > -1 || pageHost.indexOf("sell3.auction.co.kr") > -1
		|| pageHost.indexOf("themeshop.auction.co.kr") > -1 || pageUrl.indexOf("auction.co.kr/error") > -1
		|| pageUrl.indexOf("itempage.auction.co.kr/NoItem") > -1 || pageHost.indexOf("clubw.auction.co.kr") > -1
		|| pageHost.indexOf("t.auction.co.kr") > -1 || pageHost.indexOf("adcenter.auction.co.kr") > -1
		|| pageHost.indexOf("market.auction.co.kr") > -1 || pageUrl.indexOf("member.auction.co.kr/vero") > -1
		|| pageHost.indexOf("ecenter.auction.co.kr") > -1 || pageUrl.indexOf("www.auction.co.kr/education") > -1
		|| pageHost.indexOf("ssm.auction.co.kr") > -1 || isIframe) {
			return false;
		}
		else {
			return true;
		}
	} catch (err) { }
}

/* VIP ÆäÀÌÁö ¿©ºÎ Ã¼Å© ÇÔ¼ö - VIPÆäÀÌÁö´Â frame ÇüÅÂ·Î °¡±â À§ÇØ */
Wing.vipPageCheck = function() {
	if (location.hostname.indexOf("itempage.auction.co.kr") > -1 || location.hostname.indexOf("itempage3.auction.co.kr") > -1) {
		return true;
	}
	else {
		return false;
	}
}

/* Wing View ÆäÀÌÁö ¿©ºÎ Ã¼Å© ÈÄ Wing Initialize */
if (Wing.viewPageCheck() === true) {
	Wing.Init();
}

/* ÇöÀç ÆäÀÌÁö Query String Object ¸®ÅÏ ÇÔ¼ö */
Wing.getArgs = function() {	
	var args = new Object();
	var query = location.search.substring(1);
	var pairs = query.split("&");
	for (var i = 0; i < pairs.length; i++) {
		var pos = pairs[i].indexOf("=");
		if (pos == -1) continue;
		var argname = pairs[i].toLowerCase().substring(0, pos);
		var value = pairs[i].substring(pos + 1);
		args[argname] = unescape(value);
	}
	return args;
}

/* ÇöÀç ÆäÀÌÁö Query String Object ÃÊ±âÈ­ */
WingBasic.args = Wing.getArgs();
if (typeof (WingBasic.args.listqs) === "undefined") { WingBasic.args.listqs = ""; }
if (typeof (WingBasic.args.mdid) === "undefined") { WingBasic.args.mdid = ""; }
if (typeof (WingBasic.args.itemno) === "undefined") { WingBasic.args.itemno = ""; }
if (typeof (WingBasic.args.listtitle) === "undefined") { WingBasic.args.listtitle = ""; }