// Javascript library for marketing sites
// This js uses jQuery functions. Include jQuery FIRST!

/* click tracker - needs Google Analytics JS */
$(document).ready(function(){
 if (typeof(_gat) == 'object') {
  $('a').each(function() {
   var uri = $(this).attr('href');
	if (uri) {
	   if (uri.match(/^mailto/i)) {
	    $(this).click(function() { ahTracker._trackEvent('mailto', 'click', document.domain + ' | ' + uri.substr(7));siteTracker._trackEvent('mailto', 'click', uri.substr(7));});
	   } else if (uri.match(/^https?:/i)) {
	    $(this).click(function() { ahTracker._trackEvent('external', 'click', document.domain + ' | ' + uri);siteTracker._trackEvent('external', 'click', uri);});
	   } else if (uri.match(/\.[a-z]{3}$/i) && ! uri.match(/\.(aspx?|html?)([\?#].*)?$/i)) {
	  	var filetype = uri.substr(uri.length-3)
	    $(this).click(function() { ahTracker._trackEvent('downloads', filetype.toUpperCase(), document.domain + ' | ' + uri);siteTracker._trackEvent('downloads', filetype.toUpperCase(), uri);});
		}
	}
  });
 }
});


/*
 * Treeview 1.4 - jQuery plugin to hide and show branches of a tree
 * 
 * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
 * http://docs.jquery.com/Plugins/Treeview
 *
 * Copyright (c) 2007 Jörn Zaefferer
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $
 *
 */;(function($){$.extend($.fn,{swapClass:function(c1,c2){var c1Elements=this.filter('.'+c1);this.filter('.'+c2).removeClass(c2).addClass(c1);c1Elements.removeClass(c1).addClass(c2);return this;},replaceClass:function(c1,c2){return this.filter('.'+c1).removeClass(c1).addClass(c2).end();},hoverClass:function(className){className=className||"hover";return this.hover(function(){$(this).addClass(className);},function(){$(this).removeClass(className);});},heightToggle:function(animated,callback){animated?this.animate({height:"toggle"},animated,callback):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();if(callback)callback.apply(this,arguments);});},heightHide:function(animated,callback){if(animated){this.animate({height:"hide"},animated,callback);}else{this.hide();if(callback)this.each(callback);}},prepareBranches:function(settings){if(!settings.prerendered){this.filter(":last-child:not(ul)").addClass(CLASSES.last);this.filter((settings.collapsed?"":"."+CLASSES.closed)+":not(."+CLASSES.open+")").find(">ul").hide();}return this.filter(":has(>ul)");},applyClasses:function(settings,toggler){this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event){toggler.apply($(this).next());}).add($("a",this)).hoverClass();if(!settings.prerendered){this.filter(":has(>ul:hidden)").addClass(CLASSES.expandable).replaceClass(CLASSES.last,CLASSES.lastExpandable);this.not(":has(>ul:hidden)").addClass(CLASSES.collapsable).replaceClass(CLASSES.last,CLASSES.lastCollapsable);this.prepend("<div class=\""+CLASSES.hitarea+"\"/>").find("div."+CLASSES.hitarea).each(function(){var classes="";$.each($(this).parent().attr("class").split(" "),function(){classes+=this+"-hitarea ";});$(this).addClass(classes);});}this.find("div."+CLASSES.hitarea).click(toggler);},treeview:function(settings){settings=$.extend({cookieId:"treeview"},settings);if(settings.add){return this.trigger("add",[settings.add]);}if(settings.toggle){var callback=settings.toggle;settings.toggle=function(){return callback.apply($(this).parent()[0],arguments);};}function treeController(tree,control){function handler(filter){return function(){toggler.apply($("div."+CLASSES.hitarea,tree).filter(function(){return filter?$(this).parent("."+filter).length:true;}));return false;};}$("a:eq(0)",control).click(handler(CLASSES.collapsable));$("a:eq(1)",control).click(handler(CLASSES.expandable));$("a:eq(2)",control).click(handler());}function toggler(){$(this).parent().find(">.hitarea").swapClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).swapClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().swapClass(CLASSES.collapsable,CLASSES.expandable).swapClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightToggle(settings.animated,settings.toggle);if(settings.unique){$(this).parent().siblings().find(">.hitarea").replaceClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).replaceClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().replaceClass(CLASSES.collapsable,CLASSES.expandable).replaceClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightHide(settings.animated,settings.toggle);}}function serialize(){function binary(arg){return arg?1:0;}var data=[];branches.each(function(i,e){data[i]=$(e).is(":has(>ul:visible)")?1:0;});$.cookie(settings.cookieId,data.join(""));}function deserialize(){var stored=$.cookie(settings.cookieId);if(stored){var data=stored.split("");branches.each(function(i,e){$(e).find(">ul")[parseInt(data[i])?"show":"hide"]();});}}this.addClass("treeview");var branches=this.find("li").prepareBranches(settings);switch(settings.persist){case"cookie":var toggleCallback=settings.toggle;settings.toggle=function(){serialize();if(toggleCallback){toggleCallback.apply(this,arguments);}};deserialize();break;case"location":var current=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase();});if(current.length){current.addClass("selected").parents("ul, li").add(current.next()).show();}break;}branches.applyClasses(settings,toggler);if(settings.control){treeController(this,settings.control);$(settings.control).show();}return this.bind("add",function(event,branches){$(branches).prev().removeClass(CLASSES.last).removeClass(CLASSES.lastCollapsable).removeClass(CLASSES.lastExpandable).find(">.hitarea").removeClass(CLASSES.lastCollapsableHitarea).removeClass(CLASSES.lastExpandableHitarea);$(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings,toggler);});}});var CLASSES=$.fn.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"};$.fn.Treeview=$.fn.treeview;})(jQuery);

 
 /*	Top Navigation 
  * ----------------------------------------------------------- */
	
