/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var offsetfrommouse=[0,0]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 270;	// maximum image size.

if (document.getElementById || document.all){
	document.write('<div id="trailimageid" class="trailimageid">');
	document.write('</div>');
}

function gettrailobj(){
if (document.getElementById)
return document.getElementById("trailimageid").style
else if (document.all)
return document.all.trailimagid.style
}

function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("trailimageid")
else if (document.all)
return document.all.trailimagid
}

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

function showtrail(imagename,title,description,posleft,postop, pdffile){

    gettrailobj().left=posleft+"px"
	gettrailobj().top=postop+"px"

	newHTML = '<div style="padding: 0px; background-color: #FFFFFF; border: 1px solid #888888; width:300px; margin-left:0px">';
	//newHTML = newHTML + '<h1>' + title + '</h1><div class="borderbot"></div>';
	newHTML = newHTML + '<p style="margin-top:9px; margin-bottom:5px; margin-left:9px"><a href="' + pdffile + '" target="_blank">Download som pdf</a><span style="color:#A00101; margin-left:90px" onclick="hidetrail()">luk vindue [x]</span></p>';
	newHTML = newHTML + '<div align="center" valign="top" style="margin-bottom:9px"><img src="' + imagename + '" border="0"></div>';
	newHTML = newHTML + '</div>';

	gettrailobjnostyle().innerHTML = newHTML;

	gettrailobj().visibility="visible";
}


function hidetrail(){
	gettrailobj().visibility="hidden"
	document.onmousemove=""
	gettrailobj().left="-500px"

}