// Browser Detect Lite  v1.01
// http://www.dithered.com/javascript/browser_detect/index.html
// modified by Chris Nott (chris@dithered.com)

function BrowserDetectLite() {
	var agent = navigator.userAgent.toLowerCase(); 
	
	// Browser version
	this.versionMajor = parseInt(navigator.appVersion); 
	this.versionMinor = parseFloat(navigator.appVersion); 

	// Browser name
	this.ns    = (agent.indexOf('mozilla')!=-1 && agent.indexOf('spoofer')==-1 && agent.indexOf('compatible') == -1 && agent.indexOf('opera')==-1 && agent.indexOf('webtv')==-1); 
	this.ns2   = (this.ns && this.versionMajor == 2); 
	this.ns3   = (this.ns && this.versionMajor == 3); 
	this.ns4   = (this.ns && this.versionMajor == 4); 
	this.ns4up = (this.ns && this.versionMajor >= 4); 
	this.ns6   = (this.ns && this.versionMajor == 5); 
	this.ns6up = (this.ns && this.versionMajor >= 5); 
	this.ie    = (agent.indexOf("msie") != -1); 
	this.ie3   = (this.ie && this.versionMajor < 4); 
	this.ie4   = (this.ie && this.versionMajor == 4 && agent.indexOf("msie 4.0") != -1); 
	this.ie4up = (this.ie && this.versionMajor >= 4); 
	this.ie5   = (this.ie && this.versionMajor == 4 && agent.indexOf("msie 5.0") != -1); 
	this.ie55  = (this.ie && this.versionMajor == 4 && agent.indexOf("msie 5.5") != -1);
	this.ie5up = (this.ie && !this.ie3 && !this.ie4); 
	this.ie6   = (this.ie && this.versionMajor == 4 && agent.indexOf("msie 6.0") != -1);
	this.ie6up = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie55); 
	this.opera = (agent.indexOf("opera") != -1); 
	this.webtv = (agent.indexOf("webtv") != -1); 
	this.aol   = (agent.indexOf("aol") != -1); 
	
	// Javascript version
	this.js = 0.0;
	if (this.ns2 || this.ie3) this.js = 1.0 
	else if (this.ns3 || this.opera || (document.images && this.ie && !this.ie4up)) this.js = 1.1 
	else if ((this.ns4 && this.versionMinor <= 4.05) || this.ie4) this.js = 1.2 
	else if ((this.ns4 && this.versionMinor > 4.05) || this.ie5up) this.js = 1.3 
	else if (this.ns6up) this.js = 1.4 

	// Platform type
	this.win   = (agent.indexOf("win")!=-1 || agent.indexOf("16bit")!=-1);
	this.win32 = (agent.indexOf("win95")!=-1 || agent.indexOf("windows 95")!=-1 || agent.indexOf("win98")!=-1 || agent.indexOf("windows 98")!=-1 || agent.indexOf("winnt")!=-1 || agent.indexOf("windows nt")!=-1 || (this.versionMajor >= 4 && navigator.platform == "win32") || agent.indexOf("win32")!=-1 || agent.indexOf("32bit")!=-1);
	this.mac   = (agent.indexOf("mac")!=-1);
}
var is = new BrowserDetectLite();



// REMOVE THE FOCUS OF THE LINKS --------------
function initonload ()
{
	// Remove links Focus 
	for(i=0;i<document.links.length;i++)
	{
//		document.links[i].onfocus=function() {if(this.blur)this.blur()}; 
	}	
}

// RELOAD THE PAGE FOR NETSCAPE : CSS
function initReloadForNS ()
{
}

// CHANGE THE CSS FOR NETSCAPE 4.7 PC
function modifyCSSforNS ()
{
	var fontSize = "10";
	if (is.win32 && is.ns4) 
	{
          document.tags.body.fontSize = fontSize;
          document.tags.td.fontSize = fontSize;
          document.tags.a.fontSize = fontSize;
          document.classes.smallInv.all.fontSize = fontSize;
          document.classes.content.all.fontSize = '11px';
          document.classes.contentJustified.all.fontSize = '11px';  			
	}
}

// OPEN A POPUP
if (is.mac) { var offsetMac = 0; } else { var offsetMac = 0; }

function pop(goPage,nom,windowWidth,windowHeight) 
{
	var x = 0;
	var y = 0;
	if (screen) x = (screen.availWidth - windowWidth) / 2;
	if (screen) y = (screen.availHeight - windowHeight) / 2;
	var popped = window.open(goPage,nom,'width='+windowWidth+',height='+(windowHeight+offsetMac)+',status=no,menubar=no,scrollbars=no,resizable=no,screenX='+x+',screenY='+y+',left='+x+',top='+y);
	if ( is.ns || document.all) popped.focus();
}

// OPEN JUKEBOX


// ORIGINAL height/width VALUES : 395, 419

function openOldJukeBox(id) {
  if (id) {
    pop('http://www.giantstep.net/jukebox/play/' + id + '/', 'jukebox', 395, 425);
  } else {
    pop('http://www.giantstep.net/jukebox/play/', 'jukebox', 395, 425);
  }
}

function openMSJukeBox(id) {
  if (id) {
    pop('http://www.giantstep.net/static/ms/jukebox/index.php?record_id=' + id + '', 'jukebox', 395, 425);
  } else {
    pop('http://www.giantstep.net/static/ms/jukebox/index.php', 'jukebox', 395, 425);
  }
}

function openJukeBox(id) {
  if (id) {
    if (id.indexOf("_")) {
        start = id.indexOf("_");
        id = id.substring(start+1);
    }

    pop('http://jukebox.giantstep.net/tracks/' + id + '?popup=true', 'jukebox', 494, 560);
  } else {
    pop('http://jukebox.giantstep.net/player?popup=true', 'jukebox', 494, 560);
  }
}

function openNewJukeBox(id) {
  if (id) {
    if (id.indexOf("_")) {
        start = id.indexOf("_");
        id = id.substring(start+1);
    }

    pop('http://jukebox.giantstep.net/tracks/' + id + '?popup=true', 'jukebox', 494, 560);
  } else {
    pop('http://jukebox.giantstep.net/player?popup=true', 'jukebox', 494, 560);
  }
}


// OPEN VIDEOBOX

// ORIGINAL height/width VALUES : 335, 350

function openVideoBox(id) {
pop('http://www.giantstep.net/videobox/' + 'video' + id + '.html', 'videobox', 335, 350);
}




// ROLLOVER SCRIPTS (from Dreamweaver)

function MM_swapImgRestore() 
{
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() 
{
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) 
{
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() 
{
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// FORMHANDLER


function formHandler(nav){
var URL = document.nav.gsNav.options[document.nav.gsNav.selectedIndex].value;
if (URL != '')
window.location.href = URL;
}

function forum_cat_handler(forum_form){
var URL = document.forum_form.forum_drop.options[document.forum_form.forum_drop.selectedIndex].value;
window.location.href = URL;
}



