﻿<!--
var timeout         = 10;
var closetimer		= 0;
var ddmenuitem      = 0;

var imgFiles = new Array('menu_beyondehr_01b.png', 'menu_catchuplatest_01b.png', 'menu_clinicaltrialaccess_01b.png', 'menu_compliancesecuritybackups_01b.png', 'menu_contact_01b.png', 'menu_economicstimulus_01b.png', 'menu_implemintationtraining_01b.png', 'menu_increasedrevenuepotential_01b.png', 'menu_industryevents_01b.png', 'menu_newsupdates_01b.png', 'menu_oncologyspecific_01b.png', 'menu_overview_01b.png', 'menu_payforperformace_01b.png', 'menu_pqriiniatives_01b.png', 'menu_support_01b.png', 'menu_technicalspecifications_01b.png', 'menu_upcomingarchivedwebinars_01b.png', 'menu_usoncologynews_01b.png');
var preloadFlag = false
PreloadImages()
 
// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();
 
	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
 
	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';
 
}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}
 
// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}
 
// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}
 
// close layer when click-out
document.onclick = mclose; 

function PreloadImages()
{
	//alert(imgFiles.length)
	//alert(document.images)

   var url = ""
    if (window.location.hostname == "localhost")
    {
        url = window.location.protocol + "//" + window.location.host + "/iknowmed/";
    }
    else
    {
        url = window.location.protocol + "//" + window.location.host + "/";
    }

	if (document.images)
	{
		//var imgFiles = PreloadImages.arguments;
		//alert(document.preloadArray==null)
		if (document.preloadArray==null)
		{
			document.preloadArray = new Array();
			var i = document.preloadArray.length;
			with (document)
			{
				for (var j=0; j<imgFiles.length; j++)
				{
					preloadArray[i] = new Image;
					preloadArray[i++].src = url + "images/common/menu01/"+imgFiles[j];
				}
	            preloadFlag = true
			}
		}	
	}
}

function changeImages() {
    
    //Get current page
    var path = window.location.pathname
    //var url = window.location.protocol + "//" + window.location.host + path.substring(0, path.lastIndexOf('/') + 1);
   var url = ""
    if (window.location.hostname == "localhost")
    {
        url = window.location.protocol + "//" + window.location.host + "/iknowmed/";
    }
    else
    {
        url = window.location.protocol + "//" + window.location.host + "/";
    }
    //alert(url);
        
    var pageName = path.substring(path.lastIndexOf('/') + 1);
    var pageID = pageName.substring(0,pageName.lastIndexOf('.'));
    //alert(pageID)
    //alert(arguments[0])
    if (pageID == arguments[0]) {
        //return true;
    }
    
    if (document.images && (preloadFlag == true)) {
	    for (var i=0; i<changeImages.arguments.length; i+=2) {
		    //document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		    //alert(document[changeImages.arguments[i]].src);
		    //document[changeImages.arguments[i]].src = "images/common/menu01/"+changeImages.arguments[i+1];
		    document[changeImages.arguments[i]].src = url + "images/common/menu01/"+changeImages.arguments[i+1];
		    //alert(document[changeImages.arguments[i]].src);
	    }
    }
}

function setCurrentPage()
{

    if (document.images) {
	    for (var i=0; i<setCurrentPage.arguments.length; i+=2) {
		    //alert("images/public/common/"+setCurrentPage.arguments[i+1]);
		    document[setCurrentPage.arguments[i]].src = "images/common/menu01/"+setCurrentPage.arguments[i+1];
	    }
    }

}

// -->