
	function getBaseURL(){ 
	   return "https://goughs.cat.com/DSFUnbundled/";
	}
	
	
	
	
	function getURLBasedOnAppName(appName)	{
	
		if (appName == 'Industrial Wizard')
			return 'http://industrialwizard.catmms.com/catwizards/industrialWizard/jsp/dealerStoreFront.jsp';
		else if (appName == 'Marine Spec Sheet Wizard' )	
		    return 'http://marinewizard.catmms.com/catwizards/marineWizard/jsp/dealerStoreFront.jsp';
		else if (appName == 'Electric Power Wizard')
		    return 'http://vidswizard.catmms.com/catwizards/vidswizard/jsp/dealerStoreFront.jsp';   
		else if (appName == 'Blanchard')    
			return "http://dsfunbundledt3.ecorp.cat.com/blanchard";
		else if (appName == 'Portal Lite' )	
			return "http://dsfunbundledt3.ecorp.cat.com/portal-lite";
		else if (appName == 'newbuildnquote')
                  return "http://buildnquote-rp.cat.com";
        else
              return ' ';    
	}
	
	/*
	  this the method is calling when user select speicifc application  from 
      Quick Access link from select box. 
	*/
	function loadSelectBoxChanges(selectBox){
		var selValue;
		var tmpValue;
		var partialURL;
		var endOfUrl;
		var selIndex = selectBox.selectedIndex;
		if (selIndex != -1) {
			selValue = selectBox.options[selIndex].value;
			if (selValue.length ==  0 ){
			      return;
			}
			tmpValue = getURLBasedOnAppName(selValue);
	        if (tmpValue != ' '){
			  selValue = tmpValue;
			}else{
				partialURL = selValue.substring(0, selValue.indexOf('=')+1);
				endOfUrl = selValue.substr(selValue.indexOf('=')+1);
				selValue = getBaseURL()+partialURL + endOfUrl;
			}
			var tdElement=document.getElementById("appName");
			if(tdElement){
				tdElement.innerHTML ="<span class='frameTitle'>" +selectBox.options[selIndex].text+"</span>"
			}
  	  }
		selectBox.selectedIndex = 0;
		if (selValue != "" ){
			if(parent.frames[1] !=null) {
				parent.frames[1].location.href=selValue;
			}else{
				window.location.href=selValue;
			}
		}
	}

	//close popup window if it exists	
	function logoff() {
  		if (window.popupWindow) {
			popupWindow.close();
  		}
	}