$(document).ready(function(){
		var tipClassName='featuretip';
		var searchtipClassName='searchtip';
		var officeLocatorTipClassName='officeMaptip';


		if(((navigator.appName=='Microsoft Internet Explorer')?parseFloat((new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]):-1)==7){
			tipClassName='featuretipIE7';
			searchtipClassName='searchtipIE7';
			officeLocatorTipClassName = 'officeMaptipIE7';
		}
		

		$('a.featureTitleRightPanel, a.noThumbnailRightPanel, a.featureTitleThumbnail, a.featureTitleBodyPart').cluetip({
		  cluetipClass: tipClassName,
		  arrows: true, 
		  dropShadow: false,
		  showTitle: false,
		  sticky: true,
		  mouseOutClose: true,
		  closePosition: 'title',
		  width:'345px',
		  positionBy: 'auto',
		  ajaxCache:        true, 
  		  wrapperOutClose: true,
		  wrapperDivId: '#wrapperDiv',
		  ajaxProcess: function(data) {
				//data = data.replace(/<s(cript|tyle)(.|\s)*?\/s(cript|tyle)>/g, '').replace(/<(link|title)(.|\s)*?\/(link|title)>/g,'');
				data = $(data).find(".overlay");							
				return data;
		}, 
		// settings for when hoverIntent plugin is used
		hoverIntent: {    
                      sensitivity:  3,
					  interval:     500,
					  timeout:      500 
					}

		});

		$('a.jtTopSearch').cluetip({
			local: true, 
			hideLocal: true,
			sticky: true,
			mouseOutClose: true,
			cluetipClass: searchtipClassName,
			dropShadow: false,
			showTitle: false,
			closePosition: 'title',
			positionBy: 'bottomTopSearch',			
			//topOffset: '25px',
			width:'170px',
			arrows: false ,
			activation:'click', 
			wrapperOutClose: true,
			wrapperDivId: '#wrapperDiv'


		});
		
		//This cluetip will be used for the first overlay being rendered on the office locator list for google map.
		$('a.jtOfficeLocatorMap:eq(0)').cluetip({
		  cluetipClass: officeLocatorTipClassName, 
		  arrows: true, 
		  dropShadow: false,
		  showTitle: false,
		  //setting for overlay display.
		  sticky: true,
		  mouseOutClose: true,
		  closePosition: 'title',
		  width:'355px',
		  positionBy: 'auto',
		  //setting to enable browser level cache.
		  ajaxCache:   true, 
		  //setting for displacement from top.
		  topOffset: '-30px',
		  wrapperOutClose: true,
		  wrapperDivId: '#officeLocatorMapOverlay',

		  ajaxProcess: function(data) {
		  				//getting the translated text for View Larger Map
		                var translatedText = document.getElementById("viewLargerMapTransText").value;
						//data = data.replace(/<s(cript|tyle)(.|\s)*?\/s(cript|tyle)>/g, '').replace(/<(link|title)(.|\s)*?\/(link|title)>/g,'');
						data = data.replace(/View larger map/g, translatedText);
                        data = $(data).find("#officeLocatorMapOverlay");	
						return data;
		  }, 
		  // settings for when hoverIntent plugin is used
		  hoverIntent: {    
                      sensitivity:  3,
					  interval:     500,
					  timeout:      500 
					}
			
		  });

		//This cluetip configuration will be used for the all overlays other than the first, rendered on the office locator list for google map.
		$('a.jtOfficeLocatorMap:gt(0)').cluetip({
		  cluetipClass: officeLocatorTipClassName, 
		  arrows: true, 
		  dropShadow: false,
		  showTitle: false,
		  //setting for overlay display.
		  sticky: true,
		  mouseOutClose: true,
		  closePosition: 'title',
		  width:'355px',
		  positionBy: 'auto',
		  //setting to enable browser level cache.
		  ajaxCache:   true, 
		  //setting for displacement from top.
		  topOffset: '-40px',
		  wrapperOutClose: true,
		  wrapperDivId: '#officeLocatorMapOverlay',
  		  ajaxProcess: function(data) {
  		  				//getting the translated text for View Larger Map
		                var translatedText = document.getElementById("viewLargerMapTransText").value;
						//data = data.replace(/<s(cript|tyle)(.|\s)*?\/s(cript|tyle)>/g, '').replace(/<(link|title)(.|\s)*?\/(link|title)>/g,'');
						data = data.replace(/View larger map/g, translatedText);
                        data = $(data).find("#officeLocatorMapOverlay");	
						return data;
		  }, 
		  // settings for when hoverIntent plugin is used
		  hoverIntent: {    
                      sensitivity:  3,
					  interval:     500,
					  timeout:      500 
					}
			
		  });
	});

