function setNextClick(redirect_link, simpleSearchResultId,next_click_position){
	$.ajax({
	  	type: "get",
		url: "../ajaxCom/ajaxProxy.cfc",
		data: {
		method: "doSaveNextClick",
		redirect_link: redirect_link,
		simpleSearchResultId: simpleSearchResultId,
		next_click_position:next_click_position
		},
		dataType: "json",
		success: function(){document.location.href=redirect_link;},
		error: function(){document.location.href=redirect_link;}
		});	
		return false;
}

function searchFeedbackResponseForm(){
	
	$('#frmSearchFeedback').hide();
	$('#feedback_thankyou').show();
	$.ajax({
	  	type: "get",
		url: "../ajaxCom/ajaxProxy.cfc",
		data: {
		method: "notifyPartnersSearchFeedback",
		feedbackComments: $('#feedbackComments').val(),
		positiveFeedback: $('#positiveFeedback').val()
		},
		dataType: "json",
		success: function(){return true;},
		error: function(){return true;}
		});	
		
		return false;
}

$(function(){
	//all hover and click logic for buttons
	$(".fg-button:not(.ui-state-disabled)")
	.hover(
		function(){ 
			$(this).addClass("ui-state-hover"); 
		},
		function(){ 
			$(this).removeClass("ui-state-hover"); 
		}
	)
	.mousedown(function(){
			$(this).parents('.fg-buttonset-single:first').find(".fg-button.ui-state-active").removeClass("ui-state-active");
			if( $(this).is('.ui-state-active.fg-button-toggleable, .fg-buttonset-multi .ui-state-active') ){ $(this).removeClass("ui-state-active"); }
			else { $(this).addClass("ui-state-active"); }	
	})
	.mouseup(function(){
		if(! $(this).is('.fg-button-toggleable, .fg-buttonset-single .fg-button,  .fg-buttonset-multi .fg-button') ){
			$(this).removeClass("ui-state-active");
		}
	});
});

function popUpWindow(windowWidth,windowHeight){
var xPos = ((screen.width - windowWidth) / 2);
var yPos = ((screen.height - windowHeight) / 2);
var windowProps = "height=" + windowHeight + ",width=" + windowWidth + ",top=" + yPos + ",left=" + xPos;
thePopUpWindow = window.open("","thePopUpWindow",windowProps + ",scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no");
thePopUpWindow.focus();
}

function toggleRefineSearch(){
	$('#refine_search').slideToggle('slow');
	$("#refine").toggleClass("closeArrow");
	$("#refine").toggleClass("openArrow");
}

