﻿// JScript File

// JScript File

//<!--

	// One must place each button name here, so that they can be preloaded:
	var	buttons = new Array("Home, Features, Sample, Tournaments, Contact");

	// Preload our images.
	var n, m, o, p;
	for(i=0;i<buttons.length;i++)
	{
		n = new Image();
		n.src = "images/tabs/" + buttons[i] + "_active.gif";
		m = new Image();
		m.src = "images/tabs/" + buttons[i] + "_active_mo.gif";
		o = new Image();
		o.src = "images/tabs/" + buttons[i] + "_inactive.gif";
	    p = new Image();
		p.src = "images/tabs/" + buttons[i] + "_inactive_mo.gif";
	}

	// This function makes our button glow
	function glow(what)
	{
	    //var cntrl = $get(what);
	    //if (cntrl.status == "inactive")
	    //{
		    what = document[what];
		    if (what == undefined || what == null) return;
		    what.src = "images/tabs/" + what.name + "_inactive_mo.gif";
		//}
		//else
		//{
		//    what = document[what];
		//    if (what == undefined || what == null) return;
		//    what.src = "images/tabs/" + what.name + "_active_mo.gif";
		//}
	}

	function dim(what)
	{
        var cntrl = document.getElementById(what);
        if (cntrl == null)
            cntrl = document.getElementById("ctl00_" + what);
    
		if (cntrl.longDesc.endsWith("inactive"))
	        cntrl.src = "images/tabs/" + what + "_inactive.gif";
		else
		    cntrl.src = "images/tabs/" + what + "_active.gif";

	}

    function display(item) {
        var show = document.getElementById(item);
        show.style.visibility = 'visible';
    }
    
    function hide(item) {
        var hide = document.getElementById(item);
        hide.style.visibility = 'hidden';
    }
    
    function setTab(pg) {
        var home, features, sample, tournaments, contact;
        home = document.getElementById('home');
        if (home == null)
            home = document.getElementById("ctl00_home");
        features = document.getElementById('features');
        if (features == null)
            features = document.getElementById("ctl00_features");
        sample = document.getElementById('sample');
        if (sample == null)
            sample = document.getElementById("ctl00_sample");
        tournaments = document.getElementById('tournaments');
        if (tournaments == null)
            tournaments = document.getElementById("ctl00_tournaments");
        contact = document.getElementById('contact');
        if (contact == null)
            contact = document.getElementById("ctl00_contact");
        //$get('home').longDesc = "inactive";
        //$get('features').longDesc = "inactive";
        //$get('sample').longDesc = "inactive";
        //$get('tournaments').longDesc = "inactive";
        //$get('contact').longDesc = "inactive";
        var cntrl = document.getElementById(pg);
        if (cntrl == null)
            cntrl = document.getElementById("ctl00_" + pg);
        cntrl.longDesc = "active";
        dim(cntrl.name);
    }
     
     function getParameter ( queryString, parameterName ) {
            // Add "=" to the parameter name (i.e. parameterName=value)
            var parameterName = parameterName + "=";
            if ( queryString.length > 0 ) {
            // Find the beginning of the string
            begin = queryString.indexOf ( parameterName );
            // If the parameter name is not found, skip it, otherwise return the value
            if ( begin != -1 ) {
            // Add the length (integer) to the beginning
            begin += parameterName.length;
            // Multiple parameters are separated by the "&" sign
            end = queryString.indexOf ( "&" , begin );
            if ( end == -1 ) {
            end = queryString.length
            }
            // Return the string
            return unescape ( queryString.substring ( begin, end ) );
            }
            // Return "null" if no parameter has been found
            return "null";
            }
        }
    

//-->