/*** Media Player Functions ***/
// New
$(function() {
	$('a[href^="/player"]').click(function(){
		var loc = this.href;
		gmPlayer = window.open(loc, 'gmPlayer', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=980,height=600,left=50,top=50');
		return false;
	});
});
// Old
function goPlayer(query) {
	gmPlayer = window.open('/player'+(query?query:''), 'gmPlayer', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=980,height=600,left=50,top=50');
}

/*** Ajax Functions ***/
function createAjaxObj() {
	var httprequest=false
	if (window.XMLHttpRequest){ // if Mozilla, Safari etc
		httprequest=new XMLHttpRequest()
	if (httprequest.overrideMimeType)
		httprequest.overrideMimeType('text/xml')
	} else if (window.ActiveXObject) { // if IE
		try {
		httprequest=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e){
			try {
			httprequest=new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	return httprequest
}
var ajaxpack=new Object()
ajaxpack.basedomain="http://"+window.location.hostname
ajaxpack.ajaxobj=createAjaxObj()
ajaxpack.filetype="txt"
ajaxpack.noCache=1 // 1 = RANDOM NUMBERS ADDED TO STOP CACHING
/*************** GET REQUEST ***************/
ajaxpack.getAjaxRequest=function(url, parameters, callbackfunc, filetype) {
	ajaxpack.ajaxobj=createAjaxObj() //recreate ajax object to defeat cache problem in IE
	if (ajaxpack.noCache==1) //Further defeat caching problem in IE?
		var parameters=parameters+"&ajaxcachebust="+new Date().getTime()
	if (this.ajaxobj) {
		this.filetype=filetype
		this.ajaxobj.onreadystatechange=callbackfunc
		this.ajaxobj.open('GET', url+"?"+parameters, true)
		this.ajaxobj.send(null)
	}
}
/*************** POST REQUEST ***************/
ajaxpack.postAjaxRequest=function(url, parameters, callbackfunc, filetype) {
	ajaxpack.ajaxobj=createAjaxObj() //recreate ajax object to defeat cache problem in IE
	if (this.ajaxobj) {
		this.filetype=filetype
		this.ajaxobj.onreadystatechange = callbackfunc;
		this.ajaxobj.open('POST', url, true);
		this.ajaxobj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		this.ajaxobj.setRequestHeader("Content-length", parameters.length);
		this.ajaxobj.setRequestHeader("Connection", "close");
		this.ajaxobj.send(parameters);
	}
}

/**************** CLEAN UP THE RECAPTCHA BOX ****************/
var RecaptchaOptions = {
theme: 'clean'
};