/**
 * @author ehandelsbureauet this script is copyrighted and is not allowed to be used without permission in any way.
 */
function unHideDescription(){
    document.getElementById("prMainDesJScripted").style.display = "block";
    document.getElementById("prAtagJScriptedLayoutSimple").style.display = "block";
    document.getElementById("prAtagJScripted").style.display = "none";
    return false;
}

function HideDescription(){
    document.getElementById("prMainDesJScripted").style.display = "none";
    document.getElementById("prAtagJScriptedLayoutSimple").style.display = "none";
    document.getElementById("prAtagJScripted").style.display = "block";
    return false;
}

function hideIfNoContent(){

    var DivText = (document.getElementById("prMainDesJScripted"));
    var DivTextContent = DivText.firstChild;
    
    
    if (DivTextContent.firstChild == null) {
        document.getElementById("prAtagJScripted").style.display = "none";
        return;
    }
    
    if (document.getElementById("prMainDesJScripted").innerHTML == "") {
        document.getElementById("prAtagJScripted").style.display = "none";
        return;
    }
    
    
}


function attachVideoLinks(){

    //CLEAN PDF
    if (document.getElementById("pdfLinkTD")) {
        var pdfLinkSpan = document.getElementById("pdfLinkTD").getElementsByTagName("BR");
        
        for (var i = 0; i < pdfLinkSpan.length; i++) {
            pdfLinkSpan[i].style.display = "none";
        };
            }
    
    //FIND DIVS WITH VIDEO AND SOUND INFO
    var pdfDIVfinder = document.getElementById("prCard").getElementsByTagName("DIV");
    for (var i = 0; i < pdfDIVfinder.length; i++) {
		
        if (pdfDIVfinder[i].className == "prVideoLink") {
            document.getElementById("pdfLinkTD").innerHTML += pdfDIVfinder[i].innerHTML;
            pdfDIVfinder[i].innerHTML = "";
        }
        if (pdfDIVfinder[i].className == "prSoundLink") {
            document.getElementById("pdfLinkTD").innerHTML += pdfDIVfinder[i].innerHTML;
            pdfDIVfinder[i].innerHTML = "";
        }
    }
    if (document.getElementById("videoLinkTD").innerHTML == "") {
        document.getElementById("videoLinkTD").style.display = "none";
    }
    
    
}

function switchPopup(){
//OBSOLUTE WITH MAGICZOOM
    // popup click mover

    /*
     if (document.getElementById("Canvas").innerHTML !="") {
     var canvasDiv = (document.getElementById("Canvas"));
     var canvasIMG = canvasDiv.getElementsByTagName("IMG");
     var canvasOnClick = canvasIMG[0].getAttribute("onclick");
     var canvasSrc = canvasIMG[0].getAttribute("src");
     var canvasMousedown = canvasIMG[0].getAttribute("onmousedown");
     var aSwitch = document.getElementById("aSwitch");
     aSwitch.setAttribute("src",canvasSrc);
     aSwitch.setAttribute("onclick",canvasOnClick);
     } else {
     
     var prImgTD = document.getElementById("prImgTD");
     var prImgTDIMG = prImgTD.getElementsByTagName("IMG");
     var prImgTDonclick = prImgTDIMG[0].getAttribute("onclick");
     var aSwitch = document.getElementById("aSwitch");
     aSwitch.setAttribute("onclick",prImgTDonclick);
     
     
     }
     */
    // popup end
}



