<!-- External JavaScript Library, gg.js -->
<!-- Copyright(c)1999-2010 by Darrel Brooks -->
<!-- v1.3 posted 30-11-2010 -->
<!-- all rights reserved -->

  function Is () {

     // convert all characters to lowercase to simplify testing
     var agt=navigator.userAgent.toLowerCase()

     // *** BROWSER VERSION ***
     this.major = parseInt(navigator.appVersion)
     this.minor = parseFloat(navigator.appVersion)

     this.nav = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)))
     this.nav4up = this.nav && (this.major >= 4)
     this.navonly = (this.nav && (agt.indexOf(";nav") != -1))

     this.ie = (agt.indexOf("msie") != -1)
     this.ie4up = this.ie  && (this.major >= 4)

     this.opera = (agt.indexOf("opera") != -1)
  }

  var is = new Is()

	// open the GRiDmail window

	function openGRiDmail(navText) {
		gotoText = "http://www.gamegrid.org/gridmail.php?GRiD=";
		gotoText += navText;
		window.open(gotoText, "GRiDmail", "toolbar=no, location=no, directories=no, statusbar=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=575, height=645");
	}

	// open the BLoG Post window

	function openChatPost(navText) {
		gotoText = "http://www.gamegrid.org/chat_post.php";
		gotoText += navText;
		window.open(gotoText, "ChatPost", "toolbar=no, location=no, directories=no, statusbar=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=575, height=645");
	}

	// do the status bar quick

  function quickStatus(quickText) {
    window.status = quickText;
  	return true;
	};
	
	// open a window to spec or max

  function openAdScreen (urladdress, winName, MaxWidth, MaxHeight) {
    if (MaxWidth == 0) MaxWidth = screen.availWidth;
    if (MaxHeight == 0) MaxHeight = screen.availHeight;

    command = "window.open(urladdress, winName, 'dependent=yes,width=";
    if (MaxWidth > 820) MaxWidth = 820;
    command += MaxWidth;
    command += ",height="
    if (MaxHeight > 740) MaxHeight = 740;
    command += MaxHeight;
    command += ",menubar=no,scrollbars=no,personalbar=no,status=no,titlebar=no,toolbar=no,resizable=no,screenX=0,screenY=0');";
    eval (command);
  };

	// right clickers

	var urlAddress="http://www.gamegrid.org/clicked/index.htm";
	function noway(go) { 
		if (document.all) { 
			if (event.button == 2) {
				openAdScreen(urlAddress, "RiGhTCLiCKeD", 485, 0);
				return false;
			}
		} 
		if (document.layers) { 
			if (go.which == 3) {
				openAdScreen(urlAddress, "RiGhTCLiCKeD", 485, 0);
				return false;
			}
		} 
	};
	
	if (RCdisable) { var byPass = RCdisable; } else { var RCdisable = false; }
	
	if (RCdisable == false) {
	
		if (document.layers) { document.captureEvents(Event.MOUSEDOWN); } 
		document.onmousedown=noway;
	}; 
	
	// mobile users
	
	function IsMobile() {
	
		//Initialize our user agent string to lower case.
		var uagent = navigator.userAgent.toLowerCase();
		var cwidth = document.body.clientWidth;
		
		//document.writeln('<p>' + uagent + '</p>');
	
		if (uagent.search('playbook') > -1) return false;
		if (uagent.search('iphone') > -1)	return true;
		if (uagent.search('ipod') > -1) return true;
		if (uagent.search('series60') > -1) return true;
		if (uagent.search('symbian') > -1) return true;
		if (uagent.search('webkit') > -1) return true;
		if (uagent.search('android') > -1) return true;
		if (uagent.search('windows ce') > -1) return true;
		if (uagent.search('blackberry') > -1) return true;
		if (uagent.search('palm') > -1) return true;
		if (cwidth < 985) return true;
		return false;
	};
	
	// playbook or iPad

	function IsPlayBook() {
	
		//Initialize our user agent string to lower case.
		var pbagent = navigator.userAgent.toLowerCase();
		var awidth = document.body.clientWidth;
		
		//document.writeln('<p>' + uagent + '</p>');
	
		if (pbagent.search('playbook') > -1) return true;
		if (awidth < 1175) return true;
		return false;
	};


