var elcaps = new Array();
var elsyns = new Array();

elcaps[0] = 'Back Soon';
elcaps[1] = 'Twisted';
elcaps[2] = 'The Art of Being Straight';
elcaps[3] = 'Another Gay Movie';
elcaps[4] = 'Another Gay Sequel';
elcaps[5] = 'Itty Bitty Titty Committee';

elcaps[6] = 'QUOD ONE';
elcaps[7] = 'QUEER CLUB';
elcaps[8] = 'QUODTRAVEL';
elcaps[9] = 'ON DEMAND';

elsyns[0] = 'A tender, sexy drama that explores the depths of love, loss, identity and hope for two straight guys.';
elsyns[1] = 'Documenting \'the year of debauchery\' that was International DJ\'s Stewart Who? & WayneG\'s worldwide tour to promote their number 1 dance track, TWISTED.';
elsyns[2] = 'It\'s not easy being attracted to guys when you are stuck in a straight man\'s body... at least that\'s the hurdle Josh has to face.';
elsyns[3] = 'Candy-coloured, hilariously raunchy sex comedy about 4 high school graduates\' mission to lose their virginity.';
elsyns[4] = 'The boys are back and they\'re as horny as ever! Get another fix of celebrity cameos and total gross-out humour with the sequel to Another Gay Movie.';
elsyns[5] = 'A revolutionary romantic comedy about queer feminist radicals reclaiming the streets for riot girls everywhere';
//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] = 'Check out a world of gay & lesbian destinations & people with our favourite queer travel series, Bump!';
elsyns[9] = 'View trailers and select from our entire library of programming. Its all here for you.';

// 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) 
{
//player.sendEvent('STOP');
//window.open('http://video.quod.tv/' + channel + '/?keyword=' + title + '&play=' + film);
window.location = '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 loadHoro(sign)
{
	//alert(sign);
	document.getElementById('area1horoscopes').style.backgroundImage = 'url(../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);	
}


