document.write('<style type="text/css">.hide-from-js{display:none}</style>');
//document.write('<style type="text/css">.userNotify{display:none}</style>');

var info = new Array();
var infoIndex = 0;


//window.onload = function (){showInfo()}

function showInfo()
{
  if (info.length == 0) return '';

  
  div = document.createElement('div');
  div.setAttribute('id', 'infoDiv');
  
  
  for(i in info)
  {
    p = document.createElement('p');
    p.innerHTML = info[i];
    div.appendChild(p);
  }
  
  
  
  document.body.appendChild(div);
  
}




function shopGoodsImgDetail(href) 
{
  return window.open(href,"shopGoodsImgDetail","scrollbars=no,resizable=yes,height=330,width=350,left=10,top=10");  
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function setCookie(cookieName, cookieValue, expires, path, domain, secure) {
  if (!expires) {
  	var dnes = new Date();
  	var expires = new Date(dnes.getTime() + 1000 * 60 * 60 * 24); // za 24 hodin
  }
	document.cookie =
		escape(cookieName) + '=' + escape(cookieValue)
		+ (expires ? '; expires=' + expires.toGMTString() : '')
		+ (path ? '; path=' + path : '; path=/')
		+ (domain ? '; domain=' + domain : '')
		+ (secure ? '; secure' : '');
	//alert(document.cookie)
}
function getCookie(cookieName) {
	var cookieValue = '';
	var posName = document.cookie.indexOf(escape(cookieName) + '=');
	if (posName != -1) {
		var posValue = posName + (escape(cookieName) + '=').length;
		var endPos = document.cookie.indexOf(';', posValue);
		if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));
		else cookieValue = unescape(document.cookie.substring(posValue));
	}
	return (cookieValue);
}



function registrationCheck()
{
  if (!reg_duty_string) return true;
  
  elmToShow='';
  
  error=false;
  
  for(i=0;i<reg_duty_string.length;i++)
  {
    element=document.getElementById(reg_duty_string[i]["id"]);
    if (element===null) continue;
    
    if (element.value=='')
    {
      error=true;
      element.style.background='#eaa8b3';
      
      if (elmToShow=='') elmToShow=element;
    }
    else element.style.background='#fff';
  }

  if (error)
  {
    elmToShow.focus();
    alert('Registraci nebylo možno odeslat, neboť nebyly vyplněny povinné údaje.');
    return false;
  }
  
  else return true;

}  
  
  
function AJAXfunction (func,request)
{
  
  host=location.host;
  url='http://'+host+'/ajax_function.php?function='+func+'&'+request;
  alert(url);

  if (navigator.appName!="Microsoft Internet Explorer") req=new window.XMLHttpRequest();
  else var req=new ActiveXObject("Microsoft.XMLHTTP"); 
  req.open('GET', url, false);
  req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  req.send ('a');
  response=req.responseText;
  
  return response;
  
}



var toogleHiddenElmStatus = new Array();
function toggleHidden (idName)
{
  element = document.getElementById(idName);
  if (!element) return false;
  

  if (toogleHiddenElmStatus[idName]==null) 
  {
    toogleHiddenElmStatus[idName] = 'show';
    element.style.display='block';
  }
  else
  {
    if (toogleHiddenElmStatus[idName] == 'hidden')
    {
      toogleHiddenElmStatus[idName] = 'show';
      element.style.display = 'block';
    }
    else
    {
      toogleHiddenElmStatus[idName] = 'hidden';
      element.style.display = 'none';
    }
    
  }
  
  return false;

}

window.onload = function()
{
  if(document.all && navigator.appVersion.indexOf("MSIE")>-1 && navigator.appVersion.indexOf("Windows")>-1)
  {
    var a = document.getElementsByTagName("label");
    for(var i=0,j=a.length;i<j;i++){
      if(a[i].hasChildNodes && a[i].childNodes.item(0).tagName == "IMG")
      {
        a[i].childNodes.item(0).forid = a[i].htmlFor;
        a[i].childNodes.item(0).onclick = function(){
          var e = document.getElementById(this.forid);
          switch(e.type){
            case "radio": e.checked|=1;break;
            case "checkbox": e.checked=!e.checked;break;
            case "text": case "password": case "textarea": e.focus(); break;
          }
        }
      }
    }
  }
  }

