function popup_url(url, size_w, size_h, scroll) {
	new_size_w = Number(size_w);
	new_size_h = Number(size_h)+25;
	popup_left = Math.round((screen.availWidth-new_size_w)/2);
	popup_top = Math.round((screen.availHeight-new_size_h)/2);
	noweOkno=window.open(url,"GrupaBemo","scrollbars="+scroll+",toolbar=no,directories=no,width="+new_size_w+",height="+new_size_h+",menubar=no, top="+popup_top+", left="+popup_left+"");
	noweOkno.document.close();
	noweOkno.focus();
};

function popup_page(page, size_w, size_h, scroll)	{
	new_size_w = Number(size_w);
	new_size_h = Number(size_h)+25;
	popup_left = Math.round((screen.availWidth-new_size_w)/2);
	popup_top = Math.round((screen.availHeight-new_size_h)/2);
	msg=open(""+page+".php","BemoMotorsGaleria","scrollbars="+scroll+",toolbar=no,directories=no,width="+new_size_w+",height="+new_size_h+",menubar=no, top="+popup_top+", left="+popup_left+"");
	msg.document.close();
	msg.focus();
};

function popup_img(url, size_w, size_h, scroll) {
	new_add_w	=	10;
	new_add_h	=	29;
	
	start_size_w = 150;
	start_size_h = 100;
	
	if (size_w!=null && size_h!=null) {
		start_size_w = size_w;
		start_size_h = size_h;
	}
	
	start_popup_left = Math.round((screen.availWidth-start_size_w)/2);
	start_popup_top = Math.round((screen.availHeight-start_size_h)/2);
	
	msg=open("","POPUP","toolbar=no,scrollbars=no,directories=no,menubar=no,status=no,width="+start_size_w+",height="+start_size_h+", top="+start_popup_top+", left="+start_popup_left+"");
	msg.document.close();
	msg.document.write("<HTML><HEAD><TITLE>Bemo Motors</TITLE>\n");
	
	if (size_w==null && size_h==null) {
		msg.document.write("<script language='JavaScript'>\n");
		msg.document.write("function popup_resize(wnd, img) {\n");
		msg.document.write("new_w = Number(img.width)+"+new_add_w+";\n");
		msg.document.write("new_h = Number(img.height)+"+new_add_h+";\n");
		msg.document.write("popup_l = Math.round((screen.availWidth-new_w)/2);\n");
		msg.document.write("popup_t = Math.round((screen.availHeight-new_h)/2);\n");
		msg.document.write("wnd.moveTo(popup_l,popup_t);\n");
		msg.document.write("wnd.resizeTo(new_w,new_h);\n");
		msg.document.write("return;\n");
		msg.document.write("}\n");
		msg.document.write("</script>\n");
	}
	msg.document.write("</HEAD>\n");
	msg.document.write("<BODY BGCOLOR=White style='margin: 0; font-size: 11px; font-family: verdana; vertical-align: center; text-align: center;'>\n");
//	msg.document.write("<br><br><b>Proszę czekać...</b>\n");
	msg.document.write("<br><br><img src='http://www.bemo-motors.pl/uimages/2/sb/logogr_a2.gif' border=0 alt='Proszę czekać'>\n");
	
	msg.document.write("<IMG SRC='"+url+"' ALT='Zamknij Okno' BORDER='0' onclick='window.close()' ");
	if (size_w==null && size_h==null) msg.document.write(" onload='popup_resize(window,this)' ");
	msg.document.write(" style='cursor: hand; position: absolute; top: 0; left: 0;'>\n");
	msg.document.write("</BODY></HTML>\n");
	msg.document.close();
	msg.focus();
};

function popup_img_pld(url, size_w, size_h, scroll) {
	new_size_w = Number(size_w);
	new_size_h = Number(size_h)+25;
	popup_left = Math.round((screen.availWidth-new_size_w)/2);
	popup_top = Math.round((screen.availHeight-new_size_h)/2);
	msg=open("","BemoMotorsObrazek","scrollbars="+scroll+",toolbar=no,directories=no,width="+new_size_w+",height="+new_size_h+",menubar=no, top="+popup_top+", left="+popup_left+"");
	msg.document.close();
	msg.document.write("<HTML><HEAD><TITLE>Bemo Motors</TITLE></HEAD>");
	msg.document.write("<BODY BGCOLOR=White TEXT=#8F82AE TOPMARGIN=0 LEFTMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0>");
	msg.document.write("<CENTER><IMG SRC='"+url+"' ALT='Zamknij Okno' BORDER='0' onclick='window.close()' style='cursor: hand;'><BR><BR>");
	msg.document.write("</BODY></HTML>");
	msg.resizeTo(new_size_w,new_size_h);
	msg.focus();
};

