        var isKMobileDomain = document.location.hostname.indexOf("kmobile")>-1;
        var isOfotoDomain = document.location.hostname.indexOf("ofoto")>-1;

	function searchFormSubmit() {
		if (document.rightnow.terms.value == "" || document.rightnow.terms.value == null) {
			alert ("Please enter a search term");
			document.rightnow.terms.focus();
			return false;
		} else {
			document.forms['rightnow'].submit(); 
			return false;
		}
	}
  
	function ContextualHelpPopup(popupAnswerURL, windowHeight, windowWidth,toolbar) {

		var height    = "425";
		var width     = "390";
	
                if (windowHeight) {
                        height = windowHeight;                
                }       
                if (windowWidth) {
                        width = windowWidth;                
                }   
                
		var left      = Math.floor( (screen.width - width) / 2);                
		var top      = Math.floor( (screen.height - height) / 2);
                
                if (toolbar) {
                        top = top - 50;
                }
                
		var winParams = "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width + ",scrollbars,resizable";
                if (toolbar) {
                        winParams = winParams + ",toolbar";
                }
		msgWindow     = window.open('','targetname',winParams);
		
		msgWindow.location.href = popupAnswerURL;
		if (msgWindow.opener == null) msgWindow.opener = self;
	
	}

	
	function linkToOfoto(url,arg1,arg2) {
						 
		var currentPage   = document.location.href;
		var popUpFlag;
		var pageToCheck = currentPage;
		if (pageToCheck.indexOf("HelpAnswerPopup") != -1) { 
			popUpFlag = "true";   
		}										  
				 
		var url_with_params = url;
				
		if (arg1) {
					
			if (arg1.indexOf("#") != -1) {

				url_with_params = url_with_params + arg1;	
				
			}
			else {
			
				url_with_params = url_with_params + "&" + arg1;
				
			}
		}
		
		if (arg2) {
		
			url_with_params = url_with_params + arg2;
						
		}
		
		
		if (popUpFlag == "true") {
			opener.location.href = url_with_params;
		}
		else {
			self.location.href = url_with_params;
		}
		
	} 
		
												 
		function linkToRNTAnswer(url,answer_id) {
		
		var currentPage   = document.location.href;
		var popUpFlag;
		var string = currentPage;
		if (string.indexOf("HelpAnswerPopup") != -1) { 
			popUpFlag = "true";   
		}			 
		
		var url_with_params = url + "?answer_id=" + answer_id;				 
   		
		if (popUpFlag == "true") {
			opener.location.href = url_with_params;
		}
		else {
			self.location.href = url_with_params;
		}
		
	} 
												 
												 
	function OpenCenteredWindow(url, windowHeight, windowWidth) {

		var height    = "425";
		var width     = "390";

                if (windowHeight) {
                        height = windowHeight;                
                }       
                if (windowWidth) {
                        width = windowWidth;                
                }   
                
		var left      = Math.floor( (screen.width - width) / 2);
		var top       = Math.floor( (screen.height - height) / 2);
		var winParams = "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width + ",scrollbars,resizable";
		msgWindow     = window.open('','targetname',winParams);
		
		msgWindow.location.href = url;
		if (msgWindow.opener == null) msgWindow.opener = self;
		
	} 

