<!--
//=====================================================KIMI Js??==================================================
//????:1.???? 2.???? 3.????,???? 4.???????
//=====================================================KIMI Js??==================================================


//================================================?????????================================================

//??????
function CheckEmpty(id,str)
{
	var obj=document.getElementById(id)
	if (obj.value=="")
	{
		alert(str);
		obj.focus();
		return true;
	}
}
//???????,????????
function CheckFuc(id,str)
{
	var obj=document.getElementById(id)
	var strSource ="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";
	var ch;
	var i;
	var temp;
	var flag;
	
	for (i=0;i<=(obj.value.length-1);i++)
	{
		ch = obj.value.charAt(i);
		temp = strSource.indexOf(ch);
		if (temp==-1) 
		{
			flag=false;
		}
	}
	
	if (strSource.indexOf(ch)==-1 || flag==false)
	{
		alert(str);
		obj.focus();
		return true;
	} 
}

//????
function CheckPassword(id1,id2,str,str2)
{
	var obj1=document.getElementById(id1)
	var obj2=document.getElementById(id2)
	if(obj1.value=="" || obj1.value.length < 6 || obj1.value.length >16)
	{
		obj1.focus();
		alert(str);
		return true;
	}
    if(obj1.value != obj2.value)
	{
		obj1.focus();
		obj1.value = '';
		obj2.value = '';
		alert(str2);
		return true;
	}
}


//???????
function CheckNum(id,s,b,str)
{
	var obj=document.getElementById(id)
	if(obj.value.length<s || obj.value.length>b)
	{
		alert(str);
		obj.focus();
		return true;
	}
}

//??EMAIL
function CheckEmail(id,str,str2)
{
	var obj=document.getElementById(id)
	if(obj.value.length!=0)
	{
		if (obj.value.charAt(0)=="." || obj.value.charAt(0)=="@"|| obj.value.indexOf('@', 0) == -1 || obj.value.indexOf('.', 0) == -1 || obj.value.lastIndexOf("@")==obj.value.length-1 || obj.value.lastIndexOf(".")==obj.value.length-1)
		{
			alert(str2);
			obj.focus();
			return true;
		}
	}	
	else
	{
		alert(str);
		obj.focus();
		return true;
	}

}

function CheckEmail2(id,str)
{
	var obj=document.getElementById(id)
	if(obj.value.length!=0)
	{
		if (obj.value.charAt(0)=="." || obj.value.charAt(0)=="@"|| obj.value.indexOf('@', 0) == -1 || obj.value.indexOf('.', 0) == -1 || obj.value.lastIndexOf("@")==obj.value.length-1 || obj.value.lastIndexOf(".")==obj.value.length-1)
		{
			alert(str);
			obj.focus();
			return true;
		}
	}
}

//??????
function CheckNan(id,str)
{
	var obj=document.getElementById(id)
	if (isNaN(obj.value) || obj.value=='')
	{
		alert(str);
		obj.focus();
		return true;
	}
}

//????????
function CheckDate(id,str)
{
	var obj=document.getElementById(id)
	date=obj.value
	execScript('inreturn=IsDate("'+date+'")','vbscript')
	if (inreturn==false)
	{  
		alert(str);
		obj.focus();
		return true;
	}
}
//????????
function CheckChecked(id,str)
{
	var obj=document.getElementById(id)
	if (obj.checked==false)
	{  
		alert(str);
		obj.focus();
		return true;
	}
}

//?????????
function CheckUpload(form,name,filepath,str1,str2)
{
   var file_local=document.all[form].all[name].value;
   if (file_local<=0)
   {
		alert(str1);
		return true;
   }
   var reg=/([^\\]+)$/.exec(file_local);
   var filename=RegExp.$1;
   var url=filepath+filename
   var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP")
   xmlhttp.abort();
   xmlhttp.open("GET",url,false)
   xmlhttp.send()
   if (xmlhttp.readyState==4)
   {
		if (xmlhttp.status==200)
		{
			if (confirm(str2))
			{
				return false;
			}
			else
			{
				return true;
			}
		}
   }
}  

//??????
function AutoSubmit(form) 
{
	document.all[form].submit();
}

//================================================?????????================================================



//================================================????================================================

//????
function ChangeImg(name,url)
{
	document.images[name].src=url
}

function Change2Img(name,url,url2)
{
	
	var obj=document.images[name].src
	if (obj.indexOf(url)!=-1)
	{
		document.images[name].src=url2;
	}
	else
	{
		document.images[name].src=url;
	}
}

//???????
var flag=false; 
function EditImg(ImgD,widthD,heightD)
{ 
	var image=new Image(); 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0)
	{ 
		flag=true; 
		if(image.width/image.height>= widthD/heightD)
		{ 
			if(image.width>widthD)
			{ 
				ImgD.width=widthD; 
				ImgD.height=(image.height*widthD)/image.width; 
			}
			else
			{ 
				ImgD.width=image.width; 
				ImgD.height=image.height; 
			} 
			ImgD.alt=image.width+"x"+image.height; 
		} 
		else
		{ 
			if(image.height>heightD)
			{ 
				ImgD.height=heightD; 
				ImgD.width=(image.width*heightD)/image.height; 
			}
			else
			{ 
				ImgD.width=image.width; 
				ImgD.height=image.height; 
			} 
				ImgD.alt=image.width+"x"+image.height; 
			} 
	} 
} 

