
// SELECTOR VARS
var i_am_id = -1;
var i_have_id = -1;
var i_want_id = -1;

$(document).ready(function(){ 	
	$('div.block').hover(
		function () {	$('div', this).show();	}, 	
		function () {	$('div', this).hide();	}			
	);							   
});

/* Selector */
function check_match()	{
	if(i_am_id < 0 && i_have_id < 0 && i_want_id < 0)	{
		$("#main_solutions").hide();
		$("#main_content").show();
		$("#main_solutions").html('');
	} else	{
		var args = new Array();
		sendAjaxCall(rootUrl+'solutions/home_select/'+i_am_id+'/'+i_want_id+'/'+i_have_id, args, return_check, true, 'txt');				
	}
}

function return_check(r)	{
	$("#main_content").hide();
	$("#main_solutions").show();
	$("#main_solutions").html(r);
}

function set_choice(type, id, obj)	{
	$('#' + type + '_sol').hide();
	switch(type)	{	
		case "am":		i_am_id = id;	break;
		case "have":	i_have_id = id;	break;
		case "want":	i_want_id = id;	break;
	}
	check_match();
}

