// INSTRUCTIONS

// Place this script in the <head> of the page you will use
// for redirection *only*.  It should *not* be placed in a
// regular (content) page.

// Set page destinations for the various screen sizes below.
// If the pages are in the same directory as the page with
// this script, only the page filename is needed; otherwise
// use the full, http://www.site.com/page.html address.

// If you have one page used for more than one size (say,
// both 1024 and Larger), then use the same page address
// in each of the associated variables.

var pageFor640    = "sitesmall.php";
var pageFor800    = "sitesmall.php";
var pageFor1024   = "HTMLBARS/alfozan.htm";
var pageForLarger = "HTMLBARS/alfozan.htm";

// Set showAlert to "yes" if you wish an alert box to appear
// when the visitor hits your referer page; otherwise, set
// it to "no"

showAlert  = "no";

// This is the message that will be seen if showAlert is
// used; alter it as needed.

sayOnAlert = "Redirecting to a page designed for your screen size...";

// DO NOT EDIT BELOW THIS LINE.
// ----------------------------

var Wide = screen.width;

if (Wide == 640){
  if (showAlert == "yes"){
    alert(sayOnAlert);
  }
  window.location = pageFor640;
}

else if (Wide == 800){
  if (showAlert == "yes"){
    alert(sayOnAlert);
  }
  window.location = pageFor800;
}

else if (Wide == 1024){
  if (showAlert == "yes"){
    alert(sayOnAlert);
  }
 // window.location = pageFor1024;
}

else {
  if (showAlert == "yes"){
    alert(sayOnAlert);
  }
  //window.location = pageForLarger;
}

function locationmap(){
	locationWin = window.open("maps.html","locationWin","toolbars=no,address=no,left=10,top=10,status=no,width=720,height=480,scrollbars=no,resizable=no")
}

function privacy(){
	privacyWin = window.open("privacy.php","privacyWin","toolbars=no,address=no,left=10,top=10,status=no,width=468,height=400,scrollbars=yes,resizable=no")
}
function rules(){
	rulesWin = window.open("rules.php","rulesWin","toolbars=no,address=no,left=10,top=10,status=no,width=468,height=400,scrollbars=yes,resizable=no")
}
function highscores(){
		hsWin = window.open("leaderboard.php","leaderboard","toolbars=no,address=no,left=10,top=10,status=no,width=400,height=400,scrollbars=yes,resizable=no")
	}
	
function getbrowserwidth() {
    	if (navigator.userAgent.indexOf("MSIE") > 0)	{
        		return(screen.width);
       	} else {
            	return(window.screen.width);
       	}	
}
        
function getbrowserheight() {
	if (navigator.userAgent.indexOf("MSIE") > 0) {
		return(screen.height);
    } else {
		return(window.screen.height);
	}
}
				
var popup = new Object()

function CenterPopup(URL, popname, width, height, scrollbars) {
									
		// get center of browser window
        var X = getbrowserwidth()/2;
        var Y = getbrowserheight()/2;
                    	
        popup = window.open(URL, popname, 
                    		'scrollbars=' + scrollbars + ',' +
                    		'width=' + width + ',' +
                    		'height=' + height + ',' +
                    		'top=' + ((Y - (height/2))) + ',' +
                    		'left=' + ((X - (width/2))) 
                    		);
                    	
        popup.focus();
}