// FUNCTIONS SYSTEM
// v1.2 FOR QUEEN ONLINE
// Copyright 2001 
// GREG FINDON (greg@outsideline.co.uk)
// all functions are copyright of the author (except those marked as generic from Dreamweaver)
// http://www.outsideline.co.uk

//STYLE SHEET
app=navigator.userAgent.toLowerCase()
if (app.indexOf("msie")!=-1 || app.indexOf("mac")!=-1 || document.getElementsByTagName) {
document.writeln("<LINK REL='stylesheet' TYPE='text/css' HREF='../styles/ie.css'>");
}
else {
document.writeln("<LINK REL='stylesheet' TYPE='text/css' HREF='../styles/ns.css'>");
}


//REGULAR FUNCTIONS - GENERIC 
function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}

function MM_preloadImages() { //v3.0
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_swapImgRestore() { //v3.0
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_swapImage() { //v3.0
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];}
}
//END GENERIC FUNCTIONS



//--------------START MENU FUNCTIONS

function menu_rollover(section,newImage) {
	MM_swapImage("navbutton" + section,'',"../img/nav/"+newImage);
}
function menu_rollout() {
	MM_swapImgRestore();
}

//--------------END MENU FUNCTIONS




///WINDOW OPENERS
function openWin() {
 var popWin = window.open("","popWin","left=1,top=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=500,height=300");
}

//*-----------CORNER WINDOW
function open_corner() {
	var left=(screen.width-160)/2;
	var top=(screen.height-90)/2;
	corner =  window.open("wwry_popup.html","thecorner","left="+left+",top="+top+",width=160,height=90,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");

} 

function close_corner() {
  if (corner && corner.open && !corner.closed) corner.close();
}
//*-------------END CORNER WINDOW

//*-----------TRANSLATE
function open_translate(url) {
	var left=(screen.width-400)/2;
	var top=(screen.height-200)/2;
	corner =  window.open(url,"translate","left="+left+",top="+top+",width=400,height=200,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");

} 

//*------------CHAT LAUNCHER
			function chat_pop(url) {
				var window_height = screen.height-210;
				var window_width = 820;
			 	var chatwin=window.open(url,'chat','height=' + window_height + ',width=' + window_width + ',left=1,top=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1');
			}
			
//*-----------SHOP LAUNCHER
			function shop_pop(url) {
				var window_height = screen.height-210;
				var window_width = screen.width-50;
				 var shopwin=window.open(url,'shop','height=' + window_height + ',width=' + window_width + ',left=1,top=1,toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizeable=1');
			}

//*----------FANCLUB
			function fanclub_pop(url) {
				var window_height = screen.height-210;
				var window_width = screen.width-50;
			 	var shopwin=window.open(url,'fanclub','height=' + window_height + ',width=' + window_width + ',left=1,top=1,toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizeable=1');
			}

//BEN ELTON WINDOW
function openWin2() {
 var popWin2 = window.open("belton.html","popWin2","left=1,top=300,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=300,height=200");
				}

//----------------------------------------COMIC FUNCTIONS----------------------------------
function showcomicbuttons(chosen) {
	i=1;
	while(i<=4) {
		if(i!=chosen) {
			MM_showHideLayers('comicnavigatonroll'+i,'','hide');
		}
		else {
			MM_showHideLayers('comicnavigatonroll'+i,'','show');
			}
		
		
		i++;
		}
	}
	
function hidecomicbuttons() {
	i=1;
	while(i<=4) {
		MM_showHideLayers('comicnavigatonroll'+i,'','hide');
		i++;
		}
	}

