/* General Javascript include */

function switch_commercial(strType) {
    var strActiveFlapClass = "activeFlap_" + strType;
    document.getElementById("technicalInfo").style.display = "none";
    document.getElementById("commercialInfo").style.display = "block";
    document.getElementById("flap_technical").className = "inactiveFlap";
    document.getElementById("flap_commercial").className = strActiveFlapClass;
    top.displayedProductFlap = 'commercial';
}
function switch_technical(strType) {
    var strActiveFlapClass = "activeFlap_" + strType;
    document.getElementById("commercialInfo").style.display = "none";
    document.getElementById("technicalInfo").style.display = "block";
    document.getElementById("flap_commercial").className = "inactiveFlap";
    document.getElementById("flap_technical").className = strActiveFlapClass;
    top.displayedProductFlap = 'technical';
}


function jumpToOption(objSelectbox,strTarget) {
  var strOptionName = objSelectbox.options[objSelectbox.options.selectedIndex].text;
  var strOptionLink = objSelectbox.options[objSelectbox.options.selectedIndex].value;
  if (strOptionLink != "") {
    if (strTarget != "") {
        // Open in new window  //// TO DO ////
        location.href = strOptionLink + "?selected=" + strOptionName;
    }
    else {
        location.href = strOptionLink + "?selected=" + strOptionName;
    }
  }
}
function parseLinkOption(str) {
  var iURLStart = str.indexOf('"') + 1;
  var iURLEnd = str.lastIndexOf('">');
  var strURL = str.substring(iURLStart,iURLEnd);
  var iNameStart = str.indexOf('">') + 2;
  var iNameEnd = str.lastIndexOf('<');
  var strName = str.substring(iNameStart,iNameEnd);
  var strOptionList = '<option value="' + strURL + '">' + strName + '</option>\n';
  //var strSelectedOption = qs.get("selected","");
  //var strOptionList = '<option ';
  //if ( strName == strSelectedOption ) { strOptionList += 'selected'; }
  //strOptionList += ' value="' + strURL + '">' + strName + '</option>\n';
  document.write(strOptionList);
}

document.getElementsByClassName = function(className){
    var nodes = document.getElementsByTagName('*');
    var matches = new Array();
    for(i=0;i<nodes.length;i++){
        var tmp = nodes[i].getAttribute('class') || nodes[i].getAttribute('className');
        if(tmp == className) matches[matches.length] = nodes[i];
    }
    return matches;
}

function enableMenu(){document.getElementById("menu").innerHTML=document.getElementsByClassName("pm")[0].innerHTML;}
