// get url $_GET[] vars and values
function getUrlVars() {
	var vars = {};
	var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
		vars[key] = value;
	});
	return vars;
}

// Validate Email 
function isValidEmailAddress(emailAddress) 
{
	var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
	return pattern.test(emailAddress);
}

// Pre-load images
(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)

function getBrowserHeight()
{
        var myHeight = 0;
        if( typeof( window.innerWidth ) == 'number' )
        {
                //Non-IE
                myHeight = window.innerHeight;
        }
        else
        {
                if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
                {
                        //IE 6+ in 'standards compliant mode'
                        myHeight = document.documentElement.clientHeight;
                }
                else
                {
                        if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
                        {
                                //IE 4 compatible
                                myHeight = document.body.clientHeight;
                        }
                }
        }
        return myHeight;
}

function getBrowserWidth()
{
        var myWidth = 0
        if( typeof( window.innerWidth ) == 'number' )
        {
                //Non-IE
                myWidth = window.innerWidth;
        }
        else
        {
                if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
                {
                        //IE 6+ in 'standards compliant mode'
                        myWidth = document.documentElement.clientWidth;
                }
                else
                {
                        if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                                //IE 4 compatible
                                myWidth = document.body.clientWidth;
                        }
                }
        }
        return myWidth;
}

function getNextHistoryURL()
{
        return history.next;
}

function resizeSWF(x,y)
{
        var item = document.getElementById("StrobeMediaPlayback");
        var height = getBrowserHeight();

        if(y == 0)
        {
                if(height < 580)
                {
                        item.style.height = 580;
                }
                else
                {
                        item.style.height = height;
                }
        }
        else if(height > y)
        {
                item.style.height = height;
        }
        else if(y < 580)
        {
                item.style.height = 580;
        }
        else if(y > height)
        {
                item.style.height = y;
        }

}
