function showPoint(name,tip){
    var se=document.getElementById(name);
    var pl=document.getElementsByName(name);
    for(var i=0;i<pl.length;i++){
        if(pl[i].checked){
            se.innerHTML=tip+"<b>"+pl[i].value+"</b>";
            break;
        }
    }
}
function submitComment(){
    var s,p,h,e,l,c;
    s=document.getElementsByName("Services");
    p=document.getElementsByName("Prices");
    h=document.getElementsByName("Health");
    e=document.getElementsByName("Equip");
    l=document.getElementsByName("Local");
    c=document.getElementsByName("Comfort");
    if(checkRadioGroup(s)||checkRadioGroup(p)||checkRadioGroup(h)||checkRadioGroup(e)||checkRadioGroup(l)||checkRadioGroup(c)){
        alert("请选择所有的评分项,谢谢.");
        return false;
    }
    ct=document.getElementById("Comment");
    if(ct.value.replace(/\s/g,"")==""){
        alert("请输入评论内容");
        ct.focus();
        return false;
    }debugger;
    setCookie("Comment",ct.value);
    if(!getCookie("user"))
    window.location.href="/login.aspx?url="+encodeURIComponent(document.location);
    
}
function checkRadioGroup(list){
    for(var i=0;i<list.length;i++){
        if(list[i].checked){
            return false;
        }
    }
    return true;
}
	function AlertMsg(obj){
		var sWidth,sHeight;
		sWidth = window.screen.availWidth;
		if(window.screen.availHeight > document.body.scrollHeight){  
			sHeight = window.screen.availHeight;  
		}else{
			sHeight = document.body.scrollHeight;   
		}
		var maskObj = document.createElement("div");
		maskObj.setAttribute('id','BigDiv');
		maskObj.style.position = "absolute";
		maskObj.style.top = "0";
		maskObj.style.left = "0";
		maskObj.style.background = "#000";
		maskObj.style.filter = "Alpha(opacity=60);";
		maskObj.style.opacity = "0.3";
		maskObj.style.width = sWidth + "px";
		maskObj.style.height = sHeight + "px";
		maskObj.style.zIndex = "10000";
		document.body.appendChild(maskObj);

      
        var MyDiv =document.getElementById(obj);
		var MyDiv_w = getStyle(MyDiv,"width");
		var MyDiv_h = getStyle(MyDiv,"height");
	    
		MyDiv_w = parseInt(MyDiv_w);
		MyDiv_h = parseInt(MyDiv_h);

		var width = pageWidth(); 
		var height = pageHeight();
		var left = leftPosition();
		var top = topPosition();

		var Div_topposition = top + (height / 2) - (MyDiv_h / 2); 
		var Div_leftposition = left + (width / 2) - (MyDiv_w / 2); 

		MyDiv.style.left = Div_leftposition + "px";
		MyDiv.style.top =  Div_topposition + "px";
		MyDiv.style.display = "block";
		return false;
	}

	function CloseDiv(obj){
		var Bigdiv = document.getElementById("BigDiv");
		var Mydiv = document.getElementById(obj);
		document.body.removeChild(Bigdiv); 
		Mydiv.style.display="none";
	}
function pageWidth(){
			 return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
}

function pageHeight(){
			 return window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;
}

function topPosition(){
			  return typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
}

function leftPosition(){
			 return typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;
}

function getStyle(elem, name){
			if(elem.style[name])
				return elem.style[name];
			else if(elem.currentStyle)	//ie
				return elem.currentStyle[name];
			else if(document.defaultView && document.defaultView.getComputedStyle){
				name = name.replace(/([A-Z])/g,"-$1");
				name = name.toLowerCase();
				
				var s = document.defaultView.getComputedStyle(elem,"");
				return s && s.getPropertyValue(name);
			} else
				return null
}
