
function DoSearchHitEnter(event, txtsearch) {
	if (document.all) {
		if(event.keyCode==13) {
			event.returnValue=false;
			event.cancel = true;
			DoSearch(txtsearch);
		}
	}
	else if (document.getElementById) {
  		if (event.which == 13) {
  			event.returnValue=false;
   			event.cancel = true;
   			DoSearch(txtsearch);
		}
	}
	else if(document.layers) {
		if(event.which == 13) {
			event.returnValue=false;
			event.cancel = true;
			DoSearch(txtsearch);
		}
	}			
}

//Search Site or Recipes based on rblType
function DoSearch(txtsearch) {
	//go through rbltype radio button list and set searchtype = checked value
	//for( i = 0; i < rbltype.length; i++ ) {
	//	if( rbltype[i].checked == true )
	//		searchtype = rbltype[i].value;
	//}
	if(document.getElementById("recipes").checked) {
		searchtype = "recipes";
	} else {	
		searchtype = "site";
	}
	//depending on searchtype set url
	if (searchtype == "recipes") {
		window.location.href = "/members/foodandrecipes/recipes/search.aspx?Search=" + txtsearch;
	} else {
		window.location.href = "/members/search.aspx?q=" + txtsearch;
	}
	//redirect to right search page
	url = "";
	txtsearch = "";
}

//Search Recipes
function DoSearchRecipes(txtsearch, cbfavorite, cbquick) {
	var url = "/members/tools/recipes/search.aspx?Search=";
	url += txtsearch.value;
	if(cbfavorite.checked == true)
		url += "&showfavoritesonly=true";
	if(cbquick.checked == true)
		url += "&showvaluedatas=quick";
	//redirect to right search page
	document.location.href = url;
}

//MY PROGRESS SLIDER
var toggleSection = function(obj) {
	theState = $(obj+"Div").className;
	theHeight = document.all ? $(obj+"Div").offsetHeight : $(obj+"Div").clientHeight;
	if (theState == "expanded") {
		sectionT = new Tween($(obj+"WrapperDiv").style,'height',Tween.strongEaseOut,theHeight,0,.5,'px');
		$(obj+"Div").className = "";
		if ($(obj+"Text")) {$(obj+"Text").innerHTML = 
		    "<img src=\"/images/members/myprogress/myprogress-open.gif\"width=\"10\" height=\"10\" alt=\"\" border=\"0\" align=\"absmiddle\" hspace=\"4\">";
		}
	} else {
		sectionT = new Tween($(obj+"WrapperDiv").style,'height',Tween.strongEaseOut,1,theHeight,.5,'px');
		$(obj+"Div").className = "expanded";
		if ($(obj+"Text")) {$(obj+"Text").innerHTML = 
		    "<img src=\"/images/members/myprogress/myprogress-close.gif\"width=\"10\" height=\"10\" alt=\"\" border=\"0\" align=\"absmiddle\" hspace=\"4\">";
		
		}
	}
	sectionT.start();
}