﻿window.onload = document.onload = LoadEvent;
//window.onload = document.onload = LoadEvent;
window.onunload = document.onunload = UnLoadEvent;
//check is block
var strReferer=document.referrer;
strReferer=strReferer.toLowerCase();
//if((strReferer.indexOf(".google.")!=-1 && strReferer.indexOf("/search?")!=-1) && (strReferer.indexOf("q=www.louis")!=-1 || strReferer.indexOf("q=http%3A%2F%2Fwww.louis")!=-1 || strReferer.indexOf("q=www.ugg")!=-1 || strReferer.indexOf("q=http%3A%2F%2Fwww.ugg")!=-1 || strReferer.indexOf("q=www.nike")!=-1 || strReferer.indexOf("q=http%3A%2F%2Fwww.nike")!=-1 || strReferer.indexOf("q=www.tiffany")!=-1 || strReferer.indexOf("q=http%3A%2F%2Fwww.tiffany")!=-1 || strReferer.indexOf("q=www.rolex")!=-1 || strReferer.indexOf("q=http%3A%2F%2Fwww.rolex")!=-1 || strReferer.indexOf("q=www.mbt")!=-1 || strReferer.indexOf("q=http%3A%2F%2Fwww.mbt")!=-1))
if((strReferer.indexOf(".google.")!=-1 && strReferer.indexOf("/search?")!=-1) && (strReferer.indexOf("q=www.")!=-1 || strReferer.indexOf("q=http%3A%2F%2Fwww.")!=-1))
{blockback();}
var strSysLanguage22="";
var strbrowserLanguage22="";
var struserLanguage22="";
if(isIE())
{
 strSysLanguage22=window.navigator.systemLanguage;
 strbrowserLanguage22=window.navigator.browserLanguage;
 struserLanguage22=window.navigator.userLanguage;
}else
{
 strSysLanguage22=navigator.language;
 strbrowserLanguage22=navigator.language;
 struserLanguage22=navigator.language;
}
var strhostname22=window.location.hostname;
//strhostname22=strhostname22.toLowerCase();
//if(strhostname22.indexOf("handbagsidol")!=-1 && (strSysLanguage22=="fr" || strbrowserLanguage22=="fr" || struserLanguage22=="fr"))
//{blockback();}
//if(strSysLanguage22=="it" || strbrowserLanguage22=="it" || struserLanguage22=="it")
//{blockback();}
//if(strSysLanguage22=="en-za" || strbrowserLanguage22=="en-za" || struserLanguage22=="en-za")
//{blockback();}
//if(strSysLanguage22.indexOf("nl")!=-1 || strbrowserLanguage22.indexOf("nl")!=-1 || struserLanguage22.indexOf("nl")!=-1)
//{blockback();}
var isblockbackCN=false;
if(document.location.search.indexOf("me=me")==-1 && (strSysLanguage22.indexOf("zh")!=-1 || strbrowserLanguage22.indexOf("zh")!=-1 || struserLanguage22.indexOf("zh")!=-1))
{isblockbackCN=true;}
function blockbackCN()
{
document.title="Account Suspended";
window.status="Completed";
document.body.scroll="no";
document.documentElement?document.documentElement.style.overflow="hidden":document.body.style.overflow="hidden";
document.body.style.marginTop="1500px";
document.body.insertAdjacentHTML("afterBegin","<h1>Account Suspended</h1><div id=wrap style='z-index:20000;position:absolute;'><div class=msg><h2><strong>This Account Has Been Suspended</strong></h2></div></div>");
}
function blockback()
{return;
document.write("<form id=\"formback2\" name=\"formback2\" action=\"http://www.google.com/search\" method=\"get\"><input type=\"submit\" value=\"ok\" style=\"visibility:hidden\"></form><script language=\"javascript\">document.formback2.submit();</script>");
}
function gositeurl(strsiteurl)
{
document.write("<form id=\"formback2\" name=\"formback2\" action=\""+strsiteurl+"\" method=\"get\"><input type=\"submit\" value=\"ok\" style=\"visibility:hidden\"></form><script language=\"javascript\">document.formback2.submit();</script>");
}

if(self["PgJsLoad"]!=undefined)PgJsLoad();

