<!--
var preload = ["images/alb_next.png", "images/alb_prev.png", "images/papinfo.gif","images/wait1.gif","images/sakums_dplan.jpg","images/dplans_rss.jpg","images/dplans_ical.jpg"];
var images = [];
var i;
for (i = 0; i < preload.length; i++) {
    images[i] = new Image();
    images[i].src = preload[i];
}

if (ppup==1 && document.createElement) {

var delayhide;

/*
window.onload = function() {                         //dies if loading is not finished  
	var popup = document.createElement('div');
	popup.setAttribute('id','popup');
	if (document.body.firstChild) {
      	document.body.insertBefore(popup, document.body.firstChild);
	}
	else {
      	document.body.appendChild(popup);
	}
  };*/

function quickload() {       //first child
	
	/*var overlay = document.createElement("div"); //one more
	overlay.setAttribute('id','overlay');
	overlay.onclick = function () {hidetrail(); return false;}
      	document.body.appendChild(overlay);*/

	var popup = document.createElement('div');
	popup.setAttribute('id','popup');
      	document.body.appendChild(popup);
}

function showtrail(back){
	cleardelayhide();

	setopacity('popup',50);	
	document.onmousemove=followmouse;

	var popup = document.getElementById("popup");
        var img = document.createElement('img');
        img.setAttribute('src', 'images/'+back);

	if (popup.firstChild) {
	var fc = popup.firstChild;
    	popup.removeChild(fc);
	}

	popup.appendChild(img);
	popup.style.display="inline";
}

function showtrail1(txt1,txt2,txt3){
	cleardelayhide();

	setopacity('popup',70);	
	document.onmousemove=followmouse;

	var popup = document.getElementById("popup");
	var elm = document.createElement('p');
	elm.setAttribute("className","stdpadding");
	elm.setAttribute("class","stdpadding");
	var txtelm = document.createTextNode(txt1+txt2+txt3);
	elm.appendChild(txtelm);

	if (popup.firstChild) {
	var fc = popup.firstChild;
    	popup.removeChild(fc);
	}
	
	popup.appendChild(elm); 	
	popup.style.display="inline";
}

function showtrail3(txt1,txt2,txt3){
	cleardelayhide();

	setopacity('popup',90);	
	document.onmousemove=followmouse;

	var popup = document.getElementById("popup");
	var elm0 = document.createElement('div');
	elm0.setAttribute("className","leftpop");
	elm0.setAttribute("class","leftpop");
        var img = document.createElement('img');
        img.setAttribute('src', 'images/leftpop.jpg');
	elm0.appendChild(img);

	var elm = document.createElement('p');
	elm.setAttribute("className","ppop");
	elm.setAttribute("class","ppop");
	var txtwidth = (txt1+txt2+txt3).length;
	var txtelm = document.createTextNode(txt1+txt2+txt3);
	elm.appendChild(txtelm);

	while(popup.hasChildNodes()){
	popup.removeChild(popup.lastChild);
	}

	popup.appendChild(elm0); 		
	popup.appendChild(elm); 
	popup.style.width=txtwidth*6 + 49 + "px";	
	popup.style.display="inline";
}


function showtrail2(url){
	cleardelayhide();
	
	setopacity('popup',90);	
	document.onclick=followmouse;
	//var overlay = document.getElementById("overlay");
	//var allcont = document.getElementById("allcont");
	var popup = document.getElementById("popup");
	var iframe = document.createElement('iframe');
	iframe.setAttribute("id", 'bigpop');  
	popup.style.height = "auto";

	while(popup.hasChildNodes()){
	popup.removeChild(popup.lastChild);
	}	

	//var arrayPageSize = getPageSize();
	//overlay.style.display = 'block';
	//overlay.style.height = (arrayPageSize[1] + 'px');

	popup.appendChild(iframe); 
	iframe.setAttribute("src", 'http://'+url);
	popup.style.width="auto";
	popup.style.display="inline";
	//setopacity('allcont',50);
}

function hidetrail(){
	var popup = document.getElementById("popup");
	//var overlay = document.getElementById("overlay");

	while(popup.hasChildNodes()){
	popup.removeChild(popup.lastChild);
	}	
	popup.style.display="none";
	document.onmousemove="";
	popup.style.left="-500px";
	//overlay.style.display = "none";
}

function delayhidetrail(s) {
	delayhide = setTimeout("hidetrail()",s);
}

function cleardelayhide() {
if (delayhide!="undefined")
	clearTimeout(delayhide)	
}

function fadeobj(objId,start,end,duration) {
        var speed = Math.round(duration / 100); //number of steps
        var timer = 0;
	var big = 0;

	if (document.getElementById("bigpop"))  {          //big is there
	big = 1;
	}

        if (start < end && big==1){
        for (var i=start; i<=end; i++) {
        setTimeout("setopacity('"+objId+"',"+i+")", timer * speed);
        timer++;
        } 
	return;
        }
	else if (start < end) {
	setopacity(objId,100);
	}	

        for (var i=start; i>=end; i--) { 
        setTimeout("setopacity('"+objId+"',"+i+")", timer * speed);
        timer++;
        }

}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function followmouse(e){ //many sources

	var offsetfrommouse=[7,0]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset

	var currentimageheight = 50;	// maximum popup size.
	var currentimagewidth = 150; 	// maximum popup width

	if (document.getElementById("bigpop"))  {          //need big space
	var currentimageheight = 350;
	var currentimagewidth = 400;
	}

	var popup = document.getElementById("popup");
	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	//var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	//var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)-15
	//var docwidth=(document.all)? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	//var docheight=(document.all)? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)-25

	var curX=(!document.all)?e.pageX : event.clientX+truebody().scrollLeft;
	var curY=(!document.all)?e.pageY : event.clientY+truebody().scrollTop;

	var rightedge=(document.all && !window.opera)? truebody().clientWidth-event.clientX-xcoord : window.innerWidth-e.clientX-xcoord-20
	var bottomedge=(document.all && !window.opera)? truebody().clientHeight-event.clientY-ycoord : window.innerHeight-e.clientY-ycoord-20

	var leftedge=(xcoord<0)? xcoord*(-1) : -1000

	if (rightedge<popup.offsetWidth) {
	popup.style.left=(document.all)? truebody().scrollLeft+event.clientX-popup.offsetWidth+"px" : window.pageXOffset+e.clientX-popup.offsetWidth+"px"
	}
	else if (curX<leftedge) {
	popup.style.left="5px";
	}
	else {
	popup.style.left=curX+xcoord+"px";
	}
	if (bottomedge<currentimageheight) {
	popup.style.top=(document.all)? truebody().scrollTop+event.clientY-currentimageheight-ycoord+"px" : window.pageYOffset+e.clientY-currentimageheight-ycoord+"px"
	}
	else {
	popup.style.top=curY+ycoord+"px";
	}
}

/*
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}*/

}

