/*
$(document).ready(function(){
	$("#lbl_search").autocomplete('inc/search.inc.php',{
		minChars: 1, width:248,
		 extraParams: {
			gender: function() { return $("#gender").val(); }
		}
	});
});
*/
$(document).ready(function(){
	$("#lbl_brand").autocomplete('inc/search_brands.inc.php',{
		minChars: 1, width:138, autoFill: true, mustMatch: true
	});
	$("#lbl_brand").result(function(data) {		
		$("#lbl_brand").val(data[0]);		
		$("#hdn_brand").val(data[1]);	
	});	
});

function del_value(ID, color) {
	if(document.getElementById(ID).value==document.getElementById(ID).defaultValue){
		document.getElementById(ID).value='';
		document.getElementById(ID).style.color = color;
	}
}

function default_value(ID, color){	
	if(document.getElementById(ID).value==''){
		document.getElementById(ID).value = document.getElementById(ID).defaultValue;
		document.getElementById(ID).style.color = color;
	}
}

function reset_value(ID, color){	
		document.getElementById(ID).value = document.getElementById(ID).defaultValue;
		document.getElementById(ID).style.color = color;
}

function hide_box(box_id, show_link_id, hide_link_id){
	document.getElementById(box_id).style.display='none';
	document.getElementById(show_link_id).style.display='';
	document.getElementById(hide_link_id).style.display='none';
}

function show_box(box_id, show_link_id, hide_link_id){
	document.getElementById(box_id).style.display='';
	document.getElementById(show_link_id).style.display='';
	document.getElementById(hide_link_id).style.display='none';
}

function show(obj,hide){
	var el = document.getElementById(obj).style;
	document.getElementById(hide).style.display = 'none';
	if(el.display != 'none'){
	el.display = 'none';
	}
	else{
		el.display = 'block';
	}
}

function disable(id){
		var input_field = document.getElementById(id).value;
		if(input_field == 'Schuhsuche' || input_field == ''){
			document.getElementById('search_button').disabled=true;
		}
		else{
			document.getElementById('search_button').disabled=false;
		}
}

function refreshimage(){
	document.getElementById('captcha_image').src = document.getElementById('captcha_image').src + '#';
}

/*
function show_feedback(){
	document.getElementById('feedback_layer').style.display = '';
}*/

function hide_feedback(){
	document.getElementById('feedback_layer').style.display = 'none';
}
