var isMSIE = (navigator.userAgent.indexOf('MSIE') == -1) ? false : true;

var mainpath = 'http://www.hetman.com.pl/';
var phppath = 'http://www.hetman.com.pl/scr/';
var applname = 'Hetman';

function onm(txt) {
if(!txt || (txt=="")) self.status=applname; else self.status=txt;
return true;
}

function setstart(obj) { obj.style.behavior='url(#default#homepage)'; obj.setHomePage('http://www.hetman.com.pl'); };
function addbm() { window.external.AddFavorite("http://www.hetman.com.pl", "G.I. HETMAN"); };

function testemail(_email) {
if(_email == "") { alert("Prosze podac adres e-mail"); return false; };
var posat = _email.indexOf('@');
var posdot = _email.indexOf('.');
var possp = _email.indexOf(' ');
var lastch = _email.length-1;
if((posat <= 0) || (posat == lastch) || (posdot < 0) || (posdot == lastch) || (possp >= 0)) { alert("Prosze poprawic adres e-mail"); return false; };
return true;
}

function submitezine(f) {
if(!testemail(f.email.value)) return false;
var wnd = window.open('','_redirect','toolbar=0, scrollbars=0, resizable=0, status=0, width=300, height=180');
wnd.name = '_redirect';
wnd.document.writeln("<b>Prosz&#281; czeka&#263;.<br>Wysy&#322;anie w toku...</b>");
return;
}

function send_form(_form) {
	if(!testemail(_form.AdresEmail.value)) return;
	var wnd = window.open('http://www.hetman.com.pl/scr/send_wait.htm','','toolbar=0, scrollbars=0, resizable=0, status=0, width=300, height=180');
	wnd.name = '_redirect';
	_form.source.value = "http://www.hetman.com.pl/scr/send_ok.htm";
	_form.submit();
}

function send_quest(f) {
  if(f.message.value == "") { alert("Brak tresci pytania"); return false; }
  if(f.name.value == "") { alert("Prosze podac imie i/lub nazwisko"); return false; }
  if(!testemail(f.email.value)) return false;
  var wnd = window.open('','_redirect','toolbar=0, scrollbars=0, resizable=0, status=0, width=300, height=180');
  wnd.name = '_redirect';
  wnd.document.writeln("<b>Prosz&#281; czeka&#263;.<br>Wysy&#322;anie w toku...</b>");
  return;
};

function get_date() {
	var LastModDate = new Date(document.lastModified);
	var yy = LastModDate.getYear(); if(yy<80) yy+=2000;
	var mm = LastModDate.getMonth()+1;
	var smm = ""+mm; if(mm < 10) smm = "0"+mm;
	return ''+LastModDate.getDate()+'.'+smm+'.'+yy+'r.';
}

function get_actdate() {
	var actDate = new Date();
	var yy = actDate.getYear(); if(yy<80) yy+=2000;
	var mm = actDate.getMonth()+1;
	var smm = ""+mm; if(mm < 10) smm = "0"+mm;
	return ''+actDate.getDate()+'.'+smm+'.'+yy+'r.';
}

var def_submenu = "_oferta";
var def_issub = 0;

function ratakalk(cost,invest) {
	if(document.location.href.indexOf('/paca12_') >= 0) invest = 1;
	if(document.location.href.indexOf('/kor46_') >= 0) invest = 2;
	if(document.location.href.indexOf('/kaw58_') >= 0) invest = 3;
	var wnd = window.open('http://www.hetman.com.pl/ratakalk/ratakalk.php3?parmInwest='+invest+'&parmWartosc='+cost,'','toolbar=0, scrollbars=1, resizable=1, status=0, width=500, height=420');
	wnd.opener = this;
};

function popwin(capt,comm,fimg,dx,dy) {
var wnd = window.open('','','toolbar=0, scrollbars=0, resizable=0, status=0, width='+(dx+40)+', height='+(dy+100));
wnd.document.writeln('<html><head><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=iso-8859-2"></head><title>'+capt+'</title><body bgcolor=#CCE8FF>');
wnd.document.writeln('<table bgcolor=#F8F8FF border=0 width=100%><tr valign=top><td style="font-family:Arial; font-size:11pt; font-weight:bold;">'+capt+'</td><td align=right style="padding:4px; font-family:Arial; font-size:9pt;"><a href="javascript:close();">zamknij&nbsp;okno</a></td></tr>');
wnd.document.writeln('<tr><td colspan=2 align=center><img src="'+fimg+'" border=1></td></tr>');
wnd.document.writeln('<tr><td colspan=2 align=center style="padding:4px; font-family:Arial; font-size:11pt;">'+comm+'</td></tr>');
wnd.document.writeln('</table></body></html>')
wnd.document.close();
return false;
}

var popwnd = null;

function popfoto(fname) {
	if(popwnd) { popwnd.close(); popwnd = null; }; 
	popwnd = window.open(fname,'','top=10, toolbar=0, scrollbars=0, resizable=0, status=0, width=500, height=400'); 
	return false;
};


