var elcaps = new Array();
var elsyns = new Array();

elcaps[0] = 'Luster';
elcaps[1] = 'FAQS';
elcaps[2] = 'Shank';
elcaps[3] = 'Chef\'s Special';
elcaps[4] = 'Out at the Wedding';
elcaps[5] = 'Treading Water';

elcaps[6] = 'QUOD ONE';
elcaps[7] = 'QUEER CLUB';
elcaps[8] = 'QUOD SHOP';
elcaps[9] = 'QUOD VOD';

elsyns[0] = 'Waking up after an orgy is only the beginning of an unforgettable weekend for Jackson, a blue-haired, queercore loving, zine producer and poet.';
elsyns[1] = 'India finds himself trying to survive on the rough streets of LA; tossed out by his parents, exploited by pornographers and starved, he soon crosses paths with Destiny, a gun-toting tranny who saves him from a couple of queer-bashers.';
elsyns[2] = 'Writhing with untamed sexuality and aggression, this blistering British indie centers on Cal, a teenage thug so desperate to hide his gay cravings from his gang members that he binges on drugs, anonymous sex and acts of violence.';
elsyns[3] = 'Chef Maxi\'s life is about to move off the menu in this entertaining Spanish farce, bustling with quick witted dialogue and comical hi-jinks.';
elsyns[4] = 'Ever tell a little white lie that got slightly out of hand? New-Yorker Alex (Andrea Macellus) gets embroiled in a farcical web of mistaken identities - and sexualities - when she decides to keep her mixed-raced boyfriend a secret from her family at her sister\'s wedding.';
elsyns[5] = 'Casey and Alex share an unshakable bond, having created a perfect life for themselves in upscale Massachusetts - but demons continue to plague Casey as her mother refuses to accept that her little girl has not turned into the perfect daughter she\'d always dreamed of.';
//elsyns[5] = 'Some loves stand the test of time but what is true happiness and what is it\'s price? A tender and original drama.';


elsyns[6] = 'QUOD ONE is a free to view entertainment channel featuring travel, chat shows and behind the scenes documentaries.';
elsyns[7] = 'Watch the hottest music sets from world class DJ\'s combined with the sexiest international go-go dancers found on the club scene - all for free.';
elsyns[8] = 'QUODSHOP currently features a 1hr 30min programme showcasing the hottest Aussiebum fashions and photo-shoots form the last few years.';
elsyns[9] = 'QUOD Video On Demand';

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
//document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0
var tton = true;

function loadjscssfile(filename, filetype, el){
 if (filetype=="js"){ //if filename is a external JavaScript file
  var fileref=document.createElement('script')
  fileref.setAttribute("type","text/javascript")
  fileref.setAttribute("src", filename)
  alert('JS File Loading');
 }
 else if (filetype=="css"){ //if filename is an external CSS file
  var fileref=document.createElement("link")
  fileref.setAttribute("rel", "stylesheet")
  fileref.setAttribute("type", "text/css")
  fileref.setAttribute("href", filename)
 }
 if (typeof fileref!="undefined")
  //document.getElementsByTagName("head")[0].appendChild(fileref)
  document.getElementById(el).appendChild(fileref)
}

function dhtmlLoadScript(url)
{
   var e = document.createElement("script");
   e.src = url;
   e.type="text/javascript";
   //document.getElementsByTagName("head")[0].appendChild(e); 
   document.getElementById('bannerHolder').appendChild(e);
}




// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    if (event.clientX && document.body.scrollLeft) tempX = event.clientX + document.body.scrollLeft
    if (event.clientY && document.body.scrollTop) tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  //document.Show.MouseX.value = tempX
  //document.Show.MouseY.value = tempY
  return true
}

function showThumbNews(text)
{
	tooltip.show('',text);
}


function showThumb(elid)
{
	if (tton) tooltip.show(elcaps[elid - 1],elsyns[elid - 1]);
	/*document.getElementById('thumbTT').style.display = 'block';
	document.getElementById('thumbTT').style.left = (tempX + 10) + 'px';
	document.getElementById('thumbTT').style.top = (tempY + 10) + 'px';*/
	//window.status = tempX;
	//document.getElementById('thumbTT_Title').innerHTML = elcaps[elid - 1];
}

function hideThumb()
{
	tooltip.hide();
	//document.getElementById('thumbTT').style.display = 'none';
}

