function gup(name)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
function jquery_CheckIfOutside(){
	if ($('#f_lieu').val() == 'outside'){
		$('#f_surface_ext').show();
    $('#f_surface').hide();
	}else{
		$('#f_surface').show();
		$('#f_surface_ext').hide();
	}
}
function jquery_showSwatchProject(id,action){
	$('.swatch_bigger').hide();
	if (action == 1){
		 $('#'+id+'_big').show();
	}
	if (action == 0){
		$('#'+id+'_big').hide();
	}
}

function jquery_assignHeader(highLighted){
	switch (highLighted){
		case 'inspiration':
			$('#menu_inspiration').attr({src:'img/menu/btn_inspi_on.png'});
		break;
		case 'product':
			$('#menu_product').attr({src:'img/menu/btn_product_on.png'});
		break;
		case 'help':
			$('#menu_help').attr({src:'img/menu/btn_help_on.png'});
		break;
		case 'project':
			$('#menu_project').attr({src:'img/menu/btn_project_on.png'});
		break;
	}

}
function jquery_removeHeader(highLighted){
  switch (highLighted){
    case 'inspiration':
      $('#menu_inspiration').attr({src:'img/menu/btn_inspi_on.png'});
    break;
    case 'product':
      $('#menu_product').attr({src:'img/menu/btn_product_on.png'});
    break;
    case 'help':
      $('#menu_help').attr({src:'img/menu/btn_help_off2.png'});
    break;
    case 'project':
      $('#menu_project').attr({src:'img/menu/btn_project_on.png'});
    break;
  }

}
function jquery_rollover(item,rollover){
	$("#"+item).attr({src:'images/'+rollover});
	//jquery_assignHeader(highLighted);
	
}
function jquery_change_page(newPages){
	window.location.href=newPages;
}
function jquery_showSubject(id,extraline){
	var str_br = '';
	if (extraline > 0){
		for (x=0;x<extraline;x++){
			str_br += "<br/>";
		}
	}
	$('#spacer').html(str_br);
	$('.answer').hide();
	$('#answer').show();
	$('#'+id).show();
}
function jquery_show_product(imgsrc,name){
	$('#jquery_product_image').attr({src:'images/product/'+imgsrc});
	$('#jquery_product_name').html(name);
	$('#jquery_div_product').show();
}
function jquery_showSearchResult(){
	var term1=$('#f_lieu').val();
	var counter=0;
	if ($('#f_lieu').val() == 'outside') {
    var term2 = $('#f_surface_ext').val();
  }
  else {
  	var term2 = $('#f_surface').val();
  }
	var term3=$('#f_aspect').val();
	
	$('.searchResult').each(function(i){
		if (($(this).hasClass(term1)) && ($(this).hasClass(term2)) && ($(this).hasClass(term3))){
			$(this).show();
			counter += 1;
		}else{
			$(this).hide();
		}  
  });
	if (counter == 0){
		$('#noResult').show();
		$('.lapeyrePromo').hide();
	}else{
		$('#noResult').hide();
		if (term1 == 'kitchen'){
			$('.lapeyrePromo').show();
		}else{
			$('.lapeyrePromo').hide();
		}
	}

}
function jquery_goSearchProduct(){
	var term1=$('#f_lieu').val();
  if ($('#f_lieu').val() == 'outside') {
    var term2 = $('#f_surface_ext').val();
  }
  else {
    var term2 = $('#f_surface').val();
  }
  var term3=$('#f_aspect').val();
	href="produit_recherche.html?t1="+term1+"&t2="+term2+"&t3="+term3;
	window.location.href=href;
}
function jquery_showTips(tip){
	$('.tips').each(function(i){
		$(this).hide();
	});
	$('#'+tip).show();
}
function jquery_searchShop(){
	var codepostal = $('#searchShop').val();
	href="aide_et_conseils_points_de_vente.html?cp="+codepostal;
	window.location.href = href;
}
function jquery_showPack(id){
	$('.viewPack').hide();
	
	$('#'+id).show();
}
function jquery_kaleidoscopeOver(){
	$('#kaleidoscope_text_over').show();
}
function jquery_kaleidoscopeOut(){
	$('#kaleidoscope_text_over').hide();
}
function jquery_filmOver(){
  $('#film_text_over').show();
}
function jquery_filmOut(){
  $('#film_text_over').hide();
}
function jquery_homepageImgRightTopOver(){
  $('#homepage_img_right_top_text_over').show();
}
function jquery_homepageImgRightTopOut(){
	$('#homepage_img_right_top_text_over').hide();
}



