try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

// Quick_bar scroll Layer
function initMoving(target) {
    if (!target)
        return false;

    var obj = target;

	if (document.getElementById('pageTop'))
	{
	    obj.initTop = 0;
		obj.topLimit = 225;
	} else if(document.getElementById('quickMenu'))	{
	    obj.initTop = 0;
		obj.topLimit = 225;
	} else if(document.getElementById('quickShop'))	{
	    obj.initTop = 0;
		obj.topLimit = 225;
	}

    obj.bottomLimit = document.documentElement.scrollHeight;

    obj.style.position = "absolute";
    obj.top = obj.initTop;
    obj.left = obj.initLeft;
    obj.style.top = obj.top + "px";
//	obj.style.left = obj.left + "px";

    obj.getTop = function() {
        if (document.documentElement.scrollTop) {
            return document.documentElement.scrollTop;
        } else if (window.pageYOffset) {
            return window.pageYOffset;
        } else {
            return 0;
        }
    }
    obj.getHeight = function() {
        if (self.innerHeight) {
            return self.innerHeight;
        } else if(document.documentElement.clientHeight) {
            return document.documentElement.clientHeight;
        } else {
            return 0;
        }
    }
    
    obj.move = setInterval(function() {
    	try{
	        pos = obj.getTop() + obj.getHeight() / 2 - 300;
	
	        if (pos > obj.bottomLimit)
	            pos = obj.bottomLimit
	        if (pos < obj.topLimit)
	            pos = obj.topLimit
	
	        interval = obj.top - pos;
	        obj.top = obj.top - interval / 3;
	
	        obj.style.top = obj.top + "px";
		} catch (e1) {
		}
    }, 40)
}

/*Item Mall View Cookie start*/
var rck = new Object();
rck.whish = {
	_Cookie	:	"",
	
	_getCookie : function getCookie()
	{
		var nameOfCookie = "R_item_view=cookies=";
		var x = 0;
		var cookies = decodeURI(document.cookie);
		while ( x <= cookies.length )
		{
			var y = (x+nameOfCookie.length);
			//alert(cookies.substring( x, y ));
			if ( cookies.substring( x, y ) == nameOfCookie ) {
				if ( (endOfCookie=cookies.indexOf( ";", y )) == -1 )
				endOfCookie = cookies.length;
				this._Cookie = unescape( cookies.substring( y, endOfCookie ) );
				break;
			}
			x = cookies.indexOf( " ", x ) + 1;
			if ( x == 0 )
			break;
		}
		//return "";
	},
	
	_showCookie : function()
	{
		this._getCookie();

		if (this._Cookie != ""){
			var list_1_sp = this._Cookie.split("...");
			var item_1_sp;
			var link_url = "";
			var img_url = "";
			var Max_num = 0

			if(list_1_sp[list_1_sp.length] != ""){
					document.write("<div style='width:100%;'>")
					document.write("<div style='width:100%;height:28px; text-align:center;'>Viewed Today</div>");
					document.write("<div style='width:100%;text-align:center;'>");
				for(x=list_1_sp.length-1; x > 0; x--){
					item_1_sp = list_1_sp[x].split("@");
					
					if (item_1_sp[0] == "item"){
						link_url = ShopUrl + "/Exchange/Item_Sale_View.html?";
						img_url = UploadHttps + item_1_sp[4];
					}else if(item_1_sp[0] == "cron"){
						link_url = ShopUrl + "/Exchange/Cron_Sale_View.html?";
						img_url = ShopUrl + item_1_sp[4];
					}else if(item_1_sp[0] == "char"){
						link_url = ShopUrl + "/Exchange/Character_Sale_View.html?";
						img_url = ShopUrl + item_1_sp[4];
					}else if (item_1_sp[0] == "mall"){
						link_url = ShopUrl + "/ItemMall/ItemView.html?";
						img_url = UploadHttps + item_1_sp[4];
					}else{
						img_url = ShopUrl;
					}
					
					document.write("<div style='width:36px;height:36px; padding-top:3px; margin-bottom:1.5px; text-align:center;  background:#cacaca;'>");
					document.write("<a href='"+ link_url + item_1_sp[1]+"'><img src='"+img_url+"' width='32' height='32' alt='"+item_1_sp[2]+"'></a>");
					document.write("</div>");
					
					Max_num++;
					if(Max_num == 5){	break; }
				}
					document.write("</div>");
					document.write("</div>");
				
			}
		}
	}
}
/*Item Mall View Cookie end*/
