<!--
/*******************************************************************************
	OLDIE - or Old IE. A script that finds the version of IE you're using,
	and redirects if lower than the set parameter.
	[[ Created by Ryan McLaughlin, www.DaoByDesign.com ]]
*******************************************************************************/
var browser		= navigator.appName
var ver			= navigator.appVersion
var thestart	= parseFloat(ver.indexOf("MSIE"))+1 //This finds the start of the MS version string.
var brow_ver	= parseFloat(ver.substring(thestart+4,thestart+7)) //This cuts out the bit of string we need.

if ((browser=="Microsoft Internet Explorer") && (brow_ver <= 6)) //By default the min. IE ver is set to 6. Change as desired.
	{
	window.location="/oldie.html"; //URL to redirect to.
	}
//-->

function nextPage(formId) {
  form = $("#"+formId);
  pageElement = $("#"+formId+" input[name=page]");
  currentValue = Number($(pageElement).attr("value"));
  $(pageElement).attr("value", currentValue+1);
  form.submit();
}
function previousPage(formId) {
  form = $("#"+formId);
  pageElement = $("#"+formId+" input[name=page]");
  currentValue = $(pageElement).attr("value");
  $(pageElement).attr("value", currentValue-1);
  form.submit();
}

function setSelectedSection(pagename) {
	$("#products").css( "color", "black" );
	$("#forums").css( "color", "black" );
	$("#contact").css( "color", "black" );
	$("#blog").css( "color", "black" );
	
	$(pagename).css( "color", "cyan" );
}

function setupProductItem (product, isReleased) {
	$("#details_"+product).hide();
	$("#toggle_"+product).toggle(function(){
		$("#toggle_"+product).attr( "src", "/images/collapse.gif");
		$("#details_"+product).animate({ height: 'show' }, 'slow');
	},function(){
		$("#toggle_"+product).attr( "src", "/images/expand.gif");
		$("#details_"+product).animate({ height: 'hide' }, 'slow');
	});
	if ( isReleased ) {
		$("#version_"+product).prepend("Current Version: ");
		$("#release_date_"+product).prepend("Released: ");
	} else {
		$("#version_"+product).text("This Product is not yet Released");
		$("#release_date_"+product).prepend("Release Date: ");
	}
}


/* WARFARE JAVASCRIPT */
function setupSidebar() {
	$(".window a").hover( 
		function() {
			$(this).animate({ color: "#FFFFFF" }, 100);
		}
	,
		function() {
			$(this).animate({ color: "#AA0000" }, "slow");
		}
	);
}



function gotoUrl(url, dictionary) {
  params = "";
  paramCount = 0;
  for ( var key in dictionary.items ) {
    if ( paramCount > 0 ) params += "&"
    else params += "?";
    params += key.toString()+"="+dictionary.items[key];
    
    paramCount++;
  }
  window.location = url + params;
}

function Hash()
{
	this.length = 0;
	this.items = new Array();
	for (var i = 0; i < arguments.length; i += 2) {
		if (typeof(arguments[i + 1]) != 'undefined') {
			this.items[arguments[i]] = arguments[i + 1];
			this.length++;
		}
	}
   
	this.removeItem = function(in_key)
	{
		var tmp_previous;
		if (typeof(this.items[in_key]) != 'undefined') {
			this.length--;
			var tmp_previous = this.items[in_key];
			delete this.items[in_key];
		}
	   
		return tmp_previous;
	}

	this.getItem = function(in_key) {
		return this.items[in_key];
	}

	this.setItem = function(in_key, in_value)
	{
		var tmp_previous;
		if (typeof(in_value) != 'undefined') {
			if (typeof(this.items[in_key]) == 'undefined') {
				this.length++;
			}
			else {
				tmp_previous = this.items[in_key];
			}

			this.items[in_key] = in_value;
		}
	   
		return tmp_previous;
	}

	this.hasItem = function(in_key)
	{
		return typeof(this.items[in_key]) != 'undefined';
	}
}

// Animates the dimensional changes resulting from altering element contents
// Usage examples: 
//    $("#myElement").showHtml("new HTML contents");
//    $("div").showHtml("new HTML contents", 400);
//    $(".className").showHtml("new HTML contents", 400, 
//                    function() {/* on completion */});
(function($)
{
   $.fn.showHtml = function(html, speed, callback)
   {
      this.each(function()
      {
         var el = $(this);
         var finish = {width: this.style.width, height: this.style.height};
         var cur = {width: el.width()+'px', height: el.height()+'px'};

         el.html(html);

         var next = {width: el.width()+'px', height: el.height()+'px'};

         el .css(cur)
            .animate(next, speed, function() 
            {
               el.css(finish);
               if ( $.isFunction(callback) ) callback();
            });
      });
   };


})(jQuery);