/*
To są skrypty 
Zmienione 2003-06-16 21:30:26
*/

var ie=document.all
var ns6=document.getElementById&&!document.all
var DataOffset = 0;

function jumpto(selectedItem) {
 if (selectedItem.selectedIndex != 0) {
  document.location.href = selectedItem[selectedItem.selectedIndex].value;
 }
}
function resizeFormElements() {
 if (document.all) {
  for (formIndex=0; formIndex<document.forms.length; formIndex++) {
   myFormElements = document.forms[formIndex].elements;
   for (elementIndex=0; elementIndex<myFormElements.length; elementIndex++) {
    myElement = myFormElements[elementIndex];
    type = myElement.type;
    if (type=='text' || type=='password') {
     myElement.style.width = eval(myElement.size * 11) + "px";
    }
    else if (type=='textarea'){
     myElement.style.width = eval(myElement.cols * 11) + "px";
    }
   } 
  }
 }
}
function closePopup(inputData) {
 var winName = eval(inputData);
 if (navigator.appName == "Netscape" && winName && winName.closed) {
  eval("delete " + inputData);
  eval(inputData + " = null");
  return;
 }
 if (winName) {
  winName.close();
  return;
 }
}
function polecNas() {
 if (jslock) {
  closePopup('polecNasWindow');
  parameters = "width=400,height=320,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + eval((screen.availWidth-400)/2) + ",top=" + ((screen.availHeight-300)/2);
  top.polecNasWindow = window.open('http://inteligo/polecnas/polecnas.html?' + document.location.href,'polecnas',parameters);
 }
}
function drukuj(page) {
 if (jslock) {
//  closePopup('drukuj');
  parameters = "width=620,height=420,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,left=" + eval((screen.availWidth-620)/2) + ",top=" + ((screen.availHeight-400)/2);
  top.drukujWindow = window.open(page,'drukuj',parameters);
 }
}
function login() {
  openWindow('https://secure.inteligo.com.pl:443/wmc/web');
}
function openWindow(url,windowName,width,height) {
  parameters = "width=" + width + ",height=" + height + "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes";
  window.open(url,windowName,parameters);
}

function openLoginWindow(url,windowName,width,height) {
  parameters = "width=" + width + ",height=" + height + "toolbar=no,location=yes,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes";
  window.open(url,windowName,parameters);
}

function openFixedWindow(url,windowName,width,height) {
  parameters = "width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no";
  window.open(url,windowName,parameters);
}

function kalkulator() {
// if (jslock) {
//  closePopup('kalkulatorWindow');
  parameters = "width=787,height=450,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,left=" + eval((screen.availWidth-787)/2) + ",top=" + ((screen.availHeight-450)/2);
  top.kalkulatorWindow = window.open('/kalkulator/kalkulator.php','kalkulator',parameters);
// }
}
function kalkulator2() {
// if (jslock) {
//  closePopup('kalkulatorWindow');
  parameters = "width=769,height=450,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + eval((screen.availWidth-769)/2) + ",top=" + ((screen.availHeight-450)/2);
  top.kalkulatorWindow = window.open('/kredyt/kalkulator.html','kalkulator2',parameters);
// }
}


function goCity(Strona,Lista)
{
 var i=0;
 var URL;
 while (Lista.options[i].selected != true) {
  i++;
 }
URL = Strona+'#'+ Lista.options[i].value;

if (i==0) 
{
alert ("Proszę wybrać miasto");
URL = "#";
}
//alert (URL);
document.location.href = URL;
}


function multiple(liczba)
{
//alert(liczba);
document.forms['pay'].Amount.value = parseFloat(liczba)*100;
//alert ("Amount " + document.forms['pay'].Amount.value);
}

