// JavaScript Document
var ccc = 0;

var haslo_t = "password...";
// Example 2
function changeInputType(oldElm,iType,iValue,noFocus) {
  if(!oldElm || !oldElm.parentNode || (iType.length<4) || 
    !document.getElementById || !document.createElement) return;
  var newElm = document.createElement('input');
  newElm.type = iType;
  newElm.style.borderStyle = 'solid';
  newElm.style.width = '112px';
  newElm.style.height = '18px';
  newElm.style.marginLeft = '2px';
  newElm.style.fontFamily = 'Tahoma';
  newElm.style.fontSize = '10px';
  newElm.style.color = '#afafaf';
  newElm.style.borderWidth = '1px';
  newElm.style.padding = '2px';
  newElm.style.borderColor = '#e4e2e3';
  if(oldElm.name) newElm.name = oldElm.name;
  if(oldElm.id) newElm.id = oldElm.id;
  newElm.onfocus = function() {
    if(this.hasFocus) return;
    var newElm = changeInputType(this,'password',
      (this.value.toLowerCase()==haslo_t.toLowerCase())?'':this.value);
    if(newElm) newElm.hasFocus=true;
  }
  newElm.onblur = function() {
    if(this.hasFocus)
    if(this.value=='' || this.value.toLowerCase()==haslo_t.toLowerCase()) {
      changeInputType(this,'text',haslo_t,true);
    }
  }
 // hasFocus is to prevent a loop where onfocus is triggered over and over again
  newElm.hasFocus=false;
  oldElm.parentNode.replaceChild(newElm,oldElm);
  if(iValue) newElm.value = iValue;
  if(!noFocus || typeof(noFocus)=='undefined') {
    window.tempElm = newElm;
    setTimeout("tempElm.hasFocus=true;tempElm.focus();",1);
  }
  return newElm;
}
passInit = function() {
  // Example 1
  var allowInputTypeChange = true;
  var fld1 = document.logowanie.pass;
  if(document.getElementById) {
    try { // to keep IE from showing errors.
      fld1.type = 'text';
      if(fld1.type == 'text') fld1.value = haslo_t;
      else allowInputTypeChange = false;
    } catch(e) { allowInputTypeChange = false; }
  }
  if(allowInputTypeChange) {
    fld1.onfocus = function() {
      var tempVal = this.value; // NS6 fix.
      var iType = this.type; // Opera 7 fix.
      if(this.type != 'password') this.type = 'password';
      this.value = tempVal; // NS6 fix.
      if(this.value.toLowerCase()==haslo_t.toLowerCase())
        this.value = '';
      if(window.opera && iType != 'password') this.focus();
    }
    fld1.onblur = function() {
      if(this.type == 'password')
      if(this.value=='' || this.value.toLowerCase()==haslo_t.toLowerCase()) {
        this.type = 'text';
        this.value = haslo_t;
      }
    }
  }

  var ua = navigator.userAgent.toLowerCase();
  if(!((ua.indexOf('konqueror')!=-1) && (document.all || 
    (ua.indexOf('khtml/3.4')!=-1))) && !(((ua.indexOf('safari')!=-1) && 
    !window.print) || (document.defaultCharset && !window.print)))
      changeInputType(document.logowanie.pass,'text',haslo_t,true);
}

// -->


function checkBrowser(){
	var bro = false;
	if(navigator.userAgent.indexOf("Opera")!=-1){
		var versionindex=navigator.userAgent.indexOf("Opera")+6
				bro = true;
	}
	var ff = navigator.userAgent.indexOf("Firefox") != -1;
	if(document.layers || (!document.all && document.getElementById && !ff)){
		bro = true;
	}
	if(bro){
		alert('-- Carlson Capital Partners --\n\nTwoja przegladarka to: \n'+navigator.userAgent+'\nPreferowane przegladarki:\nMicrosoft Internet Explorer\nMozilla FireFox\n\nTresc na stronie moze byc wyswietlana w sposob nieprawidlowy'); 	
	}
	
}
checkBrowser();

function setHomeCol(tabela, col){
	tabela.bgColor = col;
}

function correctDIV(){
	if (navigator.appName.indexOf("Microsoft") != -1){
		document.getElementById('dzial').style.marginLeft = -486+'px';	
	}else{
		document.getElementById('dzial').style.marginLeft = 10+'px';
	}
}
