function pageUpdate() {
	var pageForm = document.getElementById('pageSelectForm');
	if (pageForm) {
		pageForm.submit();
	}
}

function gotoGalerie(name) {

	document.getElementById(name).submit();
}

function addLoadEvent(func) { 
  var oldonload = window.onload; 
  if (typeof window.onload != 'function') { 
    window.onload = func; 
  } else { 
    window.onload = function() { 
      if (oldonload) { 
        oldonload(); 
      } 
      func(); 
    } 
  } 
}

function addJSFile(file) { 
	var head = document.getElementsByTagName("head")[0];         
	var newScript = document.createElement('script');
	newScript.type = 'text/javascript';
	newScript.src = file;
	head.appendChild(newScript);
}

function initPlxImages() {
	addJSFile("./plugins/plximages/colorbox/colorbox.js");
	
	jQuery(".fade_in").fadeTo("fast", 0.3);
	jQuery(".fade_in").hover(function(){ jQuery(this).fadeTo("fast", 1.0); }, function(){ jQuery(this).fadeTo("slow", 0.5); });
	
	var pageSelect = document.getElementById('pageSelect');
	if (pageSelect) {
		pageSelect.onchange = pageUpdate;
	}
}

addLoadEvent(initPlxImages);
