function killErrors() { 
	return true; 
} 
//window.onerror = killErrors; 
function $(a){
	return document.getElementById?document.getElementById(a):null;
}

var web_Title='魅力无极限';
var web_URL='www.nice169.com';
var web_Img='/img/'

function ChangeDiv(oD,oN,oS){
	for(i=1;i<oN+1;i++){
		$("T"+oD+"_"+i).className="oTn";
		$("B"+oD+"_"+i).className="oBn";
	}
	$("T"+oD+"_"+oS).className="oTy";
	$("B"+oD+"_"+oS).className="oBy";
}
	
function Copy(s) {window.clipboardData.setData("text",s);alert("网址复制成功!");} 


function BodyImgAutoSize(){ 
	var img=document.all.Body.getElementsByTagName('img'); 
	var img_l=img.length; 
	for(var i=0;i<img_l;i++){ 
		if(img[i].width>600){img[i].width =600;}
		//if(img[i].height>300){img[i].height = 100;}
	} 
}

function GetCode() {
	$('CodeIMG').src="/js/GetCode.asp?"+rnd();
}
//Open Window
function OpenWindow(Url,Width,Height,WindowObj)
{
	var ReturnStr=showModalDialog(Url,WindowObj,'dialogWidth:'+Width+'pt;dialogHeight:'+Height+'pt;status:no;help:no;scroll:no;');
	return ReturnStr;
}
//Open Editer Window
function OpenEditerWindow(Url,WindowName,Width,Height)
{
	window.open(Url,WindowName,'toolbar=0,location=0,maximize=1,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,top=50,left=50,width='+Width+',height='+Height);
}

function rnd() { 
	rnd.today=new Date(); 
	rnd.seed=rnd.today.getTime(); 
	rnd.seed = (rnd.seed*9301+49297) % 233280; 
	return rnd.seed/(233280.0); 
	return Math.ceil(rnd()*10000); 
}
//功能介绍：检查字符串的长度
function StrLen(Str)
{
	var i,sum;
	sum=0;
	for(i=0;i<Str.length;i++)
	{
		if ((Str.charCodeAt(i)>=0) && (Str.charCodeAt(i)<=255))
			sum=sum+1;
		else
			sum=sum+2;
	}
	sum=parseInt(sum)
	return sum;
}
function GetCookie(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 ReURL(url){
	if( self == top ){top.location = url;}
}
//iframe自适应高度（支持XHTML，支持FF）
function getSize() {
       var xScroll, yScroll;       
       if (window.innerHeight && window.scrollMaxY) {       
              xScroll = document.body.scrollWidth;
              yScroll = window.innerHeight + window.scrollMaxY;
       } else if (document.body.scrollHeight > document.body.offsetHeight){       // all but Explorer Mac
              xScroll = document.body.scrollWidth;
              yScroll = document.body.scrollHeight;
       } else {       // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
              xScroll = document.body.offsetWidth;
              yScroll = document.body.offsetHeight;
       }
       var windowWidth, windowHeight;
       if (self.innerHeight) {       // all except Explorer
              windowWidth = self.innerWidth;
              windowHeight = self.innerHeight;
       } else if (document.documentElement && document.documentElement.clientHeight) {       // Explorer 6 Strict Mode
              windowWidth = document.documentElement.clientWidth;
              windowHeight = document.documentElement.clientHeight;
       } else if (document.body) {       // other Explorers
              windowWidth = document.body.clientWidth;
              windowHeight = document.body.clientHeight;
       }  
       // for small pages with total height less then height of the viewport
       if(yScroll < windowHeight){
              pageHeight = windowHeight;
              y = pageHeight;
       } else { 
              pageHeight = yScroll;
              y = pageHeight;
       }

       if(xScroll < windowWidth){       
              pageWidth = windowWidth;
       } else {
              pageWidth = xScroll;
       }

       arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
       return arrayPageSize;
}
function AutoHeight(pid) {
       var x = new getSize();
       parent.document.getElementById(pid).height=x[1];
}
//End

function ChkMaxLen(it,Max,obj,MsgDiv) {
	var len = StrLen(obj.value);
	if (len > Max){		
		alert('字符长度超出上限：'+Max);
		obj.value = obj.value.substring(0,Max);
		$(MsgDiv).innerHTML = "<font color=red>"+len+"</font>/<font color=blue>"+Max+"</font>";  
		if (it=2){obj.focus();	return false;}
	}else{
		$(MsgDiv).innerHTML = "<font color=red>"+len+"</font>/<font color=blue>"+Max+"</font>";  
	}
	
}
//判断IE
function ChkIE(){
	if (window.navigator.userAgent.indexOf("MSIE")>=1){
	}else{
		if (window.navigator.userAgent.indexOf("Firefox")>=1){alert("本页面目前尚不能稳定支持Firefox浏览器，请转到IE浏览器中使用，谢谢！");top.location.href='/';return false;}else{}
	}
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}