////////////////////////////////////////////////////////
// Configuration variables
////////////////////////////////////////////////////////
index_pagename = "index.php";
index_name = "nav_home";
on_suffix = "_on";
off_suffix = "_off";
img_suffix = ".jpg";
img_path = "http://jdubrecords.org/hiddenmelodies/wp-content/themes/default/images/";
root_folder = "http://jdubrecords.org/hiddenmelodies/";

////////////////////////////////////////////////////////
// These are the NAMES of your images
////////////////////////////////////////////////////////
image_ids = new Array(

"nav_home",
"nav_la",
"nav_sf",
"nav_thesway",
"nav_sponsors",
"nav_contact"

);

////////////////////////////////////////////////////////
// These are where the images link to.
////////////////////////////////////////////////////////
page_names = new Array(

"http://www.jdubrecords.org/hiddenmelodies/",
"http://jdubrecords.org/hiddenmelodies/?page_id=7",
"http://jdubrecords.org/hiddenmelodies/?page_id=9",
"http://jdubrecords.org/hiddenmelodies/?page_id=15",
"http://jdubrecords.org/hiddenmelodies/?page_id=17",
"http://jdubrecords.org/hiddenmelodies/?page_id=18"

);


/* END USER EDIT */


////////////////////////////////////////////////////////
// DO NOT EDIT BELOW HERE
// Unless you know what you're doing and want to change
// the format of the links
////////////////////////////////////////////////////////

page_map = new Array();

for (imgNDX = 0; imgNDX < image_ids.length; imgNDX ++)
{
	i = image_ids[imgNDX];
      page_map[i] = page_names[imgNDX];
    
	myString =  i + off_suffix + " = new Image()";
	eval(myString);
	myString =  i + off_suffix + ".src = '" + img_path + i + off_suffix + img_suffix + "'";
	eval(myString);
	myString = i + on_suffix + " = new Image();"
	eval(myString);
	myString = i + on_suffix + ".src = '" + img_path + i + on_suffix + img_suffix + "'";
	eval(myString);
}

function imgOn(imgName)
{
    document.getElementById(imgName).src = eval(imgName + on_suffix + ".src");
}

function imgOff(imgName)
{
    document.getElementById(imgName).src = eval(imgName + off_suffix + ".src");
}

function make_link( text, URL, classnm_on, classnm_off )
{
    page_name     = window.location.pathname;
    path_supplied = root_folder + URL;
    
    if ( (path_supplied == page_name )
        || ((path_supplied == root_folder) && (URL == index_pagename)) )
    {
        link_str = "<span class=\"" + classnm_off + "\">" + text + "</span>";
    }
    else
    {
        link_str = "<a href=\"" + URL + "\" class=\"" + classnm_off + "\">" + text + "</a>";       
    }
    
    document.write(link_str);
    return;
}

function make_img_link( link_id )
{
    page_name = window.location.search;
	//alert(root_folder + page_map[link_id] + " " + page_name);
   // if ( ((root_folder + page_map[link_id]) == page_name)

    if ( page_map[link_id] == page_name
        || ((page_name == "") && (link_id == index_name)) )
    {
        link_str = "<img src=\"" + img_path + link_id + on_suffix + img_suffix + "\">";
    }
    else
    {
        link_str = "<a href=\"" + page_map[link_id] + "\"><img id=\"" + link_id + "\" name=\"" + link_id + "\" src=\"" + img_path + link_id + off_suffix + img_suffix + "\" onmouseover=\"imgOn('" + link_id + "')\" onmouseout=\"imgOff('" + link_id + "')\" border=\"0\"></a>";
    }
   
    document.write(link_str);
    return;
}

