//--------------------------------------------------------------------------------
//
//    File name   : dynamicTemplate.js
//    Project     : UWS Dynamic Template
//    Description : This js file used to display the Dynamic template menus 
//                  ,footer and tools js file loading process.
//    version     : 1.0 
//--------------------------------------------------------------------------------

//--------------------------------------------------------------------------------
// Dynamic Template server (Do not customoize)
// Server - http://www.honeywell.com
// Note: For testing, we have given staging server URL in the below.
//--------------------------------------------------------------------------------

var dtServer = "http://www51.honeywell.com";

//--------------------------------------------------------------------------------
//
//  Color palettes are defined in the UWS Style Guide and different colors 
//  are typically aligned with different business units.
//   
//  Possible colours
//       - green
//       - navy
//       - indigo
//       - brightblue
//       - red
//       - darktan
//--------------------------------------------------------------------------------

var uws_palette = 'green';

//--------------------------------------------------------------------------------
//   N1N2 Menu controlling variable   
//        -  uws (menus will be loaded from the uws server)
//        -  custom (menus will be loaded from the n1n2filepath value) 
//---------------------------------------------------------------------------------

var menuType = "custom";  

//-------------------------------------------------------------------------------------
//  File path of the N1N2 menu variable.This value is needed if menuType set as 'own' 
//-------------------------------------------------------------------------------------

var n1n2filepath = '../scripts/menu_N1N2.js';   

//--------------------------------------------------------------------------------
//  N1N2 Menu site id: Based on this value menus will be displayed.
//    Possible values
//          - honeywell (Honeywell)
//          - sm        (Specialty Material)
//          - em        (Electronic Material)
//          - rlss      (Research and Life science solutions)
//          - bandj     (Burdick & Jackson)
//          - gen       (Genetron® Refrigerants)
//          - genesolv  (Genesolv® Solvents)
//          - acs       (Automation and Control Solutions)
//          - aero      (Aerospace)
//          - turbo     (Turbo Technologies)       
//          - enovate   (Enovate® 3000)       
//--------------------------------------------------------------------------------

var n1n2MenuSiteID = 'sm';  


//--------------------------------------------------------------------------------
//
//  Breadcrumb type. 
//        -  uws (Breadcrumb will be loaded from the uws server.uws_breadcrumb must needed)
//        -  custom (Breadcrumb will be loaded from the n1n2filepath value) 
//
//--------------------------------------------------------------------------------

var breadcrumbType = 'uws';

//--------------------------------------------------------------------------------
//
//  UWS Breadcrumb
//          - honeywell (Honeywell)
//          - sm        (Specialty Material)
//          - em        (Electronic Material)
//          - rlss      (Research and Life science solutions)
//          - bandj     (Burdick & Jackson)
//          - gen       (Genetron® Refrigerants)
//          - genesolv  (Genesolv® Solvents)
//          - acs       (Automation and Control Solutions)
//          - aero      (Aerospace)
//          - turbo     (Turbo Technologies)       
//          - enovate   (Enovate® 3000)       
//  Custom Breadcrumb
//          - siteID ( Site id of your website)
//--------------------------------------------------------------------------------

var uws_breadcrumb = 'em';

//--------------------------------------------------------------------------------
//
//  Custom Breadcrumb 
//
//  custom_taxonomy_bc = { 'siteID' : ['ParentSiteID','mySiteURL','ImageFileWithSiteName'] };
//
//--------------------------------------------------------------------------------

var custom_taxonomy_bc = { 
          
          'parent' : ['honeywell','http://www.myserver.com','images/txt_mySite.gif'] ,
          'siteID' : ['parent','http://www.myserver.com/mysite/','images/txt_mySite.gif'] 
          
          };


//--------------------------------------------------------------------------------
// eMetrics enabling field.value can be true or false.(can be customize)
//--------------------------------------------------------------------------------

var use_eMetrics = true;

//--------------------------------------------------------------------------------
// loading tools code (Path can be customize)
//--------------------------------------------------------------------------------

function uws_tools(Search,Login,Download)
{   
   if(Search)
   	document.write('<script language="JavaScript" src="scripts/search.js"></script>');   
   if(Login)                                                                                            
   	document.write('<script language="JavaScript" src="scripts/login.js"></script>');                
   if(Download)
   	document.write('<script language="JavaScript" src="scripts/download.js"></script>');      
}

//--------------------------------------------------------------------------------
// loading N1N2 menu code  (Do not customoiz)
//--------------------------------------------------------------------------------

document.write("<script language='JavaScript' src='http://www51.honeywell.com/hfl/scripts/serverprops.js'></script>");

if(menuType == "uws")
document.write("<script language='JavaScript' src='"+dtServer+"/sites/scripts/dt/"+n1n2MenuSiteID+"_N1N2.js'></script>");
else
document.write("<script language='JavaScript' src='"+n1n2filepath+"'></script>");

document.write("<script language='JavaScript' src='../scripts/uws_main.js'></script>");
document.write("<script language='JavaScript' src='http://www51.honeywell.com/common/scripts/hw_bc_taxonomy.js'></script>"); 
//--------------------------------------------------------------------------------

//--------------------------------------------------------------------------------
// Region selector (can be customized)
//--------------------------------------------------------------------------------

// No ofRegions 
var noOfRegions = 2;