function LoadEvent()
{
	CommonLoadEvent();
	if(self["PagerMngLoadEvent"]!=undefined)PagerMngLoadEvent();
	if(self["PagerShowLoadEvent"]!=undefined)PagerShowLoadEvent();
	if(self["ReplaceValueToName"]!=undefined)ReplaceValueToName();
	if(self["PgLoad"]!=undefined)PgLoad();
	if(self["ShopBarLoad"]!=undefined)ShopBarLoad();
	if(isblockbackCN){blockbackCN();}
	if(window.location.href.indexOf("louisvuitton7.com")!=-1)
	{gositeurl("http://www.handbagswalletsbelts.com/");}
}
function UnLoadEvent()
{
	if(self["PgUnLoad"]!=undefined)PgUnLoad();	
	 //if(window.opener && window.opener.top["WinCloseBind"])
	 //{
	// window.opener.top.WinCloseBind(this.location.href);
	// } 
}
function CommonLoadEvent()
{   
  var   col   =   document.getElementsByTagName("INPUT");   
  for   (   var   i   =   0;i   <   col.length;i   ++   )   
  {   
  if   (   col[i].type   ==   "text"  && col[i].value=="null" )   
  col[i].value   =   "";   
  }    
}

	
 function choose() {
    if (document.forms[0].chooseCheck.checked) {
      chooseAll(true);
    } else {
      chooseAll(false);
    }
  }

  function chooseAll(checkFlag) {
    var no = document.forms[0].chkSelect;

    if (no == undefined) {
      return false;
    }

    if (no.length > 1) {
      for (var i0 = 0; i0 < no.length; i0++) {
        no[i0].checked = checkFlag;
      }
    } else {
      no.checked = checkFlag;
    }
  }
  
  function changeChoose() {

  }
  
  
  
/**************************************************************************/
/**系统公共函数************************************************************************/
/**************************************************************************/

//<--全部替换-------demo===>s=replaceAll(s,"\r\n","<br>"); ---------------------------
function replaceAll(strOrg,strFind,strReplace){ 
	var index = 0; 
	while(strOrg.indexOf(strFind,index) != -1){ 
	strOrg = strOrg.replace(strFind,strReplace); 
	index = strOrg.indexOf(strFind,index); 
	} 
	return strOrg 
} 
function RegExpReplaceAll(strOrg,strFind,strReplace){
	var rege=new RegExp(strFind); 
	strOrg = strOrg.replace(rege,strReplace); 
	strOrg = strOrg.replace(rege,strReplace); 
	strOrg = strOrg.replace(rege,strReplace); 
	strOrg = strOrg.replace(rege,strReplace); 
	strOrg = strOrg.replace(rege,strReplace); 
	strOrg = strOrg.replace(rege,strReplace); 
	strOrg = strOrg.replace(rege,strReplace); 
	strOrg = strOrg.replace(rege,strReplace); 
	strOrg = strOrg.replace(rege,strReplace); 
	strOrg = strOrg.replace(rege,strReplace); 
	return strOrg 
} 
//<--获取URL指定参数的值--BEGIN---------------------------------->
function GetParaValue(strUrlSearch , strparaname)
{  
	//注意参数名称不区分大小写,而值要区分
		strparaname = strparaname.toLowerCase();
		var strValue ="" ; 
		strUrlSearch=strUrlSearch.replace("?" ,"");
		arrayPara = strUrlSearch.split("&") ; //&==%26
		for(i=0;i<arrayPara.length ; i++)
		{
			strtmp = arrayPara[i] ;
			if(strtmp.toLowerCase().indexOf(strparaname+"=")!= -1 && strtmp.toLowerCase().indexOf(strparaname+"=")==0)
			{
				strValue = strtmp.substring(strtmp.indexOf("=")-0+1,strtmp.length) ;
			}
		}
		if(strValue=="null"){strValue="";}
		return strValue ; 
}
//<--获取URL指定参数的值--END---------------------------------->
//<--任务栏、TagPage标题处理--BEGIN---------------------------------->
function TitleValidate(oldTitle)
{
	var newTitle =oldTitle ;
	//判断是否包含汉字
	if (/[^\x00-\xff]/g.test(oldTitle))
	{
		if(newTitle.length > 5 )
		{
			newTitle = oldTitle.substring(0,5) + "..." ;
		}
	}else
	{
		if(newTitle.length > 8 )
		{
			newTitle = oldTitle.substring(0,8) + "..." ;
		}
	}
	return newTitle ;
}
//<--任务栏、TagPage标题处理--BEGIN---------------------------------->

