// This checks to see if browser is IE 6. If so selects special css file. If not, checks if screen resolution is over 800, and sets normal css file. Otherwise leaves at low res css file setting.
// It also adjusts the table width for concert programme items, should the table exist.

var Itemfound2=false;
var navName = navigator.appName;
var brVer = navigator.userAgent;
var brNum;
var reg = new RegExp('/');
// Note the above line causes a syntax error in IE 4 and the error handler below kicks in

var sTargetURL = "indexbasic.html";

// ----------------------------------------------------------------------------------- //

function doRedirect()
	{
	    setTimeout( "window.location.href = sTargetURL", 2*1000 );
	}
function doRedirect()
	{
	    window.location.replace( sTargetURL );
	}
function handleError() {
		doRedirect();
		return true;
	}

window.onerror = handleError;

// ----------------------------------------------------------------------------------- //

function verNumIE() {
	var brVerId = brVer.indexOf('MSIE');
   brNum = brVer.substr(brVerId,8);
}
function verNumOt() {

var brVerId = brVer.search(reg);
   brNum = brVer.substring(brVerId+1);
}

// ----------------------------------------------------------------------------------- //

if (navigator.appName == 'Microsoft Internet Explorer') {
  verNumIE() ;
} else {
  verNumOt() ;
}

// Note the line below forces the basic page css for Netscape version prior to 5 (haven't checked if 5 works but know that 3 and 4 don't)

if (navigator.appName == 'Netscape'&& parseInt(brNum.charAt(0)) < 5) {
  link = document.getElementsByTagName("link")[0];
  link.href = "styles_basic.css";
} else {
	
var h=screen.height;
var w=screen.width;
var an=navigator.appName;

// alert(w + ' ' + h + ' ' + an + ' ' + brVer + ' ' + brNum);

	if (brNum == 'MSIE 6.0') {
	  link = document.getElementsByTagName("link")[0];
	  link.href = "styles_IE6.css";
	  } else {
  			if (screen.width > 800) {
			link = document.getElementsByTagName("link")[0];
			link.href = "styles_main.css";
			
 		 	 }

		   }
	}	

// ----------------------------------------------------------------------------------- //


function getItem2(itemId)
{
	Itemfound2=false;

 	if (document.getElementById) 
		{
		if(document.getElementById(itemId)!= null) 
			{
			Itemfound2=true;
			return document.getElementById(itemId);
			}
		else 
			{
		return false;
			}
		}
	if (document.all) {Itemfound2=true; return document.all[itemId];}
	return false;
 }

// ----------------------------------------------------------------------------------- //

function TableWidth()
		{

		if (screen.width >1300) 
			{			
			getItem2("programme");
			if (Itemfound2) 
			{
			tableptr = getItem2("programme");
			tableptr.style.width='30%';
			   }
 		 	}

		else if (screen.width >1023) 
			{

			getItem2("programme");
			if (Itemfound2) 
			{
			tableptr = getItem2("programme");
			tableptr.style.width='45%';
			   }
 		 	}

		else if (screen.width >799)  
			{
			getItem2("programme");
			if (Itemfound2) 
			{
			tableptr = getItem2("programme");
			tableptr.style.width='50%';
			   }
			}
		else 
			{
			getItem2("programme");
			if (Itemfound2) 
			{
			tableptr = getItem2("programme");
			tableptr.style.width='70%';
			   }
			}

		}
// ----------------------------------------------------------------------------------- //