//================================================????================================================


//================================================????,????================================================

//????
function SmallWindow(str,w,h)
{
	window.open(str,'','width='+w+',height='+h+',toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');
}

//?????
function IsOrNot(str)
{
	if(confirm(str))
	{
		return true;
	}
	else
	{
		history.go(-1);
		return false;
	}
}

//????????????(??BTCHINA)
function showTip(msg)
{
    var obj = 'TipBox';
    document.all[obj].style.visibility = 'hidden';
    if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut);
	if (document.all[obj].style.visibility != 'visible')
	{
		document.all[obj].innerHTML = msg;
		var x = event.x;
		var y = event.y;
		var objp = document.all.TipBox.style;
		objp.pixelLeft = x;
		objp.pixelTop = y;
	}
	document.all[obj].style.visibility = 'visible';
}
function keepTip()
{
    var obj = 'TipBox';
    if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut);
    document.all[obj].style.visibility = 'visible';
}
function hideTip()
{
    hideTimeOut = setTimeout('delayHide()', 180);
}
function delayHide()
{
    var obj = 'TipBox';
    document.all[obj].style.visibility = 'hidden';
    if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut);
}
    document.write('<div id="TipBox" style="width:100px; word-break:break-all;position: absolute; visibility: hidden; padding:3px; background-Color: #ffffee; filter: alpha(Opacity=80); border: 1px solid #000000;  text-algin:justify;" onMouseover="keepTip()" onMousewheel="keepTip()" onMouseout="hideTip()"></div>');



//================================================????,????================================================



//================================================???????================================================
function ShowContent(id)
{
	document.getElementById(id).style.display="block";
}
function HiddenContent(id)
{
	document.getElementById(id).style.display="none";
}
function IsShow(theid)
{
	var obj=document.getElementById(theid).style
	if (obj.display=="none")
	{
		obj.display="block";
	}
	else if(obj.display=="block")
	{
		obj.display="none";
	}
}

function EnableContent(id)
{
	document.getElementById(id).style.disabled=false;
}
function DisableContent(id)
{
	document.getElementById(id).style.disabled=true;
}

function ChangeClassName(method,id_value,class_value)
{
	if (method==0) document.getElementById(id_value).className=class_value;
	if (method==1) document.getElementsByName(id_value).className=class_value;	
}
//================================================???????================================================


//================================================??================================================

//MSN??
function AddMsn (address) 
{
	//alert(address);
	if (MsgrUIA.MyStatus == 1)
	{
		alert('??MSN????,????');
	}
	else if(MsgrUIA.MyStatus == 2 || MsgrUIA.MyStatus == 10 || MsgrUIA.MyStatus == 14 || MsgrUIA.MyStatus == 34 || MsgrUIA.MyStatus == 50 || MsgrUIA.MyStatus == 66 || MsgrUIA.MyStatus == 6) 
	{ //2,10, 14, 34, 50,66,6
		MsgrUIA.InstantMessage(address);
	}
	else if (MsgrUIA.MyStatus == 512 || MsgrUIA.MyStatus == 768)
	{
		alert('??MSN????,???');
	}
	else 
	{
		alert('?????MSN??????IE???,???MSN?????' + address );
	}
	//alert(emailaddr);
}

//QQ??
function picsize(obj,MaxWidth)
{
	img=new Image();//????Image??,??????width?????width?0???
	img.src=obj.src;
	if (img.width>MaxWidth)
	{
		return MaxWidth;
	}
	else
	{
		return img.width;
	}
}
var online= new Array();
function AddQQ(address)
{
	if (online[0]==0)
	{
		var img_name="qq_.jpg"
		var title="?????,???"
	}
	else
	{
		var img_name="qq.jpg"
		var title="??????"
	}	
	document.write("<a class='qqa' target=blank href='http://wpa.qq.com/msgrd?V=1&Uin="+address+"&Site=????&Menu=yes' title='"+title+"'><img src=../images/old_version/"+img_name+" border=0 align=middle></a>");
}

function disableRightClick(e)

{

  var message = "Right click disabled";

  

  if(!document.rightClickDisabled) // initialize

  {

    if(document.layers) 

    {

      document.captureEvents(Event.MOUSEDOWN);

      document.onmousedown = disableRightClick;

    }

    else document.oncontextmenu = disableRightClick;

    return document.rightClickDisabled = true;

  }

  if(document.layers || (document.getElementById && !document.all))

  {

    if (e.which==2||e.which==3)

    {

      alert(message);

      return false;

    }

  }

  else

  {

    alert(message);

    return false;

  }

}
//================================================??================================================

//-->