var xmlHttp
//////////
function checkcode3(id){
   checkcodesendRequest3("/action.php?action=checkcode&code="+id);

}

function checkcodesendRequest3(url){
	xmlHttp=GetXmlHttpObject(checkcodestateChanged3)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 
function checkcodestateChanged3() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
//	alert(xmlHttp.responseText);
//document.getElementById("divtemp").innerHTML=xmlHttp.responseText;
if(xmlHttp.responseText == '2'){
checkcodestr_notice.innerHTML="<font color='green'>验证码输入正常!</font>";
myform.cok.value='ok';
}else{
checkcodestr_notice.innerHTML="<font color='red'>验证码输入错误!</font>";
myform.cok.value='';
} 

	}
} 

///////---------------------
function pingjia(id,id2){
    checkNicksendRequest("action.php?action=pingjia&id="+id+"&ss="+id2);
}

function checkNicksendRequest(url){
	xmlHttp=GetXmlHttpObject(checkNickstateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 
function checkNickstateChanged() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
//	alert(xmlHttp.responseText);
//document.getElementById("divtemp").innerHTML=xmlHttp.responseText;
if(xmlHttp.responseText == '1'){
alert("感谢您的评价！");
//username_notice.innerHTML="<font color='red'>您注册的会员名含有非法字符，请重新填写。</font>";
//myform.username.focus();
//}else if(xmlHttp.responseText == '2'){
//username_notice.innerHTML="<font color='red'>您注册的会员名已被使用，请重新填写。</font>";
//myform.username.focus();
//}else{
//username_notice.innerHTML="<font color=green>您注册的会员名尚未被使用，可以注册。</font>";
}

	}
} 



/////////////////////////////////////////////////////////////////////////////////////////

function GetXmlHttpObject(handler){ 
	var objXmlHttp=null
	if (navigator.userAgent.indexOf("Opera")>=0){
		alert("This example doesn't work in Opera") 
	return; 
	}
	
	if (navigator.userAgent.indexOf("MSIE")>=0){ 
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0){
			strName="Microsoft.XMLHTTP"
		} 
		try{ 
		objXmlHttp=new ActiveXObject(strName)
		objXmlHttp.onreadystatechange=handler 
		return objXmlHttp
		} 
		catch(e){ 
		alert("Error. Scripting for ActiveX might be disabled") 
		return 
		} 
	} 
	if (navigator.userAgent.indexOf("Mozilla")>=0){
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler 
		return objXmlHttp
	}
} 


var flag=false; 
function setpicWH(ImgD,w,h)
{ 
	var image=new Image();
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0)
	{ 
		flag=true; 
		if(image.width/image.height>= w/h)
		{ 
			if(image.width>w)
			{  
				ImgD.width=w; 
				ImgD.height=(image.height*w)/image.width; 
				ImgD.style.display="block";
			}else{ 
				ImgD.width=image.width;  
				ImgD.height=image.height; 
				ImgD.style.display="block";
			} 
		}else{
			if(image.height>h)
			{  
				ImgD.height=h; 
				ImgD.width=(image.width*h)/image.height; 
				ImgD.style.display="block"; 
			}else{ 
				ImgD.width=image.width;  
				ImgD.height=image.height; 
				ImgD.style.display="block";
			} 
		} 
	} 
}
// - End of JavaScript - -->

