function check_email(address) {
  if ((address == "")
    || (address.indexOf ('@') == -1)
    || (address.indexOf ('.') == -1))
      return false;
  return true;
}

function validate_form() {
  validity = true;
  if (!check_email(document.formularz.adres_odbiorcy.value))
  	{ validity = false; alert('Prosze wpisać adres odbiorcy!'); }
  else if (!check_email(document.formularz.adres_nadawcy.value))
  	{ validity = false; alert('Prosze wpisać adres nadawcy!'); }
  return validity;
}

function swap(imgName,newImg){
	if ((navigator.appName == 'Netscape' && parseFloat(navigator.appVersion) >= 3) || (parseFloat(navigator.appVersion) >= 4)){
		eval('document.' + imgName + '.src = newImg '); 
	}
}

function goWin(url, winname, width, height) {

        var Win = window.open(url,winname,'width=' + width+ ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=no' );
		Win.focus();
}

function goProductWin(url, winname, width, height) {

        var ProductWin = window.open(url,winname,'width=' + width+ ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=no' );
		ProductWin.focus();
}

function goWinNo(url, winname, width, height) {

        var Win = window.open(url,winname,'width=' + width+ ',height=' + height + ',resizable=no,scrollbars=no,menubar=no' );
		Win.focus();
}

function main_go(sectionLink) {

if (sectionLink == "firma") { location.href='firma.php' }
else if (sectionLink == "kontakt") { location.href="kontakt.php" }
else if (sectionLink == "nowosci") { location.href="produkty.php?show=new" }
else if (sectionLink == "fitoterapia") { location.href="fitoterapia.php" }
else if (sectionLink == "rosliny") { location.href="rosliny.php?show=all" }
else if (sectionLink == "wskazania") { location.href="wskazania.php" }
else if (sectionLink == "produkty") { location.href="produkty.php?show=all" }

}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


