/* FAQAGENT */

// to make the search box text dissapear onFocus of cursor
var active_color = '#000'; // Colour of user provided text
var inactive_color = '#999'; // Colour of default text	

// either primary nav version, or contact us page version
var answerSuggestContainer = "";
	
$(function() {	
						   
	$("input#searchtextPrimary").css("color", inactive_color);
	var searchtext = new Array();
	
	$("input#searchtextPrimary").focus(function() {
		answerSuggestContainer = "fa_autosuggest_primary";
										 
		if (!searchtext[this.id]) {
			searchtext[this.id] = this.value;
		}
		if (this.value == searchtext[this.id]) {
			this.value = '';
			this.style.color = active_color;
		}
		
		$(this).blur(function() {
			if (this.value == '') {
				this.style.color = inactive_color;
				this.value = searchtext[this.id];
			}
		});
	});
	
});	

$(function() {
		   
	$("input#searchtextSecondary").css("color", inactive_color);
	var searchtext2 = new Array();
	
	$("input#searchtextSecondary").focus(function() {
		answerSuggestContainer = "fa_autosuggest_secondary";								  
										  
		if (!searchtext2[this.id]) {
			searchtext2[this.id] = this.value;
		}
		if (this.value == searchtext2[this.id]) {
			this.value = '';
			this.style.color = active_color;
		}
		$(this).blur(function() {
			if (this.value == '') {
				this.style.color = inactive_color;
				this.value = searchtext2[this.id];
			}
		});
	});

});

// HOMEPAGE FAQ BUTTON - IN CONTENT

$(function() {
		   
	$('.faqHomepageLinkLaunch').click(function() {
		window.open('http://chelsea.faq-help.com/index.html','FaqtAgent','top=150,width=886,height=668,scrollbars=no,menubar=no,toolbar=no,resizable=no');
	});
	
});


// FORMS

function faqtagentPrimary()
{
var search = document.getElementById("searchtextPrimary").value;
var path = "http://chelsea.faq-help.com/index.html?search=" + search;
window.open(path,'FaqtAgent','top=150,width=886,height=668,scrollbars=no,menubar=no,toolbar=no,resizable=no');
return true;
}

function faqtagentSecondary()
{
var search2 = document.getElementById("searchtextSecondary").value;
var path2 = "http://chelsea.faq-help.com/index.html?search=" + search2;
window.open(path2,'FaqtAgent','top=150,width=886,height=668,scrollbars=no,menubar=no,toolbar=no,resizable=no');
return true;
}



