function submitSimpleSearchForm(){
    document.searchForm.searchRefineAttribute.value='reset';
    return;
  }

function hideUserShell(){
  try {
    Dwt.setVisibility(document.getElementById("userShell"),false);
  } catch (ex){
    return;
  }
}
function showUserShell(){
  try {
    Dwt.setVisibility(document.getElementById("userShell"),true);
  } catch (ex){
    return;
  }
}

function esiGeneratePageInvalidationUrl(){
   var theUrl = window.location.href;

   var invEsiMarker = "esi=invalidateNow";

   var posInv = theUrl.indexOf(invEsiMarker);
   //add invalidation marker
   if (posInv == -1) {
       var posParam = theUrl.indexOf("?");
       if (posParam == -1) {
          theUrl += "?"+invEsiMarker;
       } else {
          theUrl += "&"+invEsiMarker;
       }
       document.write("Invalidating cache for this page...");
       document.close();
  }
  else {
       document.write("The current URL["+theUrl+"] already contains ["+invEsiMarker+"] when it shouldn't");
       document.close();
  }
 window.location.href = theUrl;
}

function esiForwardToOrginalUrl(){
     var theUrl = window.location.href;

     var invEsiMarker = new String("esi=invalidateNow");
     var posInv = theUrl.indexOf(invEsiMarker);

     //remove invalidation marker
    if (posInv != -1) {
        document.write(theUrl);
        theUrl = theUrl.replace(/\?esi=invalidateNow/gi,"");
        theUrl = theUrl.replace(/&esi=invalidateNow/gi,"");
        theUrl = theUrl.replace(/esi=invalidateNow/gi,"");
        window.location.href = theUrl;
    }
}

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);
    }
    //alert('A cookie was not set. '+name+'. Please ensure that your browser accepts cookies.');
    return "Username";
}

/**
 * Nastavi sirku layoutu automaticky podle sirky okna 
 * @param template pouzity styl stranek (odpovida CSSku)
 **/
function setWidth(fullpath, template)
{
	var myWidth = 2000;	// defaultni je siroky design
	if( typeof( window.innerWidth ) == 'number' ) {
	  //Non-IE
	  myWidth = window.innerWidth;
	}
	else if (screen.width) {
		// IE pouze podle sirky obrazovky
		myWidth = screen.width;
		
		// maximalizuj okno, aby sirka okna byla rovna sirce obrazovky
		window.moveTo(0,0);
		window.resizeTo(screen.width, screen.height);
	}
	 
	// FF na rozliseni 1024
	if (myWidth < 1010)
	{
		document.writeln('<link rel="stylesheet" type="text/css" href="' + fullpath + '/css/global_thin.css" media="screen" />');
		document.writeln('<link rel="stylesheet" type="text/css" href="' + fullpath + '/css/' + template + '_thin.css" media="screen" />');
		vlnky = 'novabela_left_banner_760';
		vlnky_sirka = 760;
	}
	else
	{
		vlnky = 'novabela_left_banner_980';
		vlnky_sirka = 980;
	}
}

function xnokno(f,s,v) {
	pozicel = 0;
	if (screen) {
		pozicel = screen.width-s+25;
	}
	
	fokno = window.open(f,'fok','address=no, status=no, toolbar=no, menubar=no, resizable=yes');
	fokno.focus();
}

function zokno() {
	if (fokno && !fokno.closed) {
		fokno.close();
	}
}