function PokazDateFull()
{
//date in title by Randall Smith copyright 1999
//Permission given to Dynamicdrive.com to feature it in it's DHTML archive
//Script modified by Dynamicdrive.com to make it cross browser friendly. Visit Dynamicdrive.com for more DHTML scripts
//please visit me on the web at http://members.xoom.com/u4rstunzd/
//and to change the title:where it says Welcome todays date is: just put you own text in if you would like to--
var isnMonth = new
Array("stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia");
var isnDay = new
Array("Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela");

today = new Date () ;
today = DateAdd(today , DataOffset , 0, 0)

Year=today.getYear();
if (Year < 1000)
Year+=1900
var DataDzis=today.getDate();
return ( isnDay [today.getDay() - 1] + " " + DataDzis + " " + isnMonth[today.getMonth()] + " " + Year + " ");
//return ("Welcome. today\'s date is: "+isnDay[today.getDay()]+", "+isnMonth[today.getMonth()]+" "+Date+", "+Year+"");
}

function dzis()
{
//date in title by Randall Smith copyright 1999
//Permission given to Dynamicdrive.com to feature it in it's DHTML archive
//Script modified by Dynamicdrive.com to make it cross browser friendly. Visit Dynamicdrive.com for more DHTML scripts
//please visit me on the web at http://members.xoom.com/u4rstunzd/
//and to change the title:where it says Welcome todays date is: just put you own text in if you would like to--
var isnMonth = new
Array("stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia");
var isnDay = new
Array("Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","NIedziela");
today = new Date () ;
Year=today.getYear();
if (Year < 1000)
Year+=1900
var DataDzis=today.getDate();
return (DataDzis + " " + isnMonth[today.getMonth()] + " " + Year + " ");

//return ("Welcome. today\'s date is: "+isnDay[today.getDay()]+", "+isnMonth[today.getMonth()]+" "+Date+", "+Year+"");
}

function teraz()
{
today = new Date () ;
return today;
}

/*
This script is written by Eric (Webcrawl@usa.net)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

function printit(){  
if (window.print) {
    window.print() ;  
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
}
}

/***********************************************
* Image Thumbnail viewer- Š Dynamic Drive (www.dynamicdrive.com)
* Last updated Sept 26th, 03'. This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function ietruebody(){
return (document.compatMode!="BackCompat")? document.documentElement : document.body
}
function enlarge(which,e, position, imgwidth, imgheight){
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (position=="center"){
pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
horzpos=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2
vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2
if (window.opera && window.innerHeight) //compensate for Opera toolbar
vertpos=pgyoffset+window.innerHeight/2-imgheight/2
vertpos=Math.max(pgyoffset, vertpos)
}
else{
var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY
}
crossobj.style.left=horzpos+"px"
crossobj.style.top=vertpos+"px"
crossobj.innerHTML= "<div align=right id=dragbar> <span onClick='closepreview()'><img src="+which+"></span></div>"
crossobj.style.visibility="visible"
return false
}
else //if NOT IE 4+ or NS 6+, simply display image in full browser window
return true
}

function closepreview(){
crossobj.style.visibility="hidden"
}

function initializedrag(e){
    if (ie&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar"){
    offsetx=ie? event.clientX : e.clientX
    offsety=ie? event.clientY : e.clientY
    tempx=parseInt(crossobj.style.left)
    tempy=parseInt(crossobj.style.top)
    dragapproved=true
    document.onmousemove=drag_drop
    }
}

function DateAdd(startDate, numDays, numMonths, numYears)
{
 var returnDate = new Date(startDate.getTime());
 var yearsToAdd = numYears;
 
 var month = returnDate.getMonth() + numMonths;
 if (month > 11)
 {
  yearsToAdd = Math.floor((month+1)/12);
  month -= 12*yearsToAdd;
  yearsToAdd += numYears;
 }
 returnDate.setMonth(month);
 returnDate.setFullYear(returnDate.getFullYear() + yearsToAdd);
 
 returnDate.setTime(returnDate.getTime()+60000*60*24*numDays);
 
 return returnDate;
}