// adds a class to hovered nav items so dropdowns can work in ie6
function navDrop() {
  $("#navigation li").hover(
			  function() {
					$(this).addClass("showUl");			
				},
			  function() {
					$(this).removeClass("showUl");
				}
			);
}

// adds a class to ul if it has a child
function navHasChild() {
	$("#navigation li ul li").each(
			function(){
			  var theChild = $(this).find("ul");
			  if ( theChild.length > 0 ) {
				  $(this).addClass("hasChild");
			  }
	    }
  );
}
/*	Left Navigation 
	-----------------------------------------------------------*/
function leftmenu(){
	$('#subNav').treeview({
		collapsed: true,	
		persist: "location",
		unique: true
	});
}
 
 // Loads up the various functions we are going to use in marketing templates
$(document).ready(function(){
	jsEnabled();
	corners();
	boxLink();
	blockQuote();
	serviceLinks();
	textLogo();
	navDrop();	
	navHasChild();
	leftmenu();	
});

// Adds a class to the body so we can style differently depending on whether Javascript is enabled.
function jsEnabled() {
	$("body").addClass("jsenabled");	
}

// adds lots of divs used to create the rounded corners
function corners() {
  $("#header").append('<div class="corner24BL corner"><div class="shape01 dot"></div><div class="shape02 dot"></div><div class="shape03 dot"></div><div class="shape04 dot"></div><div class="shape05 dot"></div><div class="shape06 dot"></div><div class="shape07 dot"></div><div class="shape08 dot"></div><div class="shape09 dot"></div><div class="shape10 dot"></div><div class="shape11 dot"></div><div class="shape12 dot"></div><div class="shape13 dot"></div><div class="dot01 dot"></div><div class="dot02 dot"></div><div class="dot03 dot"></div><div class="dot04 dot"></div><div class="dot05 dot"></div><div class="dot06 dot"></div><div class="dot07 dot"></div><div class="dot08 dot"></div><div class="dot09 dot"></div><div class="dot10 dot"></div><div class="dot11 dot"></div><div class="dot12 dot"></div><div class="dot13 dot"></div><div class="dot14 dot"></div><div class="dot15 dot"></div><div class="dot16 dot"></div><div class="dot17 dot"></div><div class="dot18 dot"></div><div class="dot19 dot"></div><div class="dot20 dot"></div><div class="dot21 dot"></div><div class="dot22 dot"></div><div class="dot23 dot"></div><div class="dot24 dot"></div><div class="dot25 dot"></div><div class="dot26 dot"></div><div class="dot27 dot"></div><div class="dot28 dot"></div><div class="dot29 dot"></div><div class="dot30 dot"></div><div class="dot31 dot"></div><div class="dot32 dot"></div><div class="dot33 dot"></div><div class="dot34 dot"></div><div class="dot35 dot"></div><div class="dot36 dot"></div><div class="dot37 dot"></div><div class="dot38 dot"></div><div class="dot39 dot"></div><div class="dot40 dot"></div><div class="dot41 dot"></div><div class="dot42 dot"></div><div class="dot43 dot"></div><div class="dot44 dot"></div><div class="dot45 dot"></div></div>');
	$(".rounded .box").append('<div class="corner corner10TL"><div class="shape01 dot"></div><div class="shape02 dot"></div><div class="shape03 dot"></div><div class="dot01 dot"></div><div class="dot02 dot"></div><div class="dot03 dot"></div><div class="dot04 dot"></div><div class="dot05 dot"></div><div class="dot06 dot"></div><div class="dot07 dot"></div><div class="dot08 dot"></div><div class="dot09 dot"></div><div class="dot10 dot"></div><div class="dot11 dot"></div><div class="dot12 dot"></div><div class="dot13 dot"></div><div class="dot14 dot"></div><div class="dot15 dot"></div></div><div class="corner corner10TR"><div class="shape01 dot"></div><div class="shape02 dot"></div><div class="shape03 dot"></div><div class="dot01 dot"></div><div class="dot02 dot"></div><div class="dot03 dot"></div><div class="dot04 dot"></div><div class="dot05 dot"></div><div class="dot06 dot"></div><div class="dot07 dot"></div><div class="dot08 dot"></div><div class="dot09 dot"></div><div class="dot10 dot"></div><div class="dot11 dot"></div><div class="dot12 dot"></div><div class="dot13 dot"></div><div class="dot14 dot"></div><div class="dot15 dot"></div></div><div class="corner corner10BR"><div class="shape01 dot"></div><div class="shape02 dot"></div><div class="shape03 dot"></div><div class="dot01 dot"></div><div class="dot02 dot"></div><div class="dot03 dot"></div><div class="dot04 dot"></div><div class="dot05 dot"></div><div class="dot06 dot"></div><div class="dot07 dot"></div><div class="dot08 dot"></div><div class="dot09 dot"></div><div class="dot10 dot"></div><div class="dot11 dot"></div><div class="dot12 dot"></div><div class="dot13 dot"></div><div class="dot14 dot"></div><div class="dot15 dot"></div></div><div class="corner corner10BL"><div class="shape01 dot"></div><div class="shape02 dot"></div><div class="shape03 dot"></div><div class="dot01 dot"></div><div class="dot02 dot"></div><div class="dot03 dot"></div><div class="dot04 dot"></div><div class="dot05 dot"></div><div class="dot06 dot"></div><div class="dot07 dot"></div><div class="dot08 dot"></div><div class="dot09 dot"></div><div class="dot10 dot"></div><div class="dot11 dot"></div><div class="dot12 dot"></div><div class="dot13 dot"></div><div class="dot14 dot"></div><div class="dot15 dot"></div></div>');
	$(".rounded  p a em").append('<div class="corner corner10TL"><div class="shape01 dot"></div><div class="shape02 dot"></div><div class="shape03 dot"></div><div class="dot01 dot"></div><div class="dot02 dot"></div><div class="dot03 dot"></div><div class="dot04 dot"></div><div class="dot05 dot"></div><div class="dot06 dot"></div><div class="dot07 dot"></div><div class="dot08 dot"></div><div class="dot09 dot"></div><div class="dot10 dot"></div><div class="dot11 dot"></div><div class="dot12 dot"></div><div class="dot13 dot"></div><div class="dot14 dot"></div><div class="dot15 dot"></div></div><div class="corner corner10TR"><div class="shape01 dot"></div><div class="shape02 dot"></div><div class="shape03 dot"></div><div class="dot01 dot"></div><div class="dot02 dot"></div><div class="dot03 dot"></div><div class="dot04 dot"></div><div class="dot05 dot"></div><div class="dot06 dot"></div><div class="dot07 dot"></div><div class="dot08 dot"></div><div class="dot09 dot"></div><div class="dot10 dot"></div><div class="dot11 dot"></div><div class="dot12 dot"></div><div class="dot13 dot"></div><div class="dot14 dot"></div><div class="dot15 dot"></div></div><div class="corner corner10BR"><div class="shape01 dot"></div><div class="shape02 dot"></div><div class="shape03 dot"></div><div class="dot01 dot"></div><div class="dot02 dot"></div><div class="dot03 dot"></div><div class="dot04 dot"></div><div class="dot05 dot"></div><div class="dot06 dot"></div><div class="dot07 dot"></div><div class="dot08 dot"></div><div class="dot09 dot"></div><div class="dot10 dot"></div><div class="dot11 dot"></div><div class="dot12 dot"></div><div class="dot13 dot"></div><div class="dot14 dot"></div><div class="dot15 dot"></div></div><div class="corner corner10BL"><div class="shape01 dot"></div><div class="shape02 dot"></div><div class="shape03 dot"></div><div class="dot01 dot"></div><div class="dot02 dot"></div><div class="dot03 dot"></div><div class="dot04 dot"></div><div class="dot05 dot"></div><div class="dot06 dot"></div><div class="dot07 dot"></div><div class="dot08 dot"></div><div class="dot09 dot"></div><div class="dot10 dot"></div><div class="dot11 dot"></div><div class="dot12 dot"></div><div class="dot13 dot"></div><div class="dot14 dot"></div><div class="dot15 dot"></div></div>');
}