var window_top = (screen.height-434)/2;
var window_left = (screen.width-770)/2;
function comic_pop(url) {
	var comicwin = window.open(url,'comicwin2','height=434,width=770,left='+ window_left +',top='+window_top+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizeable=0');
	}
//---------------------------------------- END COMIC FUNCTIONS----------------------------------
//---------------------------------------- VOTE FUNCTIONS----------------------------------
	
function vote_pop(votenumber,choice) {
	var window_top = (screen.height-204)/2;
	var window_left = (screen.width-204)/2;
	var url = "http://www.tidalflow.co.uk/outside/clients/queen/mediaAdmin/voteDisplay.php?votenumber=" + votenumber + "&choice=" + choice;
	var votewin = window.open(url,'votewindow','height=204,width=204,left='+ window_left +',top='+window_top+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0');
	}
	
//---------------------------------------- END VOTE FUNCTIONS----------------------------------
	
//---------------------------------------- LAUNCH FUNCTIONS----------------------------------

function site_launch(url,name) {
	var window_top = (screen.height-434)/2;
	var window_left = (screen.width-770)/2;
	var votewin = window.open(url,name,'height=434,width=770,left='+ window_left +',top='+window_top+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0');
	}

//---------------------------------------- END LAUNCH FUNCTIONS----------------------------------

//---------------------------------------- SPIRIT FUNCTIONS----------------------------------

function special3_launch() {
	var window_top = (screen.height-300)/2;
	var window_left = (screen.width-500)/2;
	var votewin = window.open('special3_pop.php','spiritpop','height=300,width=500,left='+ window_left +',top='+window_top+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0');
	}

//---------------------------------------- END SPIRIT FUNCTIONS----------------------------------

//---------------------------------------- AIR GUITAR FUNCTIONS----------------------------------

function special5_launch(url) {
	var window_top = (screen.height-434)/2;
	var window_left = (screen.width-485)/2;
	var spec5win = window.open(url,'main5','height=434,width=485,left='+ window_left +',top='+window_top+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0');
	}

function special5_launch2(url) {
	var window_top = (screen.height-454)/2;
	var window_left = (screen.width-505)/2;
	var spec5win2 = window.open(url,'comp5','height=434,width=485,left='+ window_left +',top='+window_top+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0');
	}
	
function airguitar_check() {
		var check=true;
		var error="You failed to complete the following compulsory fields;\n\n";
		if (document.forms['competition'].elements['firstname'].value=="") { error+="First Name\n";check=false;}
		if (document.forms['competition'].elements['surname'].value=="") { error+="Surname Address\n";check=false;}
		if (document.forms['competition'].elements['email'].value=="") { error+="Email\n";check=false;}
		if (document.forms['competition'].elements['track1'].value=="") { error+="Track 1\n";check=false;}
		if (document.forms['competition'].elements['track2'].value=="") { error+="Track 2\n";check=false;}
		if (document.forms['competition'].elements['track3'].value=="") { error+="Track 3\n";check=false;}
		if (document.forms['competition'].elements['track4'].value=="") { error+="Track 4\n";check=false;}
		if (document.forms['competition'].elements['track5'].value=="") { error+="Track 5\n";check=false;}
		if (document.forms['competition'].elements['track6'].value=="") { error+="Track 6\n";check=false;}
		if (document.forms['competition'].elements['track7'].value=="") { error+="Track 7\n";check=false;}
		if (document.forms['competition'].elements['track8'].value=="") { error+="Track 8\n";check=false;}
		if (document.forms['competition'].elements['track9'].value=="") { error+="Track 9\n";check=false;}
		if (document.forms['competition'].elements['track10'].value=="") { error+="Track 10\n";check=false;}

		//ERROR PRINT OR FORM SUBMIT

		if (error!="You failed to complete the following compulsory fields;\n\n"){alert(error);}
		return check;
	}
//---------------------------------------- END AIR GUITAR FUNCTIONS----------------------------------


//---------------------------------------- FREDDIE WALL FUNCTIONS----------------------------------
function box_check() {
		var check=true;
		var error="";
		if (document.forms['wall'].elements['message'].value.length>200) { error+="sorry your message is too long\n";check=false;}
		//ERROR PRINT OR FORM SUBMIT

		if (error!=""){alert(error);}
		return check;
	}
	
//---------------------------------------- END FREDDIE WALL FUNCTIONS----------------------------------

//---------------------------------------- REALITY TOUR FUNCTIONS----------------------------------
function realitytour_check() {
		var check=true;
		var error="You failed to complete the following compulsory fields;\n\n";
		if (document.forms['realitytour'].elements['firstname'].value=="") { error+="First Name\n";check=false;}
		if (document.forms['realitytour'].elements['surname'].value=="") { error+="Surname Address\n";check=false;}
		if (document.forms['realitytour'].elements['email'].value=="") { error+="Email\n";check=false;}
		if (document.forms['realitytour'].elements['country'].value=="") { error+="Country\n";check=false;}
	

		//ERROR PRINT OR FORM SUBMIT

		if (error!="You failed to complete the following compulsory fields;\n\n"){alert(error);}
		return check;
	}
//---------------------------------------- END REALITY TOUR FUNCTIONS----------------------------------



//---------------------------------------- GENERIC LAUNCHER----------------------------------
function genericwin(theurl,thename,thewidth,theheight,special,left,top) {
	if (special==1) { var left=(screen.width-thewidth)/2; var top=(screen.height-theheight)/2;}
	window.open(theurl,thename,'left='+left+',top='+top+',width='+thewidth+',height='+theheight+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
} 


//----------------ROCK YOU NEWS

//--------------------NEWS BOX
var news=1;
function wwry_news_button() {
	if (news==0) {
		//TURN ON BUTTON
		document.forms['wwryregister'].elements['moreinfo'].value="true";
		MM_swapImage('newsbutton','','../img/special/wwry_news_button_on.gif');
		news=1;
	}
	else {
		document.forms['wwryregister'].elements['moreinfo'].value="false";
		MM_swapImage('newsbutton','','../img/special/wwry_news_button_off.gif');
		news=0;
	}
}