DayName = new Array(7)
DayName[0] = "Niedziela"
DayName[1] = "Poniedziałek"
DayName[2] = "Wtorek"
DayName[3] = "Środa"
DayName[4] = "Czwartek"
DayName[5] = "Piątek"
DayName[6] = "Sobota"
MonthName = new Array(12)
MonthName[0] = "stycznia"
MonthName[1] = "lutego"
MonthName[2] = "marca"
MonthName[3] = "kwietnia"
MonthName[4] = "maja"
MonthName[5] = "czerwca"
MonthName[6] = "lipca"
MonthName[7] = "sierpnia"
MonthName[8] = "września"
MonthName[9] = "pażdziernika"
MonthName[10] = "listopada"
MonthName[11] = "grudnia"

function msg() {
document.mailer.action = "mailto:" 
mailtoandsubject = (document.mailer.mailtoperson.value + '?subject=czat'); 
} 

function getDateStr(){
var Today = new Date()
var WeekDay = Today.getDay()
var Month = Today.getMonth()
var Day = Today.getDate()
var Year = Today.getYear()
if(Year <= 1900) Year = Year +1900
return DayName[WeekDay] + ", " + Day + " " + MonthName[Month] + " " + Year + "r."
}

function getDateStr2(Day,Month,Godz){
	return Day + "&nbsp;" + MonthName[Month] + ",&nbsp;" + Godz
}



function JustSoPicWindow(imageName,imageWidth,imageHeight,alt,bgcolor,hugger,hugMargin) {
// by E Michael Brandt of ValleyWebDesigns.com - Please leave these comments intact.
// version 3.0.4  

	if (bgcolor=="") {
		bgcolor="#FFFFFF";
	}
	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	if (imageWidth>w){	
	  byFactor = w / imageWidth;			
	  imageWidth = w;
	  imageHeight = imageHeight * byFactor;
	}
	if (imageHeight>h-adj){
	  byFactor = h / imageHeight;
	  imageWidth = (imageWidth * byFactor);
	  imageHeight = h; 
	}
	   
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (imageHeight>scrHeight){
  	  imageHeight=imageHeight*lift;
	  imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
	  if (hugMargin == ""){
	    hugMargin = 0;
	  }
	  var scrHeightTemp = imageHeight - 0 + 2*hugMargin;
	  if (scrHeightTemp < scrHeight) {
		scrHeight = scrHeightTemp;
	  } 
	  var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
	  if (scrWidthTemp < scrWidth) {
		scrWidth = scrWidthTemp;
	  }
	  
	  if (scrHeight<100){scrHeight=100;}
	  if (scrWidth<100){scrWidth=100;}

	  posTop =  ((h-(scrHeight/lift)-adj)/2);
	  posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}
	posTop = parseInt(posTop);
	posLeft = parseInt(posLeft);		
	scrWidth = parseInt(scrWidth); 
	scrHeight = parseInt(scrHeight);
	
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1){
	  var args= new Array();
	  args[0]='parent';
	  args[1]=imageName;
	  var i ; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {
	newWindow = window.open("vwd_justso.htm","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onBlur="self.close()" onClick="self.close()">');  
	newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
	newWindow.document.write('<img src="'+imageName+'" width='+imageWidth+' height='+imageHeight+' alt="Click screen to close" >'); 
	newWindow.document.write('</td></tr></table></body></html>');
	newWindow.document.close();
	newWindow.focus();
	}
}


function openWin(url){
	AddWin=window.open(url,'Logowanie','width=200,height=160');
}

function MM_openBrWindow(theURL,winName,features) 
{
	window.open(theURL,winName,features);
}

function printWin(url)
{
	AddWin=window.open(url,'Logowanie','width=660,height=480,scrollbars=yes');
}

function checkBrowser() 
{
	ver=navigator.appVersion;
	ie55=(ver.indexOf("MSIE 5.5")>-1)?true:false;
	ie6=(ver.indexOf("MSIE 6")>-1)?true:false;
	ie=(ie55 || ie6)
	if(!ie) 
	{
		//alert('Aby korzystac z systemu wymagana jest przegladarka Internet Explorer w wersji 5.5 lub wyzszej.\nNajnowsza wersje mozna pobrac bezplatnie ze strony Microsoft.');
		return false;
	}
	else return true;
}

function opw()
{
	window.open('/Portals/regulamin.html','ok','width=400,height=260')
}

function bookmarkit()
{
	window.external.addFavorite('http://www.dlazdrowia.pl','Dla zdrowia')
}

function checkEmail(theinput)
{
	s=theinput.value
	if(s.search)
	{
		return (s.search(new RegExp("^([-!#$%&'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+\\.)+[a-zA-Z]{2,4}$","gi"))>=0)
	}
	if(s.indexOf)
	{
		at_character=s.indexOf('@')
		if(at_character<=0 || at_character+4>s.length)
			return false
	}
	if(s.length<6)
		return false
	else
		return true
}
function checkForm(theform)
{
	if(checkEmail(theform['email'])==false)
	{
		alert('Niepoprawny adres email')
		theform['email'].focus()
		form_submitted=false
		return false
	}
	else return true;
} 

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function P7_Snap() { //v2.62 by PVII
  var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a);
  for (k=0; k<(args.length-3); k+=4)
   if ((g=MM_findObj(args[k]))!=null) {
    el=eval(MM_findObj(args[k+1]));
    a=parseInt(args[k+2]);b=parseInt(args[k+3]);
    x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']";
    if(document.getElementById) {
     d="document.getElementsByName('"+args[k]+"')[0]";
     if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}}
    }else if(document.all) {d=da;} 
    if (document.all || document.getElementById) {
     while (tx==1) {p+=".offsetParent";
      if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
      }else{tx=0;}}
     ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy;
     if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) {
      ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);
      }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;
      a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
      x=document.body.scrollLeft + event.clientX + bx;
      y=document.body.scrollTop + event.clientY;}}
   }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd="";
    for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name;
     if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}}
   if(el) {e=(document.layers)?el:el.style;
   var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
   if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";}
   if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
    xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);
    xx+="px";yy+="px";}e.left=xx;e.top=yy;}}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function chowaj () {
MM_showHideLayers(
'typ6','','hide',
'typ9','','hide',
'typ4','','hide',
'typ5','','hide',
'typ13','','hide',
'typ21','','hide',
'typ22','','hide',
'typ25','','hide',
'chowaczka','','hide',
'chowaczka2','','hide');
}