// wraps a link around a whole box
function boxLink() {        
	var thisBox = $('.single');
	for (var i = 0, j = thisBox.length; i < j; i++){
		var linkTitle = null;
		var linkHref = null;
		var linkStruct = $('.single h3 > a');

		if (linkStruct.length > 0)
		{
			linkTitle = $(linkStruct[0]).text();
			linkHref = $(linkStruct[0]).attr('href');
			$(linkStruct[0]).remove;
		}
		else
		{
			// Default to previous method
			linkTitle = $(thisBox[i]).children('h3').children('a').text();
			linkHref = $(thisBox[i]).children('h3').children('a').attr('href');			
			$(thisBox[i]).children('h3').children('a').remove;
		}
		// 20090416 - RK: linking to "linkHref" in the .click() function will ALWAYS give the last link as result
		//                therefor every box will link to the same URL. By removing the A from the H3, the layout
		//				  of the box is correctly CSS-ed when being hovered. By appending the A to the DIV (without
		//				  text) makes it accessible in the .click() function and point to the correct location.
		$(thisBox[i]).append("<a href='" + linkHref + "' />");

		$(thisBox[i]).children('h3').text(linkTitle);
		$(thisBox[i]).addClass("boxLink");
	};

	$(".single").click(
	function()	
	{			
		window.location = $(this).children('a').attr('href');return false;		
	});
	
	$(".single").hover(
	function(){					
		$(this).addClass('singleHover');
	},
	function(){				
		$(this).removeClass('singleHover');
	});
}