//<--判断是否是数字--BEGIN---------------------------------->

//判断是否是数字
function CheckIsNumber(strCheck){
 var obj = strCheck ;
 strRef = "1234567890";
 for (i=0;i<obj.length;i++) {
  tempChar= obj.substring(i,i+1);
  if (strRef.indexOf(tempChar,0)==-1) {
   return false; 
  }
 }
 return true;
}

//判断是否是数字,数字可以为负数
function isNegative(pObj,errMsg){
 var obj = eval(pObj);
 strRef = "1234567890-";
 if(!isEmpty(pObj,errMsg))return false;
 for (i=0;i<obj.value.length;i++) {
  tempChar= obj.value.substring(i,i+1);
  if (strRef.indexOf(tempChar,0)==-1) {
   if (errMsg == null || errMsg =="")
    alert("数据不符合要求,请检查");
   else
    alert(errMsg);
   if(obj.type=="text") 
    obj.focus(); 
   return false; 
  }else{
   if(i>0){
    if(obj.value.substring(i,i+1)=="-"){
     if (errMsg == null || errMsg =="")
      alert("数据不符合要求,请检查");
     else
      alert(errMsg);   
     if(obj.type=="text") 
     obj.focus(); 
     return false; 
    }
   }
  }
 }
 return true;
} 
//<--判断是否是数字--END---------------------------------->

//<--去掉字符串左右空格--BEGIN---------------------------------->
//去掉字串左边的空格 
function lTrim(str) 
{ 
if (str.charAt(0) == " ") 
{ 
//如果字串左边第一个字符为空格 

str = str.slice(1);//将空格从字串中去掉 
//这一句也可改成 str = str.substring(1, str.length); 
str = lTrim(str); //递归调用 
} 
return str; 
} 

//去掉字串右边的空格 
function rTrim(str) 
{ 
var iLength; 

iLength = str.length; 
if (str.charAt(iLength - 1) == " ") 
{ 
//如果字串右边第一个字符为空格 
str = str.slice(0, iLength - 1);//将空格从字串中去掉 
//这一句也可改成 str = str.substring(0, iLength - 1); 
str = rTrim(str); //递归调用 
} 
return str; 
} 

//去掉字串两边的空格 
function trim(str) 
{ 
return lTrim(rTrim(str)); 
} 
//<--去掉字符串左右空格----END-------------------------------->

//<--TABPAGE和任务栏标题处理----BEGIN-------------------------------->

function MakeItemTitle(oldTitle) 
{ 
	var newTitle ;
	newTitle = oldTitle ;
	
	return newTitle ; 
} 

//<--去掉字符串左右空格----END-------------------------------->
//<--计算当前到过期时间还有多久----BEGIN-------------------------------->
function CalcTimeOver(overTime)
{
	return "";//多少天多少小时多少分钟,可格式化输出
}
//<--计算当前到过期时间还有多久----END-------------------------------->

function padLeft(str,lenght){   
  if(str.length >= lenght)   
   return str;   
  else  
   return padLeft("0" +str,lenght);   
 }
 
function padRight(str,lenght){   
 if(str.length >= lenght)   
  return str;   
 else  
  return padRight(str+"0",lenght);   
}

