
function changeBox(checkbox_id) // funkce zmeni zaskrtnuti checkboxu s danym ID
{
  checkbox = document.getElementById(checkbox_id);
  checkbox.checked = !checkbox.checked;
}

function changeDisplay(id) // funkce zobrazi/skryje box s danym ID --- POZOR nefunguje dobre, 
{
  object = document.getElementById(id).style;
  object.display = (box.display == 'block') ? 'none' : 'block';
}

function changeDisplayByClass(id) 
{
  object = document.getElementById(id);
  object.className = (object.className == 'able') ? 'disable' : 'able';
} 

function testEmail() {
  if ((formular.email.value != '') && (formular.email.value != '@')) {

    if (window.RegExp) {

      re = new RegExp('^[^-\.].+@.+\.[a-zA-Z]+$');

      if (!re.test(formular.email.value)) {

        alert('Zadaná elektronická adresa je neplatná!');

        formular.email.focus();

        return false;

      }
    }
  }
}

function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="white" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onmousedown="self.close()" onBlur="self.close()">'); 
	if (imageType == "swf"){
	newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
	newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('</embed></object>');	}else{
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">'); 	}
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}


function showPicture(pictureName) {
  var centerWidth=(screen.width/2)-(500/2);
  var centerHeight=(screen.height/2)-(540/2);
  
  window.open('/hockeyzone/images/original/'+pictureName,'MaxImage', 'location=no,status=no,height=540,width=500,top='+centerHeight+',left='+centerWidth)
}

function otevriOkno(url, jmeno, w, h) {  
  popupWin = window.open(url, jmeno, 'resizable=1,top=20,left=20,menubar=0,scrollbars=yes,width=' + w + ',height=' + h);
}

function otevriokno2($obrazek){
	var obj=window.open('obraz.php?id='+$obrazek,"","scrollbars=no,menubars=no");
}

function setWindow() {
    imgx = document.img.width;
    imgy = document.img.height;
    if(document.img.width > 984)  { imgx = 1024; } else { imgx += 40; }
    if(document.img.height > 723) { imgy = 768; }  else { imgy += 55; }
    window.resizeTo(imgx, imgy)
}