var tooltip=function(){
 var id = 'tt';
 var top = 3;
 var left = 3;
 var maxw = 300;
 var speed = 10;
 var timer = 20;
 var endalpha = 95;
 var alpha = 0;
 var tt,t,c,b,h;
 var ie = document.all ? true : false;
 return{
  show:function(v,s,w){
   if(tt == null){
    tt = document.createElement('div');
    tt.setAttribute('id',id);
    /*t = document.createElement('div');
    t.setAttribute('id',id + 'top');*/
    c = document.createElement('div');
    c.setAttribute('id',id + 'cont');
    b = document.createElement('div');
    b.setAttribute('id',id + 'bot');
   // tt.appendChild(t);
    tt.appendChild(c);
    tt.appendChild(b);
    document.body.appendChild(tt);
    tt.style.opacity = 0;
    tt.style.filter = 'alpha(opacity=0)';
    document.onmousemove = this.pos;
   }
   w = 180;
   tt.style.display = 'block';
   c.innerHTML = v;
   b.innerHTML = s;
   tt.style.width = w ? w + 'px' : 'auto';
   if(!w && ie){
    t.style.display = 'none';
    b.style.display = 'none';
    tt.style.width = tt.offsetWidth;
    t.style.display = 'block';
    b.style.display = 'block';
   }
  if(tt.offsetWidth > maxw){tt.style.width = maxw + 'px'}
  h = parseInt(tt.offsetHeight) + top;
  clearInterval(tt.timer);
  tt.timer = setInterval(function(){tooltip.fade(1)},timer);
  },
  pos:function(e){
   var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY;
   var l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX;
   tt.style.top = (u - h) + 'px';
   tt.style.left = (l + left) + 'px';
  },
  fade:function(d){
   var a = alpha;
   if((a != endalpha && d == 1) || (a != 0 && d == -1)){
    var i = speed;
   if(endalpha - a < speed && d == 1){
    i = endalpha - a;
   }else if(alpha < speed && d == -1){
     i = a;
   }
   alpha = a + (i * d);
   tt.style.opacity = alpha * .01;
   tt.style.filter = 'alpha(opacity=' + alpha + ')';
  }else{
    clearInterval(tt.timer);
     if(d == -1){tt.style.display = 'none'}
  }
 },
 hide:function(){
  clearInterval(tt.timer);
   tt.timer = setInterval(function(){tooltip.fade(-1)},timer);
  }
 };
}();

function goVOD(title,film,channel)
{
 if (tton) window.open('http://video.quod.tv/' + channel + '/?keyword=' + title + '&play=' + film);
}

function hidetopthumbs()
{
	//tton = false;
	//document.getElementById('topThumbs').style.visibility = 'hidden';
}

function showComp()
{
	hidetopthumbs();
	
	document.getElementById('area1horoscopes').style.display = 'none';
	document.getElementById('area1freestuff').style.display = 'none';
	document.getElementById('area1comp').style.display = 'block';
	player.sendEvent('STOP');
}

function showHoroscopes()
{
	hidetopthumbs();
	document.getElementById('area1comp').style.display = 'none';
	document.getElementById('area1freestuff').style.display = 'none';
	document.getElementById('area1horoscopes').style.display = 'block';
	player.sendEvent('STOP');
}

function showFreeStuff()
{
	hidetopthumbs();
	document.getElementById('area1comp').style.display = 'none';
	document.getElementById('area1horoscopes').style.display = 'none';
	document.getElementById('area1freestuff').style.display = 'block';
	player.sendEvent('STOP');
}

function showLinks()
{
	hidetopthumbs();
	document.getElementById('area1comp').style.display = 'none';
	document.getElementById('area1freestuff').style.display = 'none';
	document.getElementById('area1horoscopes').style.display = 'none';
	document.getElementById('area1links').style.display = 'block';
	if (player) player.sendEvent('STOP');
}

function loadHoro(sign)
{
	//alert(sign);
	document.getElementById('area1horoscopes').style.backgroundImage = 'url(../assets/Images/horoscopes/GB-' + sign + '.jpg)';
	document.getElementById('horoText').innerHTML = eval(sign);
	
}

function swapImage(el,state)
{
	isrcnow = el.src
	li = isrcnow.lastIndexOf('/') + 1;
	ipath = isrcnow.substr(0,li);
	isrcnow = isrcnow.substr(li,isrcnow.length - li);
	//nativeAlert(isrcnow);
	if (state==0) isrcnew = isrcnow.replace('-on.','.');
	if (state==1) isrcnew = isrcnow.replace('.','-on.');
	el.src = ipath + isrcnew;
	//nativeAlert(el.src);	
}

function loadVid(vname)
{
	//nativeAlert(player);
	//document.getElementById('videoDiv').style.visibility = 'visible';
	//document.getElementById('videoTitle').innerHTML = vtitle;
	player.sendEvent('STOP');
	videonow = '/assets/trailers/' + vname;
	setTimeout("player.sendEvent('LOAD','" + videonow + "')",1000);
	//setTimeout("player.sendEvent('PLAY')",1500);
}

var xmlhttp;
var dtarget;

function loadXMLDoc(url,target)
{
xmlhttp=null
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
	  dtarget = target;
  xmlhttp.onreadystatechange=state_Change
  xmlhttp.open("POST",url,true)
  xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
  xmlhttp.send(null)
  }
else
  {
  alert("Your browser does not support XMLHTTP.")
  }
}

function state_Change()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
  {
  // if "OK"
  if (xmlhttp.status==200)
  {
  //alert(xmlhttp.getResponseHeader("Content-Type"));
  //alert(xmlhttp.responseText);
  //alert(document.getElementById(dtarget));
  document.getElementById(dtarget).innerHTML=xmlhttp.responseText;
  }
  else
  {
  alert("Problem retrieving page data:" + xmlhttp.statusText)
  }
  }
}

