var baseurl = 'http://ganjavideo.com/';
var mTimer;

function toggle(obj) {var el = document.getElementById(obj);
if ( el.style.display != 'none' ) {el.style.display = 'none';}else {el.style.display = '';}}

function requestVideo() {
  var rWindow;
  var link = "/requestvideo.php?title=";
  link = link + document.getElementById('titlerequest').value;
  rWindow = window.open(link, "requestVideo", "width=520,height=370,scrollbars");
  if (rWindow.open) {
    rWindow.close;
  }
  rWindow.focus();
}

function premium_status() {
  var ppWindow;
  var link = "/premium_status.php";
  ppWindow = window.open(link, "PremiumStatus", "width=620,height=540,scrollbars");
  if (ppWindow.open) {
    ppWindow.close;
  }
  ppWindow.focus();
}

function getvidlink(vidid, coded) {
  var cWindow;
  var link = "/videolink.php?v=";
  link = link + coded; link = link + "&VIDEOID="; link = link + vidid;
  cWindow = window.open(link, "getVideoLink", "width=1040,height=730,scrollbars,location=0,resizable");
  if (cWindow.open) {
    cWindow.close;
  }
  cWindow.focus();
}

function showdiv() {
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById('flashcontent').style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.flashcontent.display = 'block';
		}
		else { // IE 4
			document.all.flashcontent.style.display = 'block';
		}
	}
}


function tShowOn(which,html){
if (document.getElementById) {
var MouseX = MousePosition.x-80;
var MouseY = MousePosition.y-80;
document.getElementById("tShowInfo").style.left = MouseX+"px";
document.getElementById("tShowInfo").style.top = MouseY+"px";
document.getElementById("tShowInfo").style.display='block';
document.getElementById("tShowInfo").style.visibility='visible';
document.getElementById("tShowInfo").innerHTML=html;
}else{
 tShowInfo.innerHTML=html;
}
}

function tShowOut(which){
if (document.getElementById){
document.getElementById("tShowInfo").style.display='none';
document.getElementById("tShowInfo").style.visibility='hidden';
document.getElementById("tShowInfo").innerHTML='&nbsp;';
}else{
tShowInfo.innerHTML='&nbsp;';
}
}


function getmirrors(vid, mid){
vic="v"+vid;
Parent = document.getElementById(vic);
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; }
var url="/ajax/get_mirrors.php"; url=url+"?vid="+vid; url=url+"&mid="+mid; url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true); xmlHttp.send(null);}

function playPart2(vid){
vic="v"+vid;
Parent = document.getElementById(vic);
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; }
var url="/ajax/play_part2.php"; url=url+"?vid="+vid; url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true); xmlHttp.send(null);}

function GetXmlHttpObject(){
var xmlHttp=null;
try  { xmlHttp=new XMLHttpRequest(); }
catch (e) { try  {  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } }return xmlHttp;}

function stateChanged(){if (xmlHttp.readyState==4){tid=xmlHttp.responseText;Parent.innerHTML = tid;}}
function stateChanged2(){if (xmlHttp.readyState==4){tid=xmlHttp.responseText;Parent.innerHTML = tid;}}


var tabsClass={tabSetArray:new Array(),classOn:"current",classOff:"",addTabs:function(vtabsl){tabs=document.getElementById(vtabsl).getElementsByTagName("li");for(x in tabs){if(typeof(tabs[x].id)!="undefined"){this.tabSetArray.push(tabs[x].id);}else{}}},switchTab:function(element){for(x in this.tabSetArray){tabItem=this.tabSetArray[x];dataElement=document.getElementById(tabItem+"_data");if(dataElement){if(dataElement.style.display!="none"){dataElement.style.display="none";}else{}}else{}
tabElement=document.getElementById(tabItem);if(tabElement){if(tabElement.className!=this.classOff){tabElement.className="";}else{}}else{}}
document.getElementById(element.id+"_data").style.display="";element.className=this.classOn;}};

