// Define the showCompanyDetails() function
function showCompanyDetails(memberRow){
    var memberRowController = document.getElementById(memberRow);
    if(memberRowController.style.display == 'block'){
        memberRowController.style.display = 'none';
    }else if(memberRowController.style.display == 'none'){
        memberRowController.style.display = 'block';
    }
}

function showElement(){
    var selectOption = document.getElementById('selectOption');
    var uploadFile = document.getElementById('uploadFile');
    var urlLink = document.getElementById('urlLink');
    uploadFile.style.display = 'none';
    urlLink.style.display = 'none';
    if(selectOption.value == 'uploadFile'){
        uploadFile.style.display = 'block';
    }else if(selectOption.value == 'urlLink'){
        urlLink.style.display = 'block';
    }
}

var curcontentindex=0;
var messages=new Array();

function getElementByClass(classname){
    var inc=0;
    var alltags=document.all? document.all : document.getElementsByTagName("*");
    for (i=0; i<alltags.length; i++){
    if (alltags[i].className==classname)
        messages[inc++]=alltags[i];
    }
}

function rotatecontent(){
    //get current message index (to show it):
    curcontentindex=(curcontentindex<messages.length-1)? curcontentindex+1 : 0;
    //get previous message index (to hide it):
    prevcontentindex=(curcontentindex==0)? messages.length-1 : curcontentindex-1;
    messages[prevcontentindex].style.display="none"; //hide previous message
    messages[curcontentindex].style.display="inline"; //show current message
}

function showPromoDiv(){
	new Effect.Appear(document.getElementById('special-feature'));
	pulsatePromoDiv();
}
function pulsatePromoDiv() {
	new Effect.Pulsate(document.getElementById('special-feature'), {pulses: 15, duration: 5 })
}

window.onload=function(){
    if (document.all || document.getElementById){
        getElementByClass("dyncontent");
        setInterval("rotatecontent()", 3500);
    }
    if (document.all&&document.getElementById) {
        navRoot = document.getElementById("nav");
        for (i=0; i<navRoot.childNodes.length; i++) {
            node = navRoot.childNodes[i];
            if (node.nodeName=="LI") {
                node.onmouseover=function() {
                    this.className+=" over";
                }
                node.onmouseout=function() {
                    this.className=this.className.replace(" over", "");
                }
            }
        }
    }
   	pulsatePromoDiv();
} 