// wraps quotes around blockquotes
function blockQuote() {	
  $("blockquote").prepend('<p class="quote"><span>&ldquo;</span></p>');
	$("blockquote").append('<p class="quote"><span>&rdquo;</span></p>');
	if ($("blockquote cite").length > 0) {
	  $("blockquote cite").before('<p class="quote"><span>&rdquo;</span></p>');
	  $("blockquote cite + p").remove();
	}	
}

// wraps quotes around blockquotes
function serviceLinks() {	
  $("#serviceLink").click(function(){
	  $("#serviceLinksBox").slideToggle("slow");
	  $(this).toggleClass("active");
	});
  $(".slClose").click(function(){
	  $("#serviceLinksBox").slideToggle("slow");
	  $(this).toggleClass("active");
	});
}

// print alt text instead of logo for text only print version
function textLogo() {	
  var altText = $("#header img").attr("alt");
	$("#header img").parent().parent().prepend('<div class="col fakeTitle" id="pageTitle">' + altText + '</div>');
}


// resize font size, cookie based
function setCurrFsize(id){
	var cookie = readCookie("fontSize");
	var currentSize = cookie ? cookie : 100;
	fsize(currentSize,id);
}
function fsize(newSize,id){
	var vfontsize = document.getElementById(id);
	if(vfontsize){	vfontsize.style.fontSize = newSize + "%";}
	createCookie("fontSize", newSize, 0);
}
var cookie = readCookie("fontSize");
var textsize = cookie ? cookie : 100;
function changetextsize(up){
  if(up){
   textsize = parseFloat(textsize)+15;
  }else{
   textsize =parseFloat(textsize)-15;
  }
}