function pokaz (layname, zm1, zm2, zm3, zm4) {
chowaj();
P7_Snap(zm1, zm2, zm3, zm4);
P7_Snap(layname,'chowaczka',0,-40)
P7_Snap(layname,'chowaczka2',-420,-40)
MM_showHideLayers('chowaczka','','show');
MM_showHideLayers('chowaczka2','','show');
MM_showHideLayers(layname,'','show');
}


function showpic(idpic) {
	popkom  = '';
	popkom += '<img id="myobr" onload="window.resizeTo(this.width+25, this.height+50)" src=\"aranzacje/'+idpic+'.jpg\" xwidth=\"260\" xheight=\"160\" alt=\"\" border=\"0\">';
	popkom += '<br>';
	config  = 'toolbar=0,location=0,directories=0,status=0,menubar=0,width=500,height=500,left=10,top=10';
	config += 'scrollbars=0,resizable=0';
	pop = window.open ("","pop",config);
	pop.document.write('<html><head><title>'+idpic+'</title>');
	pop.document.write('<scr'+'ipt> ;');
	pop.document.write('</scr'+'ipt>');
	pop.document.write('</head>');
	pop.document.write('<body bgcolor=\"#003366\" onload=\"window.focus()\" style=\"margin-top:0px;margin-left:0px;\">');
	pop.document.write('<div align=\"center\">'+popkom);
	pop.document.write('<a href=\"javascript:window.close()\" style=\"color:#cccccc;font-family:Verdana;font-size:10px;\">[x] Zamknij okno</a></div>');
	pop.document.write('</body></html>');
	pop.document.close();
}

function poppic(idpic) {
	popkom  = '';
	popkom += '<img id="myobr" onload="window.resizeTo(this.width+25, this.height+50)" src=\"img/'+idpic+'\" xwidth=\"260\" xheight=\"160\" alt=\"\" border=\"0\">';
	popkom += '<br>';
	config  = 'toolbar=0,location=0,directories=0,status=0,menubar=0,width=500,height=500,left=10,top=10';
	config += 'scrollbars=0,resizable=0';
	pop = window.open ("","pop",config);
	pop.document.write('<html><head><title>'+idpic+'</title>');
	pop.document.write('<scr'+'ipt> ;');
	pop.document.write('</scr'+'ipt>');
	pop.document.write('</head>');
	pop.document.write('<body bgcolor=\"#003366\" onload=\"window.focus()\" style=\"margin-top:0px;margin-left:0px;\">');
	pop.document.write('<div align=\"center\">'+popkom);
	pop.document.write('<a href=\"javascript:window.close()\" style=\"color:#cccccc;font-family:Verdana;font-size:10px;\">[x] Zamknij okno</a></div>');

	pop.document.write('</body></html>');
	pop.document.close();
}