	/*funkcje1 do znikającego i pojawiającego się napisu z pola text*/
	function clickclear(thisfield, defaulttext) {
		if (thisfield.value == defaulttext) {
			thisfield.value = "";
		}
	}
	function clickrecall(thisfield, defaulttext) {
		if (thisfield.value == "") {
			thisfield.value = defaulttext;
		}
	}
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function initInputLabelFromLabel(input_id,label_id) {
	var text = $(label_id).text(); 
	$(input_id).val(text);
	$(input_id).focus( function() {
		if ($(this).val() == text) {
			$(this).val("");
		}
	} );
	  $(input_id).blur( function() {
		if ($(this).val() == '') {
			$(this).val(text);
		}
	} );
}

function initFakeSelect(id) {
	$(id).mouseover(function() {
		$(this).find("dd").show();
		$(this).find("dt").addClass("hover");
	});
	$(id).mouseout(function() {
		$(this).find("dd").hide();
		$(this).find("dt").removeClass("hover");
	});
	
}

function initBack() {
	$("#back").click(function() {
		history.back();
		return false;
	});
}

function initPrint() {
	$("#print").click(function() {
		window.print();
		return false;
	});
}


function initialize() {
	initInputLabelFromLabel("#search","#search_l");
	initInputLabelFromLabel("#newsletter","#newsletter_l");
	initFakeSelect("#fs1");
	initFakeSelect("#fs2");
	initBack();
	initPrint();
}
addLoadEvent(initialize);

