var check4Enter = "";

function QuickSearchEnter(e)
{
   var KeyID = (window.event) ? event.keyCode : e.keyCode;
   switch(KeyID)
   {
      case 13:
      if (check4Enter == "search"){
        doSearch();
      }
      break;
   }
}


function doSearch(){

     var term = document.getElementById("SearchBoxHeader").value;
         
     
     if (term == '')
     {
     
     }
     else
     {
        window.location.href ='search_quick.aspx?q=' + encodeURIComponent(term);    
     }

}


function popupWindowWHN(baseURL,pixW,pixH, WinName){

	newWin = window.open(baseURL, WinName,"width=" + pixW + ",height=" + pixH + ",resizable=no,toolbar=no,menubar=no,status=no,directories=no,location=no,scrollbars=yes");
	
	newWin.focus();
	
}

function checkForMenu (pageToLoad)
{
	isFrameset = top.frames.length > 0;
	
	if ( !isFrameset )
	{
		window.location.href = pageToLoad;
	}
}

function updateMenuCulture ( setCultureInfo )
{
	//JScript errors
	return;
	
	if (parent)
	{
		if(parent.seknavigation)
		{
			if(parent.seknavigation.document)
			{
				loc = parent.seknavigation.document.location.href;
				if ( loc.indexOf ( setCultureInfo ) < 0 )
				{
					parent.seknavigation.document.location.href = loc.substr ( 0, loc.indexOf ( "?" ) ) + "?setCulture=" + setCultureInfo;
				}
			}
		}
	}
}

function showMap(url, area, stand, lang, fairnumber, loginstatus){

	MapWindow = window.open(url + '?area=' + area + '&event=' + fairnumber + '&stand=' + stand + '&zoom=3&lang=' + lang + '&nstatus=' + loginstatus, 'Map','location=no,menubar=no,toolbar=no,status=no,width=860px,height=750,scrollbars=yes,directories=no,resizable=yes,alwaysRaised'); 
	MapWindow.focus();

}

function openForumWindow ( url )
{
	frm = window.open ( url, "Forum", 'location=yes,menubar=yes,toolbar=yes,status=yes,width=1024px,height=768px,scrollbars=yes,directories=no,resizable=yes,alwaysRaised' );
	frm.focus();
}

/**
*	Turn a html element on or off and return true/false if it's visible after call
**/
function showHideElement ( divid )
{
	var pnl = document.getElementById ( divid );
	if ( pnl != null )
	{
		if ( pnl.style.display == "none" )
		{
			pnl.style.display = "block";
			return true;
		}
		else
		{
			pnl.style.display = "none";
			return false;
		}	
	}
	else
		return false;
}

function TextAreaMaxLength ( field, maxLength )
{
    if (field.value.length > maxLength) 
        field.value = field.value.substring(0, maxLength);

	return field.value.length <= maxLength;
}

function CopyToClipboard(textvalue) {
    if (MSIE4)
        window.clipboardData.setData('Text', textvalue);
    else {
        alert('Copy not possible');
    }
}

/* ------------------------- Selfhtml DHTML Bib ------------------------------ */
/* DHTML-Bibliothek */

var DHTML = false, DOM = false, MSIE4 = false, NS4 = false, OP = false, FF = false, SAFARI = false;

if (document.getElementById) {
  DHTML = true;
  DOM = true;
} else {
  if (document.all) {
    DHTML = true;
    MSIE4 = true;
  } else {
    if (document.layers) {
      DHTML = true;
      NS4 = true;
    }
  }
}
if ( document.all )
	MSIE4 = true;
	
if (window.getComputedStyle)
	FF=true;

if (window.opera)
  OP = true;
  
if ( navigator.userAgent.toLowerCase().indexOf( "safari" ) != -1 )
  SAFARI = true;

