
function gid(id){return document.getElementById?document.getElementById(id):null;}
function Browser(){var ua, s, i;this.isIE = false;this.isNS = false;this.isOP = false;this.isSF = false;ua = navigator.userAgent.toLowerCase();s = "opera";if ((i = ua.indexOf(s)) >= 0){this.isOP = true;return;}s = "msie";if ((i = ua.indexOf(s)) >= 0) {this.isIE = true;return;}s = "netscape6/";if ((i = ua.indexOf(s)) >= 0) {this.isNS = true;return;}s = "gecko";if ((i = ua.indexOf(s)) >= 0) {this.isNS = true;return;}s = "safari";if ((i = ua.indexOf(s)) >= 0) {this.isSF = true;return;}}
function gname(name){return document.getElementsByTagName?document.getElementsByTagName(name):new Array()}
function mcl(show, div, btn, over, padd){var objdiv = gid(div);var objbtn = gid(btn);if (objdiv && objbtn){var browser = new Browser();if (show){objdiv.style.display = "block";if (browser.isIE && over){var allselect = gname("select");for (var i=0; i<allselect.length; i++){allselect[i].style.visibility = "hidden";}}objdiv.style.top = (objbtn.offsetTop + objbtn.offsetHeight - 2) + "px";objdiv.style.left = (objbtn.offsetLeft - (padd?0:50)) + "px";}else{objdiv.style.display = "none";if (browser.isIE && over){var allselect = gname("select");for (var i=0; i<allselect.length; i++){allselect[i].style.visibility = "visible";}}}}}

function getHost(url)
 { 
        var host = "null";
        if(typeof url == "undefined" || null == url)
        url = window.location.href;
        var regex = /.*\:\/\/([^\/]*).*/;
        var match = url.match(regex);
        if(typeof match != "undefined"&& null != match)
                host = match[1];
        //return host+"/webview";
        return host;
}
function request(name)
{
  var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
  var r = window.location.search.substr(1).match(reg);
  if (r!=null) return unescape(r[2]); return null;
}
function requestcn(name)
{
  var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
  var r = window.location.search.substr(1).match(reg);
  if (r!=null) return decodeURI(r[2]); return null;
}
function replaceMspace(strpost)
{
	//strpost=strpost.replace(/(^[\s+|　+])|([\s+|　+]$)/g,"").replace(/\s+|　+/g," ");
	//strpost=strpost.replace(/(^(\\s|.*\\s+.*)$)/g,"");
	//strpost=strpost.replace(/(^\s*)|(\s*$)/g, ""); 
	strpost=strpost.replace(/(^\s*)/g, ""); 
	strpost=strpost.replace(/(\s*$)/g, ""); 
	return strpost
}
function replaceMjia(strpost)
{
	//strpost=strpost.replace(/([\+])/g," ");
//	strpost=LTrim(strpost);
//	strpost=RTrim(strpost);
	return strpost
}
//function LTrim(strpost)
//{
//    strpost=strpost.replace(/(^\s*)/g, ""); 
//    return strpost
//}
//function RTrim(strpost)
//{
//    strpost=strpost.replace(/(\s*$)/g, ""); 
//    return strpost
//}

//String.prototype.Trim = function() 
//{ 
//return this.replace(/(^\s*)|(\s*$)/g, ""); 
//} 

//String.prototype.LTrim = function() 
//{ 
//return this.replace(/(^\s*)/g, ""); 
//} 

//String.prototype.RTrim = function() 
//{ 
//return this.replace(/(\s*$)/g, ""); 
//} 

function sendtofriend()
{
	
	var id="";
	id=request('msg_id');
	if(id!="")
	{
		win=window.open('../commonpage/sendtofriend.aspx?type=42&id='+id,'推荐家教信息给好友','width=350,height=300,top=100,left=100,resizable=yes,scrollbars=yes,status=0');
		win.focus();
	}
	
}
function dojudge(sign,type)
{
	var id=judgeid;
	//id=request('msg_id');	
	if(id!=""&&id!=null)
	{
		win=window.open('../commonpage/dojudge.aspx?type='+type+'&sign='+sign+'&id='+id,'信息评价','width=500,height=200,top=100,left=100,resizable=yes,scrollbars=yes,status=0');
		win.focus();
	}
}
function contactMe(userid)
{
	//var id=judgeid;
	//id=request('msg_id');	
	if(userid!=""&&userid!=null)
	{
		win=window.open('../messages/contactMe.aspx?userid='+userid,'联系我','width=500,height=200,top=100,left=100,resizable=yes,scrollbars=yes,status=0');
		win.focus();
	}
}