// cookie handling
function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else var expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

// bookmark
function bookmark(title, url) {
if (window.sidebar) // FF
    window.sidebar.addPanel(title, url, '');
else if(window.opera && window.print) { // Opera
	alert('Please press <Ctrl+D> to bookmark this page (<Ctrl+T> in older Opera versions).');
}
else if(document.all) {// MSIE
    window.external.AddFavorite(url ,title);
}
else if(navigator.appName=='Netscape') { //NS and Chrome
	alert('Please press <Ctrl+D> to bookmark this page.');
}
else
	alert('Bookmarks cannot be set in your browser automatically. Please use the browser menu to manually bookmark this page.');
}


// show hide content with checkbox
function showHideBox (it, box) {
	var vis = (box.checked) ? "block" : "none";
	document.getElementById(it).style.display = vis;
}
// show hide content with link
function showHideLink (id) {
	var vis = (document.getElementById(id).style.display) == "none" ? "block" : "none";
	document.getElementById(id).style.display = vis;
}

// popups
function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,borderless) {
	w = screen.availWidth;
	h = screen.availHeight;
	topPos = (h-popHeight)/2;
	leftPos = (w-popWidth)/2;
	features += ',width='+popWidth + ',height='+popHeight +',top='+topPos + ',left='+leftPos;
	window.open(theURL, winName, features)
	document.MM_returnValue = false;
}


/***********************************************
* Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip2.htm for full source code
***********************************************/

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="/images/layout/tooltiparrow.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip
/***********************************************/


//this function adds a key-value pair to the querystring. If the key exists in the querystring, it will be 
//removed and replaced by the new key-value pair. If the key is empty, the value will always be added to the
//querystring.
// GJM 20100319: changed to include port when provided (hostname := host)
function jump(key, value)
{
    var searchString = location.search;
    
    if (key.length > 0)
    {
        myRegExp = new RegExp("&*" + key + "=\\w+","gi");
        searchString = searchString.replace(myRegExp, "");
        
        if (searchString.length > 0)
        {
            if (searchString == '?')
            {
                searchString += key + '=' + value;
            }
            else
            {
                searchString += '&' + key + '=' + value;
            }
        }
        else
        {
            searchString += '?' + key + '=' + value;
        }
    }
    else
    {
        searchString += value;
    }
    
    window.location.href = location.protocol + '//' + location.host + location.pathname + searchString;	
    
    return false;
}

