﻿ function GetAjaxStr(strurl)
{
	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp.open("Get",strurl,false);
	xmlhttp.send();
	var strret=unescape(xmlhttp.ResponseText);
	return strret;
}
function GetStr(strurl)
{
	var reObj="";
	if ( window.XMLHttpRequest )
	{
		reObj= new XMLHttpRequest() ;
	}
	else if ( window.ActiveXObject )
	{	
		try
		{
			reObj=new ActiveXObject("MsXml2.XmlHttp") ;
		}
		catch(e)
		{
			reObj=new ActiveXObject("Microsoft.XMLHTTP")
		}
	}
	reObj.open("Get",strurl,false);
	reObj.send(null);
	var strret=reObj.ResponseText;
	return strret;
}

// add by 2008-5-13
function isIE(){ //ie? 
if (window.navigator.userAgent.toLowerCase().indexOf("msie")>=1) 
    return true; 
else 
    return false; 
} 

if(!isIE()){ //firefox innerText define
    HTMLElement.prototype.__defineGetter__("innerText", 
    function(){
        var anyString = "";
        var childS = this.childNodes;
        for(var i=0; i<childS.length; i++) {
            if(childS[i].nodeType==1)
                //anyString += childS[i].tagName=="BR" ? "\n" : childS[i].innerText;
                anyString += childS[i].innerText;
            else if(childS[i].nodeType==3)
                anyString += childS[i].nodeValue;
        }
        return anyString;
    } 
    ); 
    HTMLElement.prototype.__defineSetter__("innerText", 
    function(sText){
        this.textContent=sText; 
    } 
    ); 
}

function checkTxtkeyword(){
	if(document.getElementById("txtkeyword").value == "" || document.getElementById("txtkeyword").value == "keyword"){
		alert("Please enter a search query!");	
		return false;
	}else
		return true;
}