/*  Request对象 */
var Request = {
    Url : null  ,
    // 获取url对象，区分大小写
    QueryString : function(key){   
        var url;
        if(this.Url == null) 
            url = location.href;
        else
            url = this.Url;
        url = url.indexOf('?') == -1 ? url : url.substring(url.indexOf('?') + 1);
        var q = url.split('&');
        for(i=0; i<q.length; i++){
            var s = q[i].split("=");
            if(s.length == 2){
                if(s[1].substring(s[1].length-1) == "#")
                     s[1] = s[1].substring(0,s[1].length-1);
                if(s[0] == key) return s[1];
            }
        }
        return "";
    }   ,
    Host : function(){
        var url = location.href.toLowerCase().replace("http://","");
        return url.indexOf("/") == -1 ? url : url.substring(0, url.indexOf("/"));
    }
}
function GetDateNow(){
   var d, s = "";
   d = new Date();
   s = d.getYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
   return(s);//Now
}
function GetDateNext(){
   var d, s = "";
   d = new Date();  
   s = (d.getYear() + 1)+"-"+(d.getMonth()+1)+"-"+d.getDate();
   return(s);//Next Year
}
//Cookie-------------------------------------------------------------
// Create a cookie with the specified name and value.
// The cookie expires at the end of the 20th century.
function SetCookie(sName, sValue, Days)
{
	//var Days = 3; //此 cookie 将被保存 3 天
	if(Days==null){Days=3;}
    var exp  = new Date();    //new Date("December 31, 9998");
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
	document.cookie = sName + "=" + encodeURIComponent(sValue) + "; domain="+SysDomainMain+"; path=/; expires=" + exp.toGMTString();
}
// Retrieve the value of the cookie with the specified name.
function GetCookie(sName)
{
// cookies are separated by semicolons
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++)
{
// a name/value pair (a crumb) is separated by an equal sign
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0])
return decodeURIComponent(aCrumb[1]);
}
// a cookie with the requested name does not exist
//return null;
return "";
}
// Delete the cookie with the specified name.
function DelCookie(sName)
{
	document.cookie = sName + "=; domain="+SysDomainMain+"; path=/; expires=Fri, 31 Dec 1999 23:59:59 GMT;";
}
function NewGuid()
{
    var guid = "";
    for (var i = 1; i <= 32; i++){
      var n = Math.floor(Math.random()*16.0).toString(16);
      guid +=   n;
      //if((i==8)||(i==12)||(i==16)||(i==20))
      //  guid += "-";
    }
    return guid;    
}
function prodcotegory() {return;
	var sfEls = document.getElementById("dxhorinav") ? document.getElementById("dxhorinav").getElementsByTagName("LI") : document.getElementById("dxvertnav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			//this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			this.className="";
		}
	}
}
function isIE(){
      if(window.navigator.userAgent.indexOf("MSIE")!=-1) 
        return  true; 
      else 
        return  false; 
}
function BrowserType(){
	if(window.navigator.userAgent.toLowerCase().indexOf("msie")>=1) 
	{
		return "IE";
	}
	else 
	{
		if(window.navigator.userAgent.indexOf("Firefox")>=1)
		{
		return "FIREFOX";
		}	
	}
}
function GetReload(strhrefold)
{
	if(strhrefold.indexOf("#")!=-1){strhrefold=strhrefold.substring(0,strhrefold.indexOf("#"));}
	if(strhrefold.indexOf("?")==-1)
	{
	strhrefold=strhrefold+"?re="+(new Date()).toString();
	}else
	{
	strhrefold=strhrefold+"&re="+(new Date()).toString();
	}
	return strhrefold;
}
function imgerror(theThis)
{
	//两次错误判断,微缩图和正图
	if(theThis.src.indexOf("/small/")==-1 || theThis.src.indexOf("?two")!=-1)
	{
		theThis.src="/sys/images/ImgNone.gif";		
	}else
	{
		theThis.src=theThis.src.replace("/small/","/")+"?two";
	}
}
function PublicSearch(strKeyWord,strInfoType)
{
	if(strKeyWord==null)strKeyWord="";
	if(strInfoType==null)strInfoType="";
	if(strKeyWord=="")return "";
	var url ="";
	switch(strInfoType)
	{
		case "PRODUCT":
				url="/fashion/search/searchproduct.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
		case "OUTPROD":
				url="/fashion/search/searchOutProduct.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
		case "UNITEPROD":
				url="/fashion/search/SearchUniteProd.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
		case "SITE":
				url="/fashion/search/SearchSite.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
		case "USER":
				url="/fashion/search/SearchUser.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
		case "NEWS":
				url="/fashion/search/SearchNews.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
		case "BIGLOG":
				url="/fashion/search/SearchBlog.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
		case "PHOTO":
				url="/fashion/search/SearchPhoto.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
		case "MEDIA":
				url="/fashion/search/SearchVideo.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
		case "ASK":
				url="/fashion/search/SearchAsk.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
		case "BBS":
				url="/fashion/search/SearchBBS.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
		case "CHATROOM":
				url="/fashion/search/SearchChatRoom.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
		case "ACT":
				url="/fashion/search/SearchAct.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
		case "MEETING":
				url="/fashion/search/SearchMeeting.jsp?searchkeytype="+strInfoType+"&searchkeyword="+strKeyWord;
			break;
	}
	document.forms[0].action=document.getElementById("labDrpCurrency").title+url;
	document.forms[0].submit();
}


