modules = new Object();

modules.initialize			= true;
modules.cookies 			= true;
modules.imgrollover 		= true;
modules.dataval 			= true;
modules.win 				= true;
modules.divinit				= true;
modules.divmove				= true;
modules.divslide			= true;
modules.tree				= true;
modules.array				= true;
//modules.encode				= false;
//modules.frmsecure			= true;

function csDetect() {
    var agent   = navigator.userAgent.toLowerCase();
    this.major  = parseInt(navigator.appVersion);

    this.ns     = ((agent.indexOf('mozilla')	!= -1) &&
                  (agent.indexOf('spoofer')		== -1) &&
                  (agent.indexOf('compatible')	== -1) &&
                  (agent.indexOf('opera')		== -1) &&
                  (agent.indexOf('webtv')		== -1));
    this.ns6    = (this.ns && (this.major		>=  5));

    this.ie     = ((agent.indexOf("msie")		!= -1) &&
                  (agent.indexOf("opera")		== -1));
    this.ie5    = (this.ie && (this.major		>=  4) &&
                  (agent.indexOf("msie 5")		!= -1));
    this.ie6    = (this.ie && (this.major		>=  4) &&
                  (agent.indexOf("msie 6")		!= -1));

    this.mac = navigator.appVersion.indexOf('Mac') != -1;
    this.win = agent.indexOf('win') != -1;

	this.class5 = (this.ns6||this.ie5||this.ie6);
}
csB = new csDetect();

for (module in modules) {
	currentModule = eval("modules." + module);
	if (currentModule) {
		document.write ("<script language='javascript' src='/scripts/csinc_" + module);
		document.write (".js'></script>");
	}
}

            
function gsxPlayer(type,id) {
	playerWin = new csWin("/player.asp?" + type + "=" + id, "playerWin", 500, 460);
}
            
function gsListen(type, id) {
	playerWin = new csWin("/listen2.aspx?type=" + type + 
			"&trackid=" + id, "playerWin", 250, 200);
}

function gsRadioPlayer() {
	playerWin = new csWin("/player.html", "playerWin", 250, 200);
}

function popplayer() {
	playerWin = new csWin("/player.aspx","playerWin",400,275);
}

function pophelp() { 
	helpWin = new csWin("/help.aspx","helpWin",485,500,1,null,null,0,0); 
}

function popprint(whichFeature) { 
	printWin = new csWin("/featureprint.asp?id=" +
	whichFeature,"printWin",574,500,1,null,null,0,0); 
}
            
function setTree(treeName,treeLink,treeDepth, itemDescription) {
    document.frmHidden.variable1.value = treeLink;
    switch(treeName) {
                case "insTree":
                    document.frmHidden.variable2.value = "ins";
                    break;
                case "quickGeoTree":
                    document.frmHidden.variable2.value = "geo";
                    break;
                case "geoTree":
                    document.frmHidden.variable2.value = "geo";
                    break;
                default:
                    document.frmHidden.variable2.value = "quick";
                    break;
    }
    document.frmHidden.variable3.value = treeDepth;
    document.frmHidden.variable4.value = itemDescription;
	document.frmHidden.submit();
}
            
function setFilter(filterName) {
                var selectedItem = -1;
                browseForm = document.frmBrowseFilters;
                switch(filterName) {
                case "genre":
                    thisDropDown = browseForm.genre;
                    break;
                case "culturegroup":
                    thisDropDown = browseForm.culturegroup;
                    break;
                case "ensemble":
                    thisDropDown = browseForm.ensemble;
                    break;
                case "compilation":
                    thisDropDown = browseForm.compilation;
                    break;
                }
                for (i = 0; i < thisDropDown.length; i++) {
                    if (thisDropDown[i].selected) {
                        selectedItem = i;
                    }
                }
                if (selectedItem > -1) {
                    document.frmHidden.variable1.value = "filter";
                    document.frmHidden.variable2.value = filterName;
                    document.frmHidden.variable3.value = thisDropDown[selectedItem].value;
                    document.frmHidden.variable4.value = thisDropDown[selectedItem].text;
                    document.frmHidden.submit();
                }
}
            
function makeSelect(processPage, itemID) {
                document.frmHidden.action = processPage;
                document.frmHidden.variable1.value = itemID;
                document.frmHidden.submit();
}
            
function setCultureGroup(processPage, itemID) {
                document.frmCultureGroupDetail.submit();
}



// Create arrays to contain all the values 
// for links and image locations
link = new Array
image = new Array

link[1]="feature_01A.asp"
image[1]="images/home/home_01.jpg"

link[2]="feature_02A.asp"
image[2]="images/home/home_02.jpg"

link[3]="feature_03A.asp"
image[3]="images/home/home_03.jpg"

link[4]="feature_04A.asp"
image[4]="images/home/home_04.jpg"

link[5]="feature_05A.asp"
image[5]="images/home/home_03.jpg"


// Create a random number between 1 and five
random_num = (Math.round((Math.random()*4)+1))


// Write a link and images with random array
function showFeatures(){
document.write("<a href=\"" + link[random_num] + "\">");
document.write("<img src=\"" + image[random_num] + "\" border=\"0\"></a>");
}







