String.prototype.trim = function(){
	return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""))
}

String.prototype.startsWith = function(str) {
	return (this.match("^"+str)==str)
}
String.prototype.endsWith = function(str) {
	return (this.match(str+"$")==str)
}
function IncludeJavaScript(jsFile){
	document.write('<script type="text/javascript" src="' + jsFile + '"></script>');
}

function getFile() {
  if (window.XMLHttpRequest) {              
    AJAX=new XMLHttpRequest();                
} else {
	AJAX=new ActiveXObject("Microsoft.XMLHTTP");
  }  if (AJAX) {
		AJAX.open("GET", "/html/client_ip.jsp", false);
		AJAX.send(null);     
		return AJAX.responseText;                                         
	} else {     
		return false;
	}                                             
}
var client_ip = getFile();

if((client_ip==null) || (!client_ip.startsWith("10.") && !client_ip.startsWith("198.252.189.") && !client_ip.startsWith("198.252.190."))){
	IncludeJavaScript('/html/javascript/google.js');
}


function trackClick(category, action, opt_label, opt_value){
	//alert('in 3rd party trackClick: ' + category + ' ' + action + ' ' + opt_label + ' ' + opt_value);
	if(typeof trackGAClick == 'function') { 
		trackGAClick(category, action, opt_label, opt_value); 
	} 
}
