/**
 * @author ehandelsbureauet this script is copyrighted and is not allowed to be used without permission in any way.
 */
//move basket content to div topmenu
/*function moveBasketContent(){
 document.getElementById("kurvBoxItem2").innerHTML = document.getElementById("kurvText").innerHTML;
 }*/
function init(){
    attachLinktoDownload();
}


function attachLinktoDownload(){

    if (document.getElementById("ProductList_TD")) {
        var findPrType = document.getElementById("ProductList_TD").getElementsByTagName('DIV');
        for (var i = 0; i < findPrType.length; i++) {
            if (findPrType[i].className == "prCardDownloadLink") {
                if (findPrType[i].innerHTML != "") {
                    findPrType[i].parentNode.innerHTML = ("<a href='/images/shopdownloadfiles/" + findPrType[i].innerHTML + "'><img src='/images/design/dk_knapper/download_product.gif' alt='Højre-klik og vælg Gem for at downloade nu' ></a>");
                }
            }
        };
            }
    
    if (document.getElementById("prCardDownloadLink")) {
        var findPrType = document.getElementById("prCardDownloadLink");
        if (findPrType.firstChild.innerHTML != "") {
            findPrType.parentNode.innerHTML = ("<a href='/images/shopdownloadfiles/" + findPrType.firstChild.innerHTML + "'><img src='/images/design/dk_knapper/download_product.gif' alt='Højre-klik og vælg Gem for at downloade nu' ></a>");
        }
        
    }
}

// topmenu graphics 
function shiftBG(spanBox){
    var spanBoxArray = spanBox.getElementsByTagName("SPAN");
    spanBoxArray[0].style.background = "url(/images/design/topmenu/leftcorner_over.gif) repeat-x";
    spanBoxArray[1].style.background = "url(/images/design/topmenu/centercorner_over.gif) repeat-x";
    spanBoxArray[2].style.background = "url(/images/design/topmenu/rightcorner_over.gif) repeat-x";
}

function shiftBackBG(spanBox){
    var spanBoxArray = spanBox.getElementsByTagName("SPAN");
    spanBoxArray[0].style.background = "url(/images/design/topmenu/leftcorner_static.gif) repeat-x";
    spanBoxArray[1].style.background = "url(/images/design/topmenu/centercorner_static.gif) repeat-x";
    spanBoxArray[2].style.background = "url(/images/design/topmenu/rightcorner_static.gif) repeat-x";
}



//topmenu flash load
function insertMyFlash(){
    document.getElementById('topMenuWrap').style.height = "455px";
    
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="920" height="415" id="topbanner_kml" align="middle">');
    document.write('<param name="allowScriptAccess" value="sameDomain">');
    document.write('<param name="allowFullScreen" value="false">');
    document.write('<param name="movie" value="/images/flash/topbanner_kml.swf">');
    document.write('<param name="quality" value="high">');
    document.write('<embed src="/images/flash/topbanner_kml.swf" quality="high" bgcolor="#ffffff" width="920" height="415" name="topbanner_kml" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
    document.write('</object>');
    
    var getImg = document.getElementById("subpageDiv");
    getImg.firstChild.style.display = "none";
    
}