// Based on this value drop list will display.(If noOfRegions less than 7 this value is needed)
var region_name_url = [
	['United States','http://www.honeywell.com'] ,
	['India', 'http://www.india.honeywell.com/index.jsp'] 
];
if(noOfRegions < 8)
noOfRegions = region_name_url.length;

// Region selector page url (if noOfRegions greater than 7 this value is needed)
var region_selector_url = 'http://www.honeywell.com/sites/portal?smap=honeywell&page=honeywellglobal&theme=T8';

//--------------------------------------------------------------------------------

//--------------------------------------------------------------------------------
// Region selector (can be customized)
//--------------------------------------------------------------------------------

// Based on this value language drop down list will display.
var language_url = [
	['English','http://www.honeywell.com?ln=en'] ,
	['German','http://www.honeywell.com?ln=gr'] 

];

//--------------------------------------------------------------------------------



//--------------------------------------------------------------------------------
// Footer code (can be customized)
//--------------------------------------------------------------------------------

// For providing the sitemap link in the footer
var sitemapURL = 'www.honeywell.com';

// For providing the advance search in the footer
var advanceSearchURL = 'www.honeywell.com';


function uws_getFooterAndGlobalLinks(showRegion, showTranslate) {
	var sOut = '';

	sOut += '<form name="footerForm"><div id="footer">';
	sOut += '<table border="0" cellpadding="0" cellspacing="0" width="760" id="footrule">';
	sOut += '<tr class="footrule">';
	sOut += '<td><img src="../images/c.gif" width="1" height="4" border="0"></td>'; 
	sOut += '</tr><tr>';
	sOut += '<td><img src="../images/c.gif" width="1" height="4" border="0"></td>';
	sOut += '</tr></table>';
	sOut += '<table border="0" cellpadding="0" cellspacing="0" width="760" id="footnav">';
	sOut += '<tr class="footer" height="25">';
	sOut += '<td width="350" class="footer" height="20" colspan="7">';
	sOut += '<div class="marg16">';
	sOut += '<a href="http://www51.honeywell.com/terms-conditions/termsconditions.html" target="_blank">Terms & Conditions</a> | ';
	sOut += '<a href="http://www51.honeywell.com/privacy/en.html" target="_blank">Privacy Statement</a>';	
	
	sOut += '</div></td>';
	
	
	if (showRegion) {	
		sOut += '<TD class="bgwhite" width="3"><IMG src="../images/c.gif" width="3" height="24" border="0"></TD>';		
		if(parseInt(noOfRegions) > 7)
		{		    
		    sOut += '<TD width="40"><DIV class="marg16" id="flag"><A';
		    sOut += ' href="'+region_selector_url+'"><IMG height=14 src="images/icon_flag_usa.gif" width="20" border="0"></A></DIV></TD><TD class="footer" width="150"><A';
		    sOut += ' class="region" href="'+region_selector_url+'">Choose Your Region/Country</A></div>';	 	    
	        } else
	        {	        
	    	    sOut += '<td width="5"><IMG src="../images/c.gif" height="1" width="5"></td><TD class="footer" width="170">';
	    	    sOut += '<select size="1" name="showRegion" class="footerRegion" onChange="javascript:openWindow(document.footerForm.showRegion);">';
	    	    sOut += '<option value="#"> Choose Your Region/Country ';    
		    for(var i=0;i<noOfRegions;i++)
		    {
			sOut += '<option value="'+region_name_url[i][1]+'">'+region_name_url[i][0];    
		    }
	            sOut += '</select>';
	        }	        		
      	        sOut += '</TD><td width="5"><IMG src="../images/c.gif" height="1" width="5"></td>';
         }                                         
        
	 if (showTranslate) {	 
	     sOut += '<TD class=bgwhite width="3"><IMG src="../images/c.gif" width="3" height="1" border="0"></TD>';
	     sOut += '<td width="5"><IMG src="../images/c.gif" height="1" width="5"></td>';
	     sOut +='<td class="footer" width="135"><select class="lang" name="language" onChange="javascript:openWindow(document.footerForm.language);">';
	     sOut += '<option value="">Select Your Language';
	     for(var i=0;i<language_url.length;i++)
	     {
	     sOut += '<option value="'+language_url[i][1]+'">'+language_url[i][0];
	     }
	     sOut += '</select></td>';
	     sOut += '<td width="15"><IMG src="../images/c.gif" height="1" width="15"></td>';
	 } 	

	sOut += '</tr></table></td></tr></table>';
	
	sOut += '<table border="0" cellpadding="0" cellspacing="0" width="760">';
	sOut += '<tr><td height="3"><img src="../images/c.gif" height="3"></td></tr>';
	sOut += '<tr><td align="center">';
	sOut += '&#169; Copyright Honeywell International Inc 2004-2011';
	sOut += '</td></tr>';
	sOut += '<tr><td height="3"><img src="../images/c.gif" height="3"></td></tr>';
	sOut += '</table>';	
	
	sOut += '</div></form>';

	document.write(sOut);
}

function openWindow(opt)
{
	if(opt.options.selectedIndex != -1 && opt.options.selectedIndex != 0)
	{
		window.open(opt.options[opt.options.selectedIndex].value);		
	}
}
//--------------------------------------------------------------------------------