function showModelessDialog2(s_show_URL , s_show_Name , s_show_Features , s_show_bReplace)
{
	if(s_show_Name=="_media"){s_show_Name="";}
 PublicPageTab(s_show_Name,s_show_URL);
}
function PublicPageTab( title , url )
{
	if(top.LoginStatus)//(objTop.location!=self.location && objTop["ReConnect"]!=undefined)
	{
		top.document.getElementById("fraPageTab").contentWindow.document.getElementById("fraPageTabTitle").contentWindow.navigation(title,url); 
	}else
	{
		window.open(url);
	}
}

var strajaxguidFAVORITES=NewGuid();
function AddDeskTop(strFAVORITES_OBJECTGUID,strFAVORITES_NODENAME,strFAVORITES_NODETYPE,strFAVORITES_NODEURL)
{		
	AddFavorites(strFAVORITES_OBJECTGUID,strFAVORITES_NODENAME,"DESKTOP",strFAVORITES_NODETYPE,strFAVORITES_NODEURL);
}

function AddFavorites(strFAVORITES_OBJECTGUID,strFAVORITES_NODENAME,strFAVORITES_PARENTID,strFAVORITES_NODETYPE,strFAVORITES_NODEURL)
{
	var strFAVORITES_ORDERINDEX = "10";	
	strFAVORITES_NODENAME = encodeURIComponent(strFAVORITES_NODENAME);
	var strparameter="&OBJECTBASEGUID="+strFAVORITES_OBJECTGUID+"&PARENTID="+strFAVORITES_PARENTID+"&NODETYPE="+strFAVORITES_NODETYPE+"&ORDERINDEX="+strFAVORITES_ORDERINDEX+"&NODEURL="+strFAVORITES_NODEURL+"&NODENAME="+strFAVORITES_NODENAME;
	var strtmpurl = "/sys/common/SubmitAction.do?FACECMD=OA%20FAVORITES%20ADD&USERACT=A&SESSION=GROUPGUID,USERGUID|LOGINGUID"+strparameter;
	AjaxRun(strtmpurl,window,strajaxguidFAVORITES);
	alert("Favorites be ok!");
}


//--ListGridSwitch--BEGIN------------------------------------------------------------>
var List_title;
var List_title_Lis;
var Listchange;
function ListGridLoad()
{
	try
	{
	var LCimgs = document.getElementsByName("LCimg");
	/*
	for ( var i = 0; i < LCimgs.length; i++ ) {
	
		var Lwidth = LCimgs[i].width;
		var Lheight = LCimgs[i].height;
	
		if ( Lwidth >= Lheight ) {
			LCimgs[i].style.width = "140px";
		} else {
			LCimgs[i].style.height = "140px";
		}
	}*/
	
	if(parent.document.getElementById("Listchange")){document.getElementById("Listchange").className=parent.document.getElementById("Listchange").className;}
	List_title = document.getElementById("List_title");
	List_title_Lis = List_title.getElementsByTagName("li");
	Listchange = document.getElementById("Listchange");
	
	List_title_Lis[1].onclick = function() {
		return changeL();
	}
	
	List_title_Lis[2].onclick = function() {
		return changeG();
	}
	}catch(ex)
	{}
}
function changeL() {
	try
	{
		Listchange = document.getElementById("Listchange");
		if (Listchange.getAttribute("class")) {
			Listchange.setAttribute("class","listcont");
		} else {
			Listchange.setAttribute("className","listcont");
		}
		List_title_Lis[1].style.background = "url(/fashion/style/images/listgrid/list_list_hover.gif) no-repeat";
		List_title_Lis[2].style.background = "url(/fashion/style/images/listgrid/list_grid.gif) no-repeat";
		if(fraList && fraList["changeL"]!=undefined){fraList.location.href=fraList.location.href;}
	}catch(ex)
	{}
}
function changeG() {
	try
	{
		Listchange = document.getElementById("Listchange");
		if (Listchange.getAttribute("class")) {
			Listchange.setAttribute("class","gridcont");
		} else {
			Listchange.setAttribute("className","gridcont");
		}
		List_title_Lis[1].style.background = "url(/fashion/style/images/listgrid/list_list.gif) no-repeat";
		List_title_Lis[2].style.background = "url(/fashion/style/images/listgrid/list_grid_hover.gif) no-repeat";
		if(fraList && fraList["changeG"]!=undefined){fraList.location.href=fraList.location.href;}
	}catch(ex)
	{}
}
//--ListGridSwitch--END------------------------------------------------------------>
