function IncludeJavaScript(jsFile)
{
  document.write('<script type="text/javascript" src="'
    + jsFile + '"></script>'); 
}
IncludeJavaScript('lang.js');

function searchhyp(str)
{
      if(str){
          var n=new Date();
          window.open('http://www.zlacnene.sk/zbozi/hledej/' + str + '/', 'search'+n.getTime(),'scrollbars=yes,status=yes,toolbar=yes,menubar=yes,location=yes,width=1016,height=600');
          }
      else {
          window.alert(TXT_MUST_ENTER_SQUERY);
          }
}

function searchesh(str)
{
      if(str){
          var n=new Date();
          window.open('http://www.monitor-cien.sk/najdene-ponuky.html?qw=' + str + '&c=offer_subject', 'search2'+n.getTime(),'scrollbars=yes,status=yes,toolbar=yes,menubar=yes,location=yes,width=1016,height=600');
          }
      else {
          window.alert(TXT_MUST_ENTER_SQUERY);
          }
}

function checkstep4(){
      
      if(document.step4.jmeno.value == '' ||  document.step4.email.value == '' || document.step4.heslo.value == '' || document.step4.heslo2.value == ''){
           window.alert(TXT_MUST_ENTER_ALL);
           }
      else {
          if(document.step4.heslo.value == document.step4.heslo2.value){
          document.step4.submit();
          }
          else
          {
           window.alert(TXT_DIFFERENT_PASSES);
          }
          }

}

function checkstep5(){
      if(document.step5form.kontrola.value == 'a' &&  document.step5form.licence.checked){
               document.step5form.submit();
           }
      else {
               window.alert(TXT_MUSTS_STEP5);
          }

}

function checkstep0(){
      if(document.step0form.zprava.value != ''){
               document.step0form.submit();
           }
      else {
               window.alert(TXT_MUSTS_STEP0);
          }

}

function potvrdakci(action, goto){
   //action {1-mazání dárku, 2-rezervace, 3-zrušení rezervace, 4-mazání kontaktu}
   switch(action)
   {
   case 1:
     var answer = confirm (TXT_REALLY_DELETE);
     break;    
   case 2:
     var answer = confirm (TXT_REALLY_RESERVE);
     break;
   case 3:
     var answer = confirm (TXT_REALLY_UNRESERVE);
     break;
   case 4:
     var answer = confirm (TXT_REALLY_DELETE_CONTACT);
     break;
   default:
     var answer = confirm (TXT_REALLY_DO);
     break;
   }
   
   if (answer){
       window.location.href=goto;
       }
}

function checklogin(){
      if(document.login.username.value != '' && document.login.password.value != ''){
               document.login.submit();
           }
      else {
               window.alert(TXT_MUSTS_ENTER_PASS_USERNAME);
               window.location.href="./";
          }

}

function isemail(policko){
var re5digit=/^(.*)@(.*)\.(.*)$/ //regular expression defining a 5 digit number
if (policko.search(re5digit)==-1) //if match failed
   return 0;
else
   return 1;
}
