/********************************************************************************
	This script is copyrighted by Orange Street Softare
		www.orangestreetsoftware.com
	
********************************************************************************/

// ================================== GLOBAL VARIABLES ====================================================

var this_quick_link_container;


// ===================================== RENDERING FUNCTIONS ==============================================

// --------------------------------------------------------------------------------------------------------
// use this to draw the top bar, this will need to be called for each content page refresh
function render_quick_link ( )
{
	// storing the menu setup object global to ease accessing metrics and urls
	//    er, sorry.
	
	//window.alert(this_quick_link_container + ' : ' + window.the_quick_bar_dropdown + ' : ' + window.parent.the_quick_bar_dropdown);
	if (typeof(window.parent.the_quick_bar_dropdown) == "undefined" || typeof(window.parent.the_quick_bar_dropdown) != "object" )
	   return;
	   
	this_quick_link_container = window.parent.the_quick_bar_dropdown;

	// make the rest of the quick link drop down
	make_quick_link ();

}

// --------------------------------------------------------------------------------------------------------
// render out menu part of top bar
function make_quick_link ()
{
       var new_html = "";
       var n_item_index;       
	new_html += '<select class="quick_link" onchange="quick_link_selected(this);">';
	new_html += '<option value="-1">I am looking for...</option>';
	// loop thru the items in the top bar and make appropriate item tags
	for ( n_item_index = 0 ; n_item_index < this_quick_link_container.item_count ; n_item_index++ )
	{
	  new_html += '<option value="this_quick_link_container.item_click (' + n_item_index.toString() + ');">' + this_quick_link_container.item_names[n_item_index] + '</option>'; 
	}	
	new_html += '</select>';
	
	assign_new_html(new_html);
	
}

function assign_new_html(s_new_html){
       var quick_link_object;
       if ( document.getElementById && ( document.getElementById ( "left_quick_link" ) != null ) )
            quick_link_object = eval ( "document.getElementById ('left_quick_link')" );		      
       else if ( document.all )
               quick_link_object = eval ( "left_quick_link" );
            else
    	       quick_link_object = eval ( "document.left_quick_link" );
    	       
      quick_link_object.innerHTML = s_new_html;

}

// --------------------------------------------------------------------------------------------------------
