        var vcampusDesc = "<p><img src='images/vcampus_desc.png' style='float:left;'>The UWI Virtual Campus is an interactive map that allows the user to pan and zoom a map showing points of interests on the UWI campus. The iCampus allows the user to search for names of places on the campus. It is an excellent resource for the both persons that know the campus and those that are new to the campus.</p>";
        var jtiDesc = "<p>Given the current global economic climate, Jamaica Trade and Invest (JTI) is desirous of employing creative, agressive and cost effective marketing and facilitation strategies in order to capture and retain foreign investment. Notably, the trend among many investment promotion agencies (IPAs) in meeting some of the challenges and opportunities consequent to the financial meltdown has been to increase their use of technology, such as the internet. ";
        jtiDesc += " <br><br>As a result many IPA's websites now act as their primary lead generating and investor support tool as it extends their reach facilitating a cost effective introudction to investors in unexplored and underexplored markets.</p>";
        jtiDesc += "<br>Click the link above to see JTI's interactive web based tool.";

        var gpsDesc = "Are you a GPS customer? Click the following to view important about the following:<br><ul><li>Release dates for updates</li>";
        gpsDesc += "<li>News features and new data added</li><li>Garmin's newest products</li><li>New deals and discounts</li></ul>";

        var errDesc = "<p>Your experience is important to us. Have you experienced an error with the data we have provided you with? Please, tell us about it. Click the link above to visit our error reporting page.</p>";
        
        var nhtDesc = "<p>This interactive map shows housing project locations for the NHT.</p>"

	var p_menu = new Array();
	p_menu[0] = {"caption":"iCampus","icon":"images/globe.png","link":"/vcampus/","description":vcampusDesc};
	p_menu[1] = {"caption":"Investor Indicator Maps","icon":"images/jti_logo.png","link":"/jn/","description":jtiDesc};
	p_menu[2] = {"caption":"NHT Developments","icon":"images/nht_logo.png","link":"/nht/","description":nhtDesc};
	p_menu[3] = {"caption":"UWI Culture & Heritage Tour","icon":"images/heritage_icon.png","link":"http://monagis.com/public/3dvt/main.html"};
        p_menu[4] = {"caption":"GPS Customer Page","icon":"images/gps_page.png","link":"/jamnaverrors/customer/index.php","description":gpsDesc};
        p_menu[5] = {"caption":"Report GPS Error","icon":"images/report_gps.png","link":"/jamnaverrors/index.php","description":errDesc};

        function show_preview(arr_index){
                 clear_preview();
                 var obj = p_menu[arr_index];
                 if(!obj) return;
                 init_preview(obj,arr_index);
        }

        function goTo(arr_index){
                 var obj = p_menu[arr_index];
                 if(!obj) return;
                 var link = obj.link;
                 if(link) {
                   if(link.indexOf("http") == -1) link = "http://projects.monagis.com" + link;
                 }
                 window.location = link;
        }

        var loadpicTO = null;

        function loadLinkLater(arr_index){
                 window.setTimeout("$('.link_div').fadeIn('slow')",50);
        }
        
        function loadDescriptionLater(arr_index){
                 $(".loading_div").show("slow");
                 window.setTimeout("$('.description_div').show('slow',hideLoader)",950);
        }

        function hideLoader(){
                 $(".loading_div").hide("slow");
        }


        function getIcon(obj){
                 if(navigator.appName.indexOf("Internet Explorer") != -1){
                 var icon = obj.icon;
                 icon = icon.replace(".png",".gif");
                 return icon;
                 }
                 return obj.icon;
        }

        function init_preview(obj,arr_index){
                 var title = obj.caption;

                 var link = obj.link;
                 var icon = getIcon(obj);
                 var description = obj.description;

                 var prev = document.getElementById("preview");

                 // Add the title
                 var titleDiv = document.createElement("div");
                 titleDiv.className = "title_div";
                 prev.appendChild(titleDiv);
                 if(title) {
                   titleDiv.innerHTML = "";
                   if(icon) {
                     titleDiv.innerHTML = "<img src='" + icon + "' class='preview_icon'>";
                   }
                   titleDiv.innerHTML = titleDiv.innerHTML + title;
                 }

                 // Add the link div
                 var linkDiv = document.createElement("div");
                 linkDiv.className = "link_div";

                 prev.appendChild(linkDiv);
                 if(link) {
                   if(link.indexOf("http") == -1) link = "http://projects.monagis.com" + link;

                   linkDiv.innerHTML = "<a href='" + link + "' title='" + title  + "'>Visit Web Site</a><br><span class='full_link'>[ " + link + " ]</span>";
                   loadLinkLater( arr_index );
                 }
                 
                 
                 // Add the loading message
                 var loadingDiv = document.createElement("div");
                 loadingDiv.className = "loading_div";
                 loadingDiv.innerHTML = "Loading description... ";

                 prev.appendChild(loadingDiv);
                 // Add the content div
                 var descriptionDiv = document.createElement("div");
                 descriptionDiv.className = "description_div";
                 prev.appendChild(descriptionDiv);
                 if(description) { 
                   descriptionDiv.innerHTML = description;
                   loadDescriptionLater(description);
                 }

                 $(".preview_icon").fadeIn("slow");


        }

        function clear_preview(){
              var prev = document.getElementById("preview");
              prev.innerHTML = "";
         }


	function loadMenu(){

                 var tbl = document.createElement("table");
                 tbl.setAttribute("align","left");
                 var tbody = document.createElement("tbody");
                 tbl.appendChild(tbody);
                 document.getElementById("menu").appendChild(tbl);
                 document.getElementById("menu").style.align = "left";

                 for(var i = 0; i < p_menu.length; i++)
                 {
                         var tr = document.createElement("tr");
                         var td = document.createElement("td");
                         var caption = p_menu[i].caption;
                         var caption_concat = caption;
                         if(caption.length > 25){
                                      caption_concat = caption.substring(0,20) + "...";
                         }
                         var icon = getIcon(p_menu[i]);
                         td.setAttribute("valign","center");
                         td.className = "menu_item";
                         tr.appendChild(td);
                         var htmlStr =  "<table width='280px'><tr><td width='78px'><img id='img_icon_" + i + "' class='menu_item_icon' src='" + getIcon(p_menu[i]) +
                         "'></td><td width='170px' title='" + caption + "' class='menu_item_caption' id='menu_item_caption_" + i + "'>" + caption_concat +
                         "</td><td width='32px' valign='bottom'><img class='menu_item_pbar' id='menu_item_icon_" + i + "' src='images/loading.gif'></td></tr></table>";
                         td.innerHTML = htmlStr;
                         tbody.appendChild(tr);

                         // Add the mouseover
                         td = document.getElementById("menu_item_caption_" + i);
                         td.inc = i;
                         tr.inc = i;
                         var img = document.getElementById("menu_item_icon_" + i);
                         img.inc = i;

                         var on = function(){
                                        var img = document.getElementById("menu_item_icon_" + this.inc);
                                        img.style.display = "block";
                                        this.style.color = "#244880";
                                        this.style.color = "#54c7ec";
                                        this.style.color = "#2962b0";
                                        show_preview(this.inc);
                                        
                                        var icon = document.getElementById("img_icon_" + this.inc);
                                        icon.className = "menu_item_icon_hover";

                         };

                         var off = function(){
                                        var img = document.getElementById("menu_item_icon_" + this.inc);
                                        img.style.display = "none";
                                        this.style.color = "white";
                                        
                                        var icon = document.getElementById("img_icon_" + this.inc);
                                        icon.className = "menu_item_icon";


                         };

                         var nav = function(){
                                    goTo(this.inc);
                         };


                         td.onmouseover = on;
                         td.onclick = nav;
                         td.onmouseout = off;


                 }


        }



