// Hintbox visar snyggare attribut på länkar ALF 20100816


var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

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

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
}
else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
}
return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
if ((ie||ns6) && document.getElementById("hintbox")){
dropmenuobj=document.getElementById("hintbox")
dropmenuobj.innerHTML=menucontents
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
dropmenuobj.style.visibility="visible"
obj.onmouseout=hidetip
}
}

function hidetip(e){
dropmenuobj.style.visibility="hidden"
dropmenuobj.style.left="-500px"
}

function createhintbox(){
var divblock=document.createElement("div")
divblock.setAttribute("id", "hintbox")
document.body.appendChild(divblock)
}

if (window.addEventListener)
window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
window.attachEvent("onload", createhintbox)
else if (document.getElementById)
window.onload=createhintbox

// Funktion för att styra storleken på popup fönster kollisök

function createTarget(t){
window.open("", t, "width=880,height=800");
return true;
}

// Funktion för att styra storleken på popup fönster support

function createTargetS(t){
window.open('', t,'left=20,top=20,width=800,height=840,toolbar=no,resizable=yes,scrollbars=yes');
return true;
}

// Funktion för att styra storleken på popup fönster felrapport

function createTargetB(t){
window.open('', t,'left=20,top=20,width=570,height=650,toolbar=no,resizable=yes,scrollbars=yes');
return true;
}

// Funktion för att styra storleken på popup fönster pricerunner recension

function createTargetPR(t){
window.open('', t,'left=20,top=20,width=1050,height=700,toolbar=no,resizable=yes,scrollbars=yes');
return true;
}

function createTargetCert(t){
window.open('', t,'left=20,top=20,width=840,height=840,toolbar=no,resizable=yes,scrollbars=yes');
return true;
}

//FUNKTION SOM ÖPPNAR POPUP FÖR KOLLISÖK FRÅN KUNDS EGNA SIDA

function openwinsize(URL,x,y) {
window.open(URL,"windowname","toolbar=no,location= no,directories=no,status=no,menubar=no,width=" + x + ",height=" + y);
}

// Funktion för Klarna popup


//addKlarnaPartPaymentEvent(function() { InitKlarnaPartPaymentElements('klarna_partpayment', 3194, 'se', 19); });

// Funktion som skriver ut valt innehåll på sida

function printDiv()
{
  var printer = window.open('','','width=840,height=700,scrollbars=yes');
	printer.document.open("text/html");
	printer.document.write(document.getElementById('printingstuff').innerHTML);
	printer.document.close();
	//printer.window.close();
	printer.print();
	//alert("Skriver nu ut önskad sida. Kommer det ingen utskrift så kolla om din skrivare är klar för utskrift och angiven som standardskrivare.\n\n  --- teamet bakom Funstuff!");
}

//Utelämnar nämnda div från utskrift

function print_this(element_id) {
        var divs = document.getElementsByTagName("DIV");
        for (i=0; i<divs.length; i++) {
            if (divs[i].id != element_id && divs[i].className ==
"hide_for_print") {
                divs[i].style.display = "none";
            }
        }
        window.print();
    }
	
	
