<!-- //
			
var item_selected
item_selected = 'blank';

var userName;

var currentArea;
var lastOn;
var timer = 3;
var timerstate = 0;
var runtime;

var imgPath
imgPath = '../objects/img/'


//-------------------------------
// determine the area the
// user is in for the navigation
// ------------------------------


function renderNavigation(){
	
	var currentDoc = window.location.href;
	currentDoc = currentDoc.slice(0,currentDoc.lastIndexOf('/'))
	currentDoc = currentDoc.slice(currentDoc.lastIndexOf('/')+1,currentDoc.length)
		
	//alert(currentDoc);
	
	if(currentDoc.indexOf('#')!=-1){
		currentDoc = currentDoc.slice(0, currentDoc.indexOf('#'))
	}

	if(currentDoc==''){
		currentArea = 'home'
		document[currentArea].src = imgPath + 'nav_home2.gif';
	}
	
	else if(currentDoc=='whoweare'){
		currentArea = 'who'
		document[currentArea].src = imgPath + 'nav_who2.gif';
	}
	
	else if(currentDoc=='whatwedo'){
		currentArea = 'what'
		document[currentArea].src = imgPath + 'nav_what2.gif';
	}
		
	else if(currentDoc=='industries'){
		currentArea = 'ind'
		document[currentArea].src = imgPath + 'nav_ind2.gif';
	}
	
	else if(currentDoc=='casestudies'){
		currentArea = 'case'
		document[currentArea].src = imgPath + 'nav_case2.gif';
	}
	
	else if(currentDoc=='news'){
		currentArea = 'news'
		document[currentArea].src = imgPath + 'nav_news2.gif';
	}

	else if(currentDoc=='contactus'){
		currentArea = 'contact'
		document[currentArea].src = imgPath + 'nav_contact2.gif';
	}	
	
	else{
		currentArea = 'home'
		document[currentArea].src = imgPath + 'nav_home2.gif';
	}
}


function on(type, imgName) {
        if ((document.images) && (item_selected != imgName) && (imgName != lastOn)){        
 			 if(type=="nav"){
				  document[imgName].src = imgPath + type + "_" + imgName + '2.gif';
				  stopTimer();
					if (lastOn && lastOn!=currentArea) {
					 	document[lastOn].src = imgPath + type + "_" + lastOn + '1.gif';
                    }
                    lastOn = imgName;
              }else{
                   	document[imgName].src = imgPath + type + "_" + '2.gif';
              }
        }
}


function off(type, imgName) {
	if(imgName!=currentArea){
       if ((document.images) && (item_selected != imgName)){ 
			if(type=="nav"){
				//document[imgName].src = imgPath +  type + "_" + imgName + '1.gif';
				startTimer();
			}else{
				document[imgName].src = imgPath + type + "_" + '1.gif';
			}		
        }
	}
}

function startTimer() {
		runtime = timer;
		timerstate = 1;
		runTimer();
}

function runTimer() {
		 if (runtime > 0) {
			 runtime = runtime - 1;
			 setTimeout('runTimer()',1000);
		 } else if(timerstate > 0){
			 submenuOff();
		 }
}

function stopTimer(count) {
		runtime = count;
		timerstate = 0;
}


function submenuOff () {
	if (lastOn && lastOn!=currentArea) {
			MM_showHideLayers('whoweare','','hide','whatwedo','','hide','industries','','hide','casestudies','','hide','newsandevents','','hide','contactus','','hide');
			document[lastOn].src = imgPath + "nav_" + lastOn + '1.gif';
			lastOn = '';
    }
}



function MM_showHideLayers() { //v6.0 for the top navigation
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function launchCallBack(){
  //	alert('Callback function called')
	window.open('../requestacall.html','mywin','left=40,top=40,width=650,height=500,toolbar=0,resizable=0,scrollbars=yes');
	
}

function login(){

	userName = document.loginForm.username.value;
	//alert(userName)
	if(userName.length>2){
		MM_showHideLayers('login2','','show','login','','hide');
		document.loginForm2.userName2.value = userName;
	}else{
		//document.loginForm.username.backgroundcolor='red'
	}
}

//prob be used at some point
function openWindow(winUrl,winName,winFeat) {
		window.open(winUrl,winName,winFeat+' scrollbars=no');
}



// -->
