function getCat(catId,catTitle)
{
    var catId, catTitle;
    document.getElementById("cid").value=catId;

	var catTitleHtml = document.getElementById("catTitle");
	catTitleHtml.value=catTitle;
    
    if(document.getElementById("quckfind").value!='Quick Find');
    {
        document.getElementById("quckfind").value='Quick Find'
    }
    catAjax(catId);
}

function getCatPerson(catId,catTitle)
{
	  var catId, catTitle;
    document.getElementById("cid").value  = catId;
    document.getElementById("catTitle").value = catTitle;
    if(document.getElementById("quckfind").value  !=  'Quick Find');
    {
        document.getElementById("quckfind").value = 'Quick Find'
    }

  
   catAjaxPerson(catId);
   
    
}

function getCatSponsor(catId,catTitle)
{
	  var catId, catTitle;
    document.getElementById("cid").value  = catId;
    document.getElementById("catTitle").innerHTML = catTitle;
    if(document.getElementById("quckfind").value  !=  'Quick Find');
    {
        document.getElementById("quckfind").value = 'Quick Find'
    }
  
    catAjaxSponsor(catId);
    
    //alert("fthfh");
    showHint("","0",catId);
}

/****************************************/
function showHintCat(query)
{
    var catId,pageId,query;
	//alert(query);
    catId   = document.getElementById("cid").value;
    pageId  = document.getElementById("pageId").value;
    
    showHint(query,pageId,catId);
}
/************************************************/
var win = null;
function PopWindow(mypage,myname,w,h,scroll){
    LeftPosition  = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition   = (screen.height) ? (screen.height-h)/2 : 0;
    settings      = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
    win           = window.open(mypage,myname,settings)
}
/************************************************/
function showHide(boxName) {
    //set the object to a variable, so we can simplfy the code
    theBox  = document.getElementById(boxName);
    //if the class equals our visible code, set the class to the hidden box style, else set the class to the visible box style
    if (theBox.className == "boxVisible") {
        theBox.className = "boxHidden";
    }
    else {
        theBox.className = "boxVisible";
    }
}

//  FUNCTION FOR COUNTING THE HITS UPON SPONSORS  ******************************/
function countHits(spid){
    //alert(spid);    
    
    var xmlhttp;
    if (window.XMLHttpRequest)
    {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }
    else if (window.ActiveXObject)
    {
        // code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    else
    {
        alert("Your browser does not support XMLHTTP!");
    }
    xmlhttp.onreadystatechange=function()
    {
        if(xmlhttp.readyState==4)
        {
            //alert(xmlhttp.responseText);
        }
    }
    
    var url='updateCounter.php';
    var spid;
    url = url+"?spid="+spid;   
    
    url = url+"&sid="+Math.random();
    
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}
