/*
	Imprezja - JavaScripts
	Grzegorz Kaliciak, grzegorz@kaliciak.net / etrust.pl
	v1.0.0, 12.08.2007
*/

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function inputLabelFromLabel(input_id,label_id) {
	if (!document.getElementById) return false;
	if (!document.getElementById(input_id)) return false;
	if (!document.getElementById(label_id)) return false;
	var textInput = document.getElementById(input_id);
	var label = document.getElementById(label_id);
	var text = label.innerHTML;
	textInput.value = text;
	textInput.onfocus = function() {
		if (this.value == text) {
			this.value = '';
		}
	}
	textInput.onblur = function() {
		if (this.value == '') {
			this.value = text;
		}
	}
}


addLoadEvent(function(){
	inputLabelFromLabel("login","login_l");
	inputLabelFromLabel("pass","pass_l");
	inputLabelFromLabel("email_od","email_od_l");
	inputLabelFromLabel("email_do","email_do_l");
	inputLabelFromLabel("search","search_l");
});
