function zobraz(name, file)
{			
	 wi = 350;
	 he = 370;
	 theURL=file;
	 W = parseInt(wi);
	 H = parseInt(he);
	 okno = window.open(theURL, "navrh" ,"width="+W+",height="+H+",left=0,top=0");
	 okno.resizeTo(W,H);
	 okno.focus();
}	

function rozbal(sekce, cosi, stav, maxim)
{
  var elem, elem2, a, konec;
  for (a = 1; a <= maxim; a++)
  {
    elem = document.getElementById("z" + sekce.toString() + "_" + a.toString());
    elem2 = document.getElementById("n" + sekce.toString() + "_" + a.toString());
    elem.style.display = 'none';		  		  	 
    elem2.style.backgroundColor='#0C3062';
	  elem2.style.color = '#FFFFFF';
  }
  elem = document.getElementById("z" + sekce.toString() + "_" + cosi.toString());
  elem2 = document.getElementById("n" + sekce.toString() + "_" + cosi.toString());
  if (stav == 0)
  {
    elem.style.display = 'none';		  
  }
  else
  {
    elem.style.display = 'block';	
  	elem2.style.backgroundColor = '#989797';
    elem2.style.color = '#FFFFFF';
  }
}

function zobraz2(name, file,wi,he)
{		
	 theURL=file;
	 W = parseInt(wi);
	 H = parseInt(he);
	 okno = window.open(theURL, "navrh" ,"width="+W+",height="+H+",left=0,top=0");
	 okno.resizeTo(W,H);
	 okno.focus();
}		

function openWindow(url, name)
{
  popupWin = window.open(url, name, 'toolbar=0,links=0,menubar=0,scrollbars=1,resizable=1,width=600,height=400');
}

// jquery-ui tabs enable
$(function() {
		//$( "#tabs" ).tabs();
});


$(document).ready(function() {
	$('.graph:first').show();

	$('.commodities table tr th a').click(function() {
		var id = $(this).attr('href');
		if ($(id).not(':visible')) {
			$('.graph:visible').fadeOut('slow');
			$(id).fadeIn('slow');
		}
		
		return false;
	});
});

function check_form(form) {
  if (form.db_domain_name.value.trim() == "") {
    alert("Zadejte jméno domény.");
    form.db_domain_name.focus();
    return false;
  } 

  if (form.db_price.value.trim() == "" || form.db_price.value == 0) {
    alert("Zadejte cenu.");
    form.db_price.focus();
    return false;
  }   
  return true;
}

function check_login_form(form) {
  if (form.login.value.trim() == "") {
    alert("Zadejte login.");
    form.login.focus();
    return false;
  } 

  if (form.password.value.trim() == "") {
    alert("Zadejte heslo.");
    form.password.focus();
    return false;
  }   
  return true;
}

function check_offer_form(form) {
  if (form.db_name.value.trim() == "") {
    alert("Zadejte jméno.");
    form.db_name.focus();
    return false;
  } 

  if (form.db_email.value.trim() == "") {
    alert("Zadejte email.");
    form.db_password.focus();
    return false;
  }   
  if (form.db_offer.value.trim() == "") {
    alert("Zadejte nabídku.");
    form.db_offer.focus();
    return false;
  }   
  return true;
}
