/* 

    Flick Slideshow Lite v 1.0: 2006-05-15 
 
        Copyright 2006 - Paul Russell - http://russelldad.googlepages.com
        
        This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
 
        

        The functions in this file are used by multiple pages in the 
        slideshow.       
        
        
        
        STANDARD DISCLAIMER: No warranties, either express or implied, are hereby given. All
        software is supplied as is, without guarantee. The user assumes all
        responsibility for damages resulting from the use of this software,
        including, but not limited to, frustration, disgust, system abends, disk
        head-crashes, general malfeasance, floods, fires, shark attack, nerve
        gas, locust infestation, cyclones, hurricanes, tsunamis, local
        electromagnetic disruptions, hydraulic brake system failure, invasion,
        hashing collisions, normal wear and tear of friction surfaces, comic
        radiation, inadvertent destruction of sensitive electronic components,
        windstorms, the Riders of Nazgul, infuriated chickens, malfunctioning
        mechanical or electrical sexual devices, premature activation of the
        distant early warning system, peasant uprisings, halitosis, artillery
        bombardment, explosions, cave-ins, and/or frogs falling from the sky. 
        This text was stolen from http://www.alertbear.com/
        
        
*/



/***********************************************************
* PageQuery(q) creates an object that lets you interrigate 
* the parameters passed along with the page URL. I found this 
* code @ http://www.eggheadcafe.com/articles/20020107.asp and 
* made only minor modifications to persist the object instead
* of creating a new one for each property request.
**************************************************************/
function PageQuery(q) 
{
    if(q.length > 1) 
    {
        this.q = q.substring(1, q.length);
    }
    else 
    {
        this.q = null;
    }
    
    
    this.keyValuePairs = new Array();

    
    if(q) 
    {
        for(var i=0; i < this.q.split("&").length; i++) 
        {
            this.keyValuePairs[i] = this.q.split("&")[i];
        }
    }
    
    this.getKeyValuePairs = function() { return this.keyValuePairs; }
    
    this.getValue = function(s) 
                    {
                        for(var j=0; j < this.keyValuePairs.length; j++) 
                        {
                            if(this.keyValuePairs[j].split("=")[0] == s)
                            {
                                return this.keyValuePairs[j].split("=")[1];
                            }
                        }
                        
                        return false;
                    }
                    
    this.getParameters = function() 
                        {
                            var a = new Array(this.getLength());
                            for(var j=0; j < this.keyValuePairs.length; j++) 
                            {
                                a[j] = this.keyValuePairs[j].split("=")[0];
                            }
                            return a;
                        }
                        
    this.getLength = function() { return this.keyValuePairs.length; }
}  

/* this is the local storage of the search query properties  */
var __page__query__properties__ = new PageQuery(window.location.search);


// gets the value of the given property from the URL string that got 
// you to the current page. 
function getProperty(name)
{
    return __page__query__properties__.getValue(name);

}

/* this is an easy way for us to call document.getElementById() */
function _gel(elementID)
{
    return document.getElementById(elementID);
}