function popup_flash(flashsrc, size_w, size_h, scroll)	{
	new_size_w = Number(size_w);
	new_size_h = Number(size_h);
	popup_left = Math.round((screen.availWidth-new_size_w)/2);
	popup_top = Math.round((screen.availHeight-new_size_h)/2);
	msg=open("","BemoMotors","scrollbars="+scroll+",toolbar=no,directories=no,width="+new_size_w+",height="+new_size_h+",menubar=no, top="+popup_top+", left="+popup_left+"");
	msg.document.close();
	msg.document.write("<HTML><HEAD><TITLE>Bemo Motors</TITLE></HEAD>");
	msg.document.write("<BODY BGCOLOR=White TEXT=#8F82AE TOPMARGIN=0 LEFTMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0>");	
	msg.document.write("<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0 width="+size_w+" height="+size_h+" classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>");
	msg.document.write("<PARAM NAME='Movie' VALUE='"+flashsrc+"'>");
	msg.document.write("<PARAM NAME=\"Src\" VALUE='"+flashsrc+"'>");
	msg.document.write("<EMBED src='"+flashsrc+"' quality=high bgcolor=#000000 width="+size_w+" height="+size_h+" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>");
	msg.document.write("</EMBED>");
	msg.document.write("</OBJECT>");
	msg.document.write("</BODY></HTML>");	
	msg.focus();
};

function popup_print(url, size_w, size_h, scroll) {
	new_size_w = size_w;
	new_size_h = size_h+25;
	popup_left = Math.round((screen.availWidth-new_size_w)/2);
	popup_top = Math.round((screen.availHeight-new_size_h)/2);
	scroll='yes';
	msg=open(url,"BemoMotorsPrint","scrollbars="+scroll+",toolbar=no,directories=no,width="+new_size_w+",height="+new_size_h+",menubar=no, top="+popup_top+", left="+popup_left+"");
	msg.document.close();
	msg.resizeTo(new_size_w,new_size_h);
	msg.focus();
};

function GetCookie(sName)
{
  // cookies are separated by semicolons
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    // a name/value pair (a crumb) is separated by an equal sign
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0]) 
      return unescape(aCrumb[1]);
  }

  // a cookie with the requested name does not exist
  return null;
}

function sc(logo) {
	size_w = 378;
	size_h = 270;
	new_size_w = size_w;
	new_size_h = size_h+25;
	msg=open("","SiteCredits","scrollbars=yes,toolbar=no,directories=no,width="+new_size_w+",height="+new_size_h+",menubar=no");
	msg.document.close();
	msg.document.write("<HTML><HEAD><TITLE>Site Credits</TITLE></HEAD>");
	msg.document.write("<BODY TEXT=#163F17 link=#163F17 TOPMARGIN=0 LEFTMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0>");	
	msg.document.write("<table cellspacing='0' cellpadding='0' border=0 width=350>");
	msg.document.write("<tr><td style='padding: 0px 12px 0px 12px; height: 80px;'>");
	if (logo.length)	msg.document.write("<img src='"+logo+"' hspace=0 vspace=0 border=0>");
	msg.document.write("</td></tr>");
	msg.document.write("<tr><td style='padding: 12px; height: 170px; background-color: #CFEFBE; font-family: verdana; font-size: 11px;'>");
	msg.document.write("<p><b>Project co-ordination</b><br>Gammanet sp. z o.o. | <a href='http://www.gammanet.pl' target='_blank' style='color: #163F17;'>www.gammanet.pl</a></p>");
	msg.document.write("<p><b>Art direction, photo illustration & graphics design</b><br>Tomek Szurkowski | <a href='http://www.tomszurkowski.com' target='_blank' style='color: #163F17;'>www.tomszurkowski.com</a></p>");
	msg.document.write("<p><b>Content Management System</b><br>web kameleon | <a href='http://www.webkameleon.com' target='_blank' style='color: #163F17;'>www.webkameleon.com</a></p>");
	msg.document.write("</td></tr>");
	msg.document.write("</table>");
	msg.resizeTo(new_size_w,new_size_h);
	msg.focus();
}