

var d = document;








function getElement(i)
{ 
 var ob = d.all?d.all[i]:d.layers?d.layers[i]:d.getElementById(i); 
 return ob; 
} 








function init()
{ 
} 








function getDateTime()
{
 dt=new Date();
 
 
 return dt.getDate()+''+dt.getMonth()+''+dt.getFullYear()+''+dt.getHours()+''+dt.getMinutes()+''+dt.getSeconds();
}  








function ShowWindow(url)
{
 var czas  = new Date();
 
 width = 650;
 height = 400;
 
 rok   = czas.getYear();
 mies  = ( ( czas.getMonth() < 10 ) ? "0": "" ) + ( czas.getMonth() + 1 );
 dzien = ( ( czas.getDate()  < 10 ) ? "0": "" ) + ( czas.getDate() );
 godz  = ( ( czas.getHours() < 10 ) ? "0": "" ) + ( czas.getHours() );
 min   = ( ( czas.getMinutes() < 10 ) ? "0": "" ) + ( czas.getMinutes() );
 sek   = ( ( czas.getSeconds() < 10 ) ? "0": "" ) + ( czas.getSeconds() );

 aktdata=dzien+"_"+mies+"_"+rok+"_"+godz+"_"+min+"_"+sek;

 maxszer=window.screen.width;
 maxwys=window.screen.height;
 polx=Math.round( (maxszer-width)/2);
 poly=Math.round( (maxwys-height)/2);
 
 window.open(url,aktdata,"toolbar=no,scrollbars=yes,directories=no,top="+poly+",left="+polx+",menubar=no,width="+ width +",height="+ height +",resizable=no, statusbar=no");

}
 








function formSend()
{
 err = 0;
 

 var arr = new Array(5);
 
 arr[0] = 'f_name';
 arr[1] = 'f_subject';
 arr[2] = 'f_message';
 arr[3] = 'f_email';
 arr[4] = 'f_captcha';
 
 
 for (i=0; i<arr.length; i++)
 {
  if (jQuery('#'+arr[i]).val()=='')
    {
     jQuery('#'+arr[i]).css({'background' : '#ffb0b0'});
     err++;
    }
  else jQuery('#'+arr[i]).css({'background' : '#ffffff'});                                                   
 }

 
 
 
 if (!/^[a-z0-9\-_\.]+?@[a-z0-9\-_\.]+?\.[a-z]{2,5}$/.test(jQuery('#f_email').val()))
   {
    jQuery('#f_email').css({'background' : '#ffb0b0'});
    err++;
   }
 else jQuery('#f_email').css({'background' : '#ffffff'});
 

if (err==0)
   {
    $.post(base_url+"da.php", { act: "submit_contact_form", 
                       f_name : jQuery('#f_name').val(),
                       f_subject : jQuery('#f_subject').val(),
                       f_message : jQuery('#f_message').val(),
                       f_email : jQuery('#f_email').val(),
                       f_captcha : jQuery('#f_captcha').val()
                     }, function(data){
      
      jQuery("#contactform").html(data);
    });
   }

 
}








function captchaReload()
{
 getElement('captcha').src = base_url+'captcha.php?'+getDateTime();
}









function searchValid()
{
 err = 0;
 

 var arr = new Array(1);
 
 arr[0] = 'phrase';
 
 
 for (i=0; i<arr.length; i++)
 {
  if (jQuery('#'+arr[i]).val()=='')
    {
     jQuery('#'+arr[i]).css({'background' : '#ffb0b0'});
     err++;
    }
  else jQuery('#'+arr[i]).css({'background' : '#ffffff'});                                                   
 }

 
 
 
 if (err==0)
   {
    document.location.href = dir_search+escape(jQuery('#'+arr[0]).val())+'.html';
   }

 
 return false;
}














