document.write('<style type="text/css">.hide-from-js{display:none}</style>');


// fotogalerie
$(document).ready(function() {
  $("a.fotogalery").fancybox({'overlayOpacity':0.7});
});


function shopGoodsImgDetail(href) {
  return window.open(href,"shopGoodsImgDetail","scrollbars=yes,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 open_win(href, name, w, h) {
  if (w+0==0) { w=450; }
  if (h+0==0) { h=450; }
  return window.open(href, name, 'width='+w+',height='+h+',toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
}


