/*如果发现自己被嵌套到IFRAME了就替换父窗口的URL,bbs除外;*/
var url=window.location.href;
if(window!=parent&&url.indexOf("bbs")==-1&&url.indexOf("iframe")==-1)
	parent.navigate(url);
function $(x){
    return document.getElementById(x);
}
/*以下显示logo*/

/*以下显示公告
if($("headNote")){
	$("headNote").innerHTML="为了更好地为拍友服务，拍拍网将于7月25日早上5:00-7:00进行系统维护，届时拍拍网相关功能将暂时无法正常使用。<br />由此给您带来的不便，我们深表歉意，感谢您对拍拍网的支持！";
	$("headNote").style.display="";
}*/

function showFlash(showId,flashSrc,flashW,flashH){
	$(showId).innerHTML='<embed src="'+flashSrc+'" height="'+flashH+'" width="'+flashW+'" wmode="transparent" type="application/x-shockwave-flash"></embed>';
}



function RememberWelcomeMsg(value){
 document.cookie =  "WelcomeMsg=" + escape(value)+";domain=my.paipai.com";
}

function cleanKeyWord(keyDefault,keyId){
	var obj=$(keyId);
	if(keyDefault==obj.value)
		obj.value="";
}
function checkHeadSubmit(keyDefault,keyId){
	var obj=$(keyId);
	if(keyDefault==obj.value||obj.value=="")
		obj.value="";
	return true;
}

function showHeadOver(obj){
	obj.src=obj.src.replace(".gif","Over.gif");
}

function showHeadOut(obj){
	obj.src=obj.src.replace("Over","");
}

function showMenu(menuName,isIndex){
	var obj=$("menu"+menuName);
	var objList=$("menuList");
	if(obj){
		obj.className="menuHere";
		if(menuName=="Home"){
			obj.style.backgroundImage="url()";
			obj.style.paddingLeft="0px";
		}
	}
}

function readCookie(name){
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0){ 
    offset = document.cookie.indexOf(search);
    if (offset != -1){ 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

function goShopCar(){
	var sUrl = "?"+Math.random();
	var oPopUp = window.open(sUrl,"ppShopCar");
	oPopUp.focus();	
}

function ShowShopcarNum(){		
	var oShopCarNum =$("spcartnum");
	var oBBSFloat   =$("bbsfloat");
	var iNum = parseInt(readCookie("spcart"));
	if(isNaN(iNum))
		iNum = 0;
	if(oShopCarNum && iNum>0){
		oShopCarNum.innerHTML = "<span class='fontOrange number'>["+iNum+"]</span>";
	}
}

ShowShopcarNum();

var statusNote="热门网游交易服务网";
var isScreen=1;
var isIE6=1;
if(screen.width==1024) isScreen=0;
var nav=navigator.appVersion;
if (nav.indexOf('MSIE')!=-1){
	var curIE=nav.substr(nav.indexOf('MSIE')+5,3);
	if (curIE==6.0) isIE6=0;
}
if(isIE6||isScreen) statusNote+=" - 使用";
if(isIE6) statusNote+="IE6.0";
if(isIE6&&isScreen) statusNote+="以及";
if(isScreen) statusNote+="1024×768分辨率";
if(isIE6||isScreen) statusNote+="访问本站能够获得最佳浏览效果。";
window.status=statusNote;	