function getElement (Mode, Identifier, ElementNumber) {
  var Element, ElementList;
  if (DOM) {
    if (Mode.toLowerCase() == "id") {
      Element = document.getElementById(Identifier);
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    if (Mode.toLowerCase() == "name") {
      ElementList = document.getElementsByName(Identifier);
      Element = ElementList[ElementNumber];
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    if (Mode.toLowerCase() == "tagname") {
      ElementList = document.getElementsByTagName(Identifier);
      Element = ElementList[ElementNumber];
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    return false;
  }
  if (MSIE4) {
    if (Mode.toLowerCase() == "id" || Mode.toLowerCase() == "name") {
      Element = document.all(Identifier);
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    if (Mode.toLowerCase() == "tagname") {
      ElementList = document.all.tags(Identifier);
      Element = ElementList[ElementNumber];
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    return false;
  }
  if (NS4) {
    if (Mode.toLowerCase() == "id" || Mode.toLowerCase() == "name") {
      Element = document[Identifier];
      if (!Element) {
        Element = document.anchors[Identifier];
      }
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    if (Mode.toLowerCase() == "layerindex") {
      Element = document.layers[Identifier];
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    return false;
  }
  return false;
}

function getAttribute (Mode, Identifier, ElementNumber, AttributeName) {
  var Attribute;
  var Element = getElement(Mode, Identifier, ElementNumber);
  if (!Element) {
    return false;
  }
  if (DOM || MSIE4) {
    Attribute = Element.getAttribute(AttributeName);
    return Attribute;
  }
  if (NS4) {
    Attribute = Element[AttributeName]
    if (!Attribute) {
       Attribute = false;
    }
    return Attribute;
  }
  return false;
}

function getAttribute ( Node, AttName )
{
	if ( !Node || !Node.attributes )
		return;
		
	if ( SAFARI )
	{
		for ( var a=0; a < Node.attributes.length; a++ )
		{
			if ( Node.attributes[a].name == AttName )
				return Node.attributes[a].value;
		}
	}
	else
		return Node.attributes[AttName].value;
}

function getContent (Mode, Identifier, ElementNumber) {
  var Content;
  var Element = getElement(Mode, Identifier, ElementNumber);
  if (!Element) {
    return false;
  }
  return getNodeContent ( Element );
}
  
function getNodeContent (Element)
{
  if (DOM && Element.firstChild) {
    if (Element.firstChild.nodeType == 3) {
      Content = Element.firstChild.nodeValue;
    } else {
      Content = "";
    }
    return Content;
  }
  if (MSIE4) {
    Content = Element.innerText;
    return Content;
  }
  return false;
}

function setContent(Mode, Identifier, ElementNumber, Text) {
    var Element = getElement(Mode, Identifier, ElementNumber);

    setNodeContent(Element, Text);
}

function setNodeContent(Element, Text) {
    if (!Element) {
        return false;
    }
    if (DOM && Element.firstChild) {
        Element.firstChild.nodeValue = Text;
        return true;
    }
    if (MSIE4) {
        Element.innerText = Text;
        return true;
    }
    if (NS4) {
        Element.document.open();
        Element.document.write(Text);
        Element.document.close();
        return true;
    }
}


/* ------------------------- Keyword control ------------------------------ */
var selupdateInitializedTables = new Array();
var checkboxStructures = new Array ();
function checkboxStructList ( numbering, selListId, selResultField, btnTopID, btnUpID, btnDownID, btnBottomID, btnRemoveID )
{
	/* --------- PROPERTIES -------- */
	this.byId = new Array();
	this.byName = new Array();
	this.fullList = new Array();
	
	this.numbering = numbering; // How many entries should be numbered
	
	this.lastSearchKey;
	this.selectionList = $get(selListId);
	this.selectionList.checkboxList = this;
	this.selectionResultField = $get(selResultField);

	this.selectedList = new Array();
	for ( var u=0; u < this.selectionList.options.length; u++ )
		if ( this.selectionList.options[u].selected )
			this.selectedList[this.selectionList[u].value] = this.selectionList[u];
	this.itemIdPrefix = null;
	
	this.btnTop = $get(btnTopID);
	this.btnTop.checkboxList = this;
	this.btnUp = $get(btnUpID);
	this.btnUp.checkboxList = this;
	this.btnDown = $get(btnDownID);
	this.btnDown.checkboxList = this;
	this.btnBottom = $get(btnBottomID);
	this.btnBottom.checkboxList = this;
	this.btnRemove = $get(btnRemoveID);
	this.btnRemove.checkboxList = this;
	
	/* --------- METHODS -------- */
	
	this.LoadComplete = function ( )
	{
		this.loadResultfield ( );
	}
	
	this.loadResultfield = function ( )
	{
		var entries = this.selectionResultField.value.split (';');
		for ( var e=0; e < entries.length; e++ )
			if ( entries[e] != "" )
				this.selectElement ( this.itemIdPrefix + entries[e] );
	}
	
	this.add = function ( checkbStrEl )
	{
		if ( checkbStrEl.id )
			this.byId[checkbStrEl.id] = checkbStrEl;

		if ( checkbStrEl.name )
			this.byName[checkbStrEl.name] = checkbStrEl;
		
		this.fullList.push ( checkbStrEl );
		checkbStrEl.checkboxList = this;
		checkbStrEl.checkbox.checkboxList = this;
		this.itemIdPrefix = checkbStrEl.id.substring ( 0, checkbStrEl.id.lastIndexOf ( "_" ) + 1 );
	}
	
	this.selectElement = function ( elementValue )
	{
		checkboxElement = this.byId[elementValue];

		if ( !checkboxElement )
			return;
			
		checkboxElement.checkbox.checked = true;
		if ( !this.selectedList[elementValue] )
		{
			if ( MSIE4 )
				option = new Option ( checkboxElement.name, checkboxElement.value, false, false);
			else
				option = new Option ( checkboxElement.name, checkboxElement.value, false );

			option.title = option.text;
			option.checkboxElement = checkboxElement;
			this.selectionList.options[this.selectionList.options.length] = option;	
		}

		this.updateResultfield ( );
		
	}
	
	this.removeElement = function ( elementValue )
	{
		this.byId[elementValue].checkbox.checked = false;

		pos = this.indexOf ( elementValue );
		if ( pos >= 0 )
			this.selectionList.options[pos] = null;
			
		this.selectedList[elementValue] = null;

		this.updateResultfield ( );
		
	}
	
	this.moveElementUp = function ( elementValue )
	{
		pos = this.indexOf ( elementValue );
		if ( pos > 0 )
			this.moveElementFromIndexToIndex ( pos, --pos );
	}
	
	this.moveElementDown = function ( elementValue )
	{
		pos = this.indexOf ( elementValue );
		if ( pos < this.selectionList.length - 1 )
			this.moveElementFromIndexToIndex ( pos, ++pos );
	}
	
	this.moveElementTop = function ( elementValue )
	{
		pos = this.indexOf ( elementValue );
		if ( pos > 0 )
			this.moveElementFromIndexToIndex ( pos, 0 );
	}
		
	this.moveElementBottom = function ( elementValue )
	{
		pos = this.indexOf ( elementValue );
		if ( pos < this.selectionList.length - 1 )
			this.moveElementFromIndexToIndex ( pos, this.selectionList.length - 1 );
	}
	
	this.moveElementToIndex = function ( elementValue, newPos )
	{
		this.moveElementFromIndexToIndex ( this.indexOf ( elementValue ), newPos );
	}
	
	this.updateResultfield = function ( )
	{
		this.selectionResultField.value = "";
		for ( var opts = 0; opts < this.selectionList.options.length; opts++ )
			this.selectionResultField.value += this.selectionList.options[opts].checkboxElement.resultValue + ";";
			
		for ( var opts = 0; opts < this.selectionList.options.length ; opts++ )
			this.selectionList.options[opts].text =  ( opts < this.numbering ? ( opts + 1 ) + " " : "" ) + this.selectionList.options[opts].checkboxElement.name;
			
		// Sort
		for ( var opts = this.numbering; opts < this.selectionList.options.length; opts++ )
		{
			var pos = opts;
			for ( var uopts = opts + 1; uopts < this.selectionList.options.length; uopts++ )
				if ( this.selectionList.options[uopts].title < this.selectionList.options[pos].title )
					pos = uopts;
					
			if ( pos != opts )
				this.moveElementFromIndexToIndex ( pos, opts );
		}
		
	}
	
	this.moveElementFromIndexToIndex = function ( oldPos, newPos )
	{
		if ( oldPos == newPos )
			return;
		
		tmpOption = this.selectionList.options[oldPos];
		options = new Array ();
		for ( i=0; i < this.selectionList.options.length; i++ )
			options[i] = this.selectionList.options[i];
		
		for ( ; oldPos < newPos; oldPos++ )
			options[oldPos] = options[oldPos + 1];
			
		for ( ; oldPos > newPos; oldPos-- )
			options[oldPos] = options[oldPos - 1];
			
		options[newPos] = tmpOption;
			
		this.selectionList.options.length = 0;
		for ( var i=0; i < options.length; i++ )
			this.selectionList.options[i] = options[i];
			
		this.updateResultfield ( );
	}
	
	this.indexOf = function ( elementValue )
	{
		for ( var i=this.selectionList.options.length-1; i >= 0; i-- )
			if (this.selectionList.options[i].value == elementValue )
				return i;
				
		return -1;
	}
	
	this.getSelectedElementValues = function ( )
	{
		var result = new Array ();
		
		for ( var i=0; i < this.selectionList.options.length; i++ )
			if (this.selectionList.options[i].selected )
				result[result.length] = this.selectionList.options[i];
				
		return result;
	}
	
	/* --------- EVENTS -------- */
	this.selectionList.form.onsubmit=function () { };
	
	this.btnUp.onclick = function () 
	{
		selection = this.checkboxList.getSelectedElementValues ();
		for ( var iu=0; iu < selection.length; iu++ )
			this.checkboxList.moveElementUp ( selection[iu].value );
			
		return false;
	}
	
	this.btnTop.onclick = function () 
	{
		selection = this.checkboxList.getSelectedElementValues ();
		for ( var iu=selection.length - 1; iu >= 0; iu-- )
			this.checkboxList.moveElementTop ( selection[iu].value );
			
		return false;
	}
		
	this.btnBottom.onclick = function () 
	{
		selection = this.checkboxList.getSelectedElementValues ();
		for ( var iu=0; iu < selection.length; iu++ )
			this.checkboxList.moveElementBottom ( selection[iu].value );
			
		return false;
	}
	
	this.btnDown.onclick = function () 
	{
		selection = this.checkboxList.getSelectedElementValues ();
		for ( var is=selection.length - 1; is >= 0 ; is-- )
			this.checkboxList.moveElementDown ( selection[is].value );
			
		return false;
	}	
	
	this.btnRemove.onclick = function () 
	{
		selection = this.checkboxList.getSelectedElementValues ();
		for ( var iu=0; iu < selection.length; iu++ )
			this.checkboxList.removeElement ( selection[iu].value );
			
		return false;
	}	
	
}

function checkboxStructElement ( checkbox ) 
{
	
	// Remember found checkbox
	this.checkbox = checkbox;
	checkbox.checkboxElement = this;
	this.id = checkbox.id;
	this.value = checkbox.id;
	this.resultValue = checkbox.id.substr ( checkbox.id.lastIndexOf ( '_' ) + 1 );
	this.checkboxList = null;
	
	
	// Search surrounding table row
	pNode = checkbox;
	while ( pNode.parentNode != null && pNode.tagName != "TR" )
	{
		if ( pNode.tagName == "TD" )
			this.tableCell = pNode;
			
		pNode = pNode.parentNode;
	}
		
	if ( pNode.tagName != "TR" )
		return;
		
	this.tableRow = pNode;
	
	// Find cleartext
	lbls = this.tableRow.getElementsByTagName ( "LABEL" );
	for ( var i=0; i<lbls.length && !this.name; i++ )
	{
		if ( getAttribute ( lbls[i], "for" ) == this.id )
		{
			this.label = lbls[i];
			this.name = getNodeContent ( lbls[i] );
		}
	}
	
	this.onclick = function ( ) 
	{  
		checkbox = this.checkboxElement;
		
		if ( this.checked )
		{
			checkbox.checkboxList.selectElement ( checkbox.value );
		}
		else
		{
			checkbox.checkboxList.removeElement ( checkbox.value );
		}
	};

	this.checkbox.onclick = this.onclick;
}

function updateKeywordList ( filterID, cbListID, selListID )
{
	var filter = $get(filterID);
	var selList = $get(selListID);
	
	var list = checkboxStructures[cbListID];

	if ( list == null )
	{
		alert ( "Keywordlist " + cbListID + " not present or not initialized" );
		return;
	}
	
	if ( filter.value.toLowerCase() != list.lastSearchKey )
	{
		// Remember last search
		list.lastSearchKey = filter.value.toLowerCase();

		// Remove old table
		var table = $get(cbListID);

		for ( n=table.childNodes.length - 1; n >= 0 ; n-- )
			table.removeChild ( table.childNodes[n] );
			
		colCounter = 0;
		cellCounter = 0;
		curRow = null;
		
		// Add new table
		for ( var n=0; n < list.fullList.length; n++ )
		{
			if ( "" + filter.value == "" || list.fullList[n].name.toLowerCase().indexOf( list.lastSearchKey ) >= 0)
			{			
				if ( colCounter++ % 2 == 0 || curRow == null )
				{
					if ( MSIE4 )
						curRow = table.insertRow();
					else
						curRow = document.createElement ( "TR" );
				}
				if ( MSIE4 )
					nCell = curRow.insertCell();
				else
					nCell = document.createElement ( "TD" );
					
				nCell.appendChild ( list.fullList[n].checkbox );	
				nCell.appendChild ( list.fullList[n].label );
				
				if ( !MSIE4 )
				{
					curRow.appendChild ( nCell );
					table.appendChild ( curRow );
				}
				
				cellCounter++;	
			}
		}	
		if ( cellCounter % 2 != 0 )
			curRow.insertCell ( );
	}
	
}

function initializeKeywordlist ( numbering, filterID, cbListID, selListID, selResultField, btnTopID, btnUpID, btnDownID, btnBottomID, btnRemoveID )
{
	if (typeof(Sys) == 'undefined')
		return;
		
	var cbList = $get(cbListID);

	if ( selupdateInitializedTables[cbListID] == cbList )
		return checkboxStructures[cbListID];

	filter = $get(filterID);
	filter.onkeyup = function ( ) { eval ( "updateKeywordList ( '" + filterID + "', '" + cbListID + "', '" + selListID + "' );"); };
	
	selupdateInitializedTables[cbListID] = cbList;
	cbls = new checkboxStructList ( numbering, selListID, selResultField, btnTopID, btnUpID, btnDownID, btnBottomID, btnRemoveID );
	checkboxStructures[cbListID] = cbls
	
	trs = cbList.getElementsByTagName ( "INPUT" );
	for ( i=0; i < trs.length; i++ )
	{
		if ( trs[i]["type"] == "checkbox" )
		{
			cbls.add ( new checkboxStructElement ( trs[i] ) );
		}
	}
	cbls.LoadComplete();
	return cbls;
}


/* ----------------------------------------- FORM EVENT SCRIPTS -------------------------------------------------- */
function showHideIDs ( show, idList )
{
	var state = "none";
	if ( show )
		state = "block";

	for ( var id = 0; id < idList.length; id++ )
	{
		var md = document.getElementById ( idList[id] );
		if ( md != null )
			md.style.display = state;
		
	}
}

    var OldHelpPopup = null;
    function hideOldHelpPopup(newhelppopup) {
        if (OldHelpPopup != null)
            document.getElementById(OldHelpPopup).style.display = 'none';
        OldHelpPopup = newhelppopup;
    }

function dialogbox(dialogbox_url, width, height) {
     window.profileWin = new Window({
       className: "dialogbox",
       draggable: false,
       resizable: false,
       minimizable: false,
       maximizable: false,
       hideEffect:Element.hide,
       showEffect:Element.show,
       width: width,
       height: height,
       destroyOnClose: true,
       zIndex: 1000,
       url: dialogbox_url
     });
     //contentWin.setContent('downloadbox', true, true);
     window.profileWin.showCenter(true);
}


// Helper methods //

// Register a function on a radiobuttonlist and calls the caller function
//
// @rblClientId      ID of the RadioButtonList
// @callerFunction   A function name or function declaration
// @runatstart      True to start on load
// Callback declaration:
//   callerFunction ( newvalue, selectedinputelement )
function OnRadioButtonListChanged(rblClientId, callerFunction, runatstart) {
    var rbl = $(rblClientId);
    rbl.onclick = function() {
        var curItem = rbl.selectedElement();
        if (lastItem != curItem) {
            lastItem = curItem;
            if (curItem != null)
                callerFunction($F(curItem), curItem);
            else
                callerFunction('', null);
        }
    }

    rbl.selectedElement = function() {
        var es = rbl.getElementsByTagName("input");
        for (i = 0; i < es.length; i++)
            if (es[i].checked)
                return es[i];
    };

    lastItem = rbl.selectedElement();
    if (runatstart)
    {
        if (lastItem != null)
            callerFunction($F(lastItem), lastItem);
        else
            callerFunction('', null);
    }
}


// Register a function on a radiobuttonlist and calls the caller function
//
// @rblClientId      ID of the RadioButtonList
// @callerFunction   A function name or function declaration
// @runatstart      True to start on load
// Callback declaration:
//   callerFunction ( newvalue, dropdowninputelement )
function OnDropdownListChanged(rblClientId, callerFunction, runatstart) {
    var rbl = $(rblClientId);
    rbl.onchange = function() {
        var curItem = rbl.selectedEntry();
        if (lastItem != curItem) {
            lastItem = curItem;
            callerFunction($F(rbl), rbl);
        }
    }

    rbl.selectedEntry = function() {
        return rbl.options[rbl.selectedIndex];
    };

    lastItem = rbl.selectedEntry();
    if (runatstart) {
        if (lastItem != null)
            callerFunction($F(rbl), rbl);
        else
            callerFunction('', rbl);
    }
}

// Register a function on a radiobuttonlist and calls the caller function
//
// @rblClientId      ID of the RadioButtonList
// @callerFunction   A function name or function declaration
// @runatstart      True to start on load
// Callback declaration:
//   callerFunction ( newvalue, dropdowninputelement )
function OnTextboxChanged(rblClientId, callerFunction, runatstart) {
    var rbl = $(rblClientId);

    rbl.checkChange = function() {
        var curText = rbl.enteredText();

        callerFunction(curText, rbl);
        return true;
    };

    rbl.onkeyup = rbl.checkChange;

    rbl.enteredText = function() {
        return $F(rbl);
    };

    lastContent = rbl.enteredText();
    if (runatstart) {
        rbl.checkChange();
    }
}




// Find a parent element by it's tag-name. For example: The table row of a dropdown list.
function getParentByElementName(inputId, elementName ) {
    var ictl = $(inputId);
        
    elementName = elementName.toLowerCase();
    var parent = ictl.parentNode;
    while (parent != null) {
        if (parent.tagName.toLowerCase() == elementName)
            return parent;
        else
            parent = parent.parentNode;
    }

    return null;
}

//Edit Forms show/hide conditional controls / prototype required
function form_fireHideEvent(listenerClass, conditionalValue) {
    var rows = $$('.' + listenerClass);
    rows.each(function (item) {
        if (item.attributes["conditionalValue"].value == conditionalValue)
            item.show();
        else
            item.hide();
    });

}




/*Page Reload helper*/
function GK_PageUrl() {
    this.qs = {};
    var s = location.search.replace(/^\?|#.*$/g, '');
    if (s) {
        var qsParts = s.split('&');
        var i, nv;
        for (i = 0; i < qsParts.length; i++) {
            nv = qsParts[i].split('=');
            this.qs[nv[0]] = nv[1];
        }
    }
}

GK_PageUrl.prototype.add = function (name, value) {
    if (arguments.length == 1 && arguments[0].constructor == Object) {
        this.addMany(arguments[0]);
        return;
    }
    if (value == "") {
        delete this.qs[name];
    }
    else {
        this.qs[name] = value;
    }
}

GK_PageUrl.prototype.addMany = function (newValues) {
    for (nv in newValues) {
        if (newValues[nv] == "") {
            delete this.qs[deleteNames[nv]];
        }
        else {
            this.qs[nv] = newValues[nv];
        }
    }
}

GK_PageUrl.prototype.remove = function (name) {
    if (arguments.length == 1 && arguments[0].constructor == Array) {
        this.removeMany(arguments[0]);
        return;
    }
    delete this.qs[name];
}

GK_PageUrl.prototype.removeMany = function (deleteNames) {
    var i;
    for (i = 0; i < deleteNames.length; i++) {
        delete this.qs[deleteNames[i]];
    }
}

GK_PageUrl.prototype.getQueryString = function () {
    var nv, q = [];
    for (nv in this.qs) {
        q[q.length] = nv + '=' + encodeURIComponent(this.qs[nv]);
    }
    return location.href.split('?')[0]+'?'+q.join('&');
}

GK_PageUrl.prototype.toString = GK_PageUrl.prototype.getQueryString;

/* end Page Reload helper*/