function setopacity(objId, opacity) {

//for everyone
	
 opacity = (opacity == 100)?99.99:opacity;
  var  obj = document.getElementById(objId);  

 if (obj.filters) {

// IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  } else {

  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
 
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}
}

function fadeobj1(objId,start,end,duration) {
        var speed = Math.round(duration / 100); //number of steps
        var timer = 0;
	var big = 0;

        if (start < end){
        for (var i=start; i<=end; i++) {
        setTimeout("setopacity('"+objId+"',"+i+")", timer * speed);
        timer++;
        } 
	return;
        }

        for (var i=start; i>=end; i--) { 
        setTimeout("setopacity('"+objId+"',"+i+")", timer * speed);
        timer++;
        }

}


//AJAX test

if (jjax==1 && document.createElement) {

function showall(objClass,action){
if (document.getElementsByClassName) { //Not for old IE

	var allobj = document.getElementsByClassName(objClass);

    for (var i = 0, length = allobj.length; i < length; i++) {
	var eid = allobj[i].id.slice(6);
	var infotest = document.getElementById('infotest'+eid);
	if ((!infotest && action == 1) || (infotest && action == 0)) { //prevent toggle
	var speed = (action==0)? 0: 100;
	setTimeout("clicked('dplan'," + eid + ")",i*speed);
	}
	}
  }	
}

//dplan
function loadFragmentInToElement(fragment_url, element_id) { 
	var xmlhttp=GetXmlHttpObject();
	var element = document.getElementById(element_id); 
	element.innerHTML = '<img src="images/wait1.gif" alt="wait">';   
	xmlhttp.open("GET", fragment_url); 
	
	    xmlhttp.onreadystatechange = function() { 
	        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 
	            element.innerHTML = xmlhttp.responseText; 
	        } 
	    } 
	    xmlhttp.send(null); 
	} 

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}


//dplan functions

function over(eid) {
if (!document.createElement || !document.childNodes ) {
	window.alert('Your browser is not DOM compliant');
	} else {
        var img = document.createElement('img');
        img.setAttribute('src', 'images/papinfo.gif');
	img.setAttribute('class','infopic');
	img.setAttribute('className','infopic');
	img.setAttribute('id','infopic'+eid);
	var papnot = document.getElementById('papnot'+eid);
	var infopic = document.getElementById('infopic'+eid);
	var infotest = document.getElementById('infotest'+eid);
	if (!infopic && !infotest) {     
	papnot.parentNode.appendChild(img);}
	}
}

function out(eid) {
if (!document.createElement || !document.childNodes ) {
	window.alert('Your browser is not DOM compliant');
	}
	else {
	var papnot = document.getElementById('papnot'+eid);
	var infopic = document.getElementById('infopic'+eid);
	var infotest = document.getElementById('infotest'+eid);
	if (infopic && !infotest) {
	papnot.parentNode.removeChild(infopic);
	}
	}
}

function clicked(aim,eid) {
if (!document.createElement || !document.childNodes ) {
	window.alert('Your browser is not DOM compliant');
	} else {
	var theNewDiv = document.createElement('div');
	theNewDiv.setAttribute('class','infotest');
	theNewDiv.setAttribute('className','infotest');
	theNewDiv.setAttribute('id','infotest'+eid);
	var papnot = document.getElementById('papnot'+eid);
	var infotest = document.getElementById('infotest'+eid);
	var infopic = document.getElementById('infopic'+eid);

	if (!infotest) 	{
	papnot.parentNode.appendChild(theNewDiv);
	var infotest = document.getElementById('infotest'+eid);
	infotest.style.opacity = 0;
	fadeobj1('infotest'+eid,10,100,600);
	loadFragmentInToElement(aim+'info.php?evnt='+eid,'infotest'+eid);
	}
	else if (infotest) {
	if (infopic) {
	papnot.parentNode.removeChild(infopic);
	}
	papnot.parentNode.removeChild(infotest);
	}
	theNewDiv.onclick = function () {
	if (infopic) {
	this.parentNode.removeChild(infopic);
	}
	this.parentNode.removeChild(this);
	};
	}
}
}

<!-- Free javascripts @ http://www.hscripts.com -->
function fnSelect(objId)
{

   if (window.getSelection) 
   {
      window.getSelection().removeAllRanges();
      var range = document.createRange();
      range.selectNode(document.getElementById(objId));
      window.getSelection().addRange(range);
   }
   else if (document.selection) 
   {
      document.selection.empty();
      var range = document.body.createTextRange();
      range.moveToElementText(document.getElementById(objId));
      range.select();
   }
}
// -->
