function CenterWindow(mypage,myname) {
		var w
		var h


		if (screen.width == 800) { w=650 }
		if (screen.width == 800) { h=395 }

		if (screen.width == 1024) { w=650 } 
		if (screen.width == 1024) { h=395 }

		if (screen.width == 1280) { w=650 }
		if (screen.width == 1280) { h=395 }

		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;


		var settings ='height='+h+',';
		settings +='width='+w+',';
		settings +='top='+wint+',';
		settings +='left='+winl+',';
		settings +='scrollbars='+scroll+',';
		settings +='resizable=yes';
		win=window.open(mypage,myname,settings);

		if (parseInt(navigator.appVersion) >= 4) {
			win.window.focus();
		}
	}
	



function getElementsByClassName(oElm, strTagName, strClassName){
    var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    strClassName = strClassName.replace(/-/g, "-");
    var oRegExp = new RegExp("(^|s)" + strClassName + "(s|$)");
    var oElement;
    for(var i=0; i<arrElements.length; i++){
        oElement = arrElements[i];
        if(oRegExp.test(oElement.className)){
            arrReturnElements.push(oElement);
        }
    }
    return (arrReturnElements)
}








function createRequestObject() {
    var tmpXmlHttpObject;
    
    //depending on what the browser supports, use the right way to create the XMLHttpRequest object
    if (window.XMLHttpRequest) { 
        // Mozilla, Safari would use this method ...
        tmpXmlHttpObject = new XMLHttpRequest();
	
    } else if (window.ActiveXObject) { 
        // IE would use this method ...
        tmpXmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    return tmpXmlHttpObject;
}

//call the above function to create the XMLHttpRequest object
var http = createRequestObject();


function addRef(clickId) {
    //make a connection to the server ... specifying that you intend to make a GET request 
    //to the server. Specifiy the page name and the URL parameters to send
    http.open('get', '/refv2/go.php?id=' + clickId);
    	
    //assign a handler for the response
    //http.onreadystatechange = processResponse;
	
    //actually send the request to the server
    http.send(null);
}

function addRefSite(site) {
    //make a connection to the server ... specifying that you intend to make a GET request 
    //to the server. Specifiy the page name and the URL parameters to send
    http.open('get', '/refv2/go.php?site=' + site);
    	
    //assign a handler for the response
    //http.onreadystatechange = processResponse;
	
    //actually send the request to the server
    http.send(null);
}



function processResponse() {
    //check if the response has been received from the server
    
    /*
    if(http.readyState == 4){
	
        //read and assign the response from the server
        var response = http.responseText;
		
        //do additional parsing of the response, if needed
		
        //in this case simply assign the response to the contents of the <div> on the page. 
        document.getElementById('description').innerHTML = response;
		
        //If the server returned an error message like a 404 error, that message would be shown within the div tag!!. 
        //So it may be worth doing some basic error before setting the contents of the <div>
    }
    */
}

	function addBookmark(title,url) {
	if (window.sidebar) {
	window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
	window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
	return true;
	}
	}