


$(document).ready(function() {

	$("#QuestForm").submit(function() {
		$("#QuestLoader").show() ;
		url = $(this).find("input[name=url]").val() ;
		email = $(this).find("input[name=email]").val() ;
		message = $(this).find("textarea[name=message]").val() ;

		$.post("quest.inc.php", {email: email, message: message, url: url}, function(data) {
			$("#QuestLoader").hide() ;
			if(data !="ok") {
				$("#QuestLoader").hide() ;
				$("#QuestError").empty().html(data).slideDown() ;
			}
			else {
				$("#QuestError").slideUp() ;
				$("#Questionnaire").fadeOut() ;
				$("#QuestMerci").hide().html("<img src=\"http://www.guitarnblues.fr/img/confirm.png\" width=48 height=48 border=0 style=\"vertical-align:middle;display:inline;padding:1px;\"> <b>Confirmation !!</b><br>Votre participation est bien enregistrée</b> merci d'\avoir joué!").slideDown();
			}	
		}) ;

		return false ;
	});



	$("#FormAvis").submit(function() {
		$("#AvisLoader").show() ;
		id = $(this).find("input[name=id]").val() ;
		page = $(this).find("input[name=page]").val() ;
		pseudo = $(this).find("input[name=pseudo]").val() ;
		email = $(this).find("input[name=email]").val() ;
		note = $(this).find('input:radio[name=note]:checked').val() ;
		message = $(this).find("textarea[name=message]").val() ;

		$.post("avis.inc.php", {pseudo:pseudo, page:page, email: email, note: note, message: message, id: id}, function(data) {
			$("#loader").hide() ;
			if(data !="ok") {
				$("#AvisLoader").hide() ;
				$("#AvisError").empty().append(data).fadeIn() ;
			}
			else {
				$("#AvisError").fadeOut() ;
				$("#FormulaireAvis").fadeOut() ;

				$("#AvisMerci").hide().html("<div class=\"avisRemercie\"><b>Nous vous remercions de votre contribution</b><br>Votre avis sera visible par les clients après validation.<br><br>L'équipe GNB</div>").slideDown();
			}	
		}) ;
		return false ;
	});

});

$(document).ready(function(){
	starRating.create('.stars');
});

// The widget
var starRating = {
	create: function(selector) {
		// loop over every element matching the selector
		$(selector).each(function() {
			var $list = $('<div></div>');
			// loop over every radio button in each container
			$(this)
			.find('input:radio')
			.each(function(i) {
				var rating = $(this).parent().text();
				var $item = $('<a href="#"></a>')
				.attr('title', rating)
				.addClass(i % 2 == 1 ? 'rating-right' : '')
				.text(rating);

				starRating.addHandlers($item);
				$list.append($item);

				if($(this).is(':checked')) {
					$item.prevAll().andSelf().addClass('rating');
				}
			});
			// Hide the original radio buttons
			$(this).append($list).find('label').hide();
		});
	},
	addHandlers: function(item) {
		$(item).click(function(e) {
			// Handle Star click
			var $star = $(this);
			var $allLinks = $(this).parent();

			// Set the radio button value
			$allLinks
			.parent()
			.find('input:radio[value=' + $star.text() + ']')
			.attr('checked', true);

			// Set the ratings
			$allLinks.children().removeClass('rating');
			$star.prevAll().andSelf().addClass('rating');

			// prevent default link click
			e.preventDefault();

		}).hover(function() {
			// Handle star mouse over
			$(this).prevAll().andSelf().addClass('rating-over');
		}, function() {
			// Handle star mouse out
			$(this).siblings().andSelf().removeClass('rating-over')
		});    
	}
}


function Confirm(url, msg){
	ans=window.confirm(''+msg+'');
	if(ans) window.location.replace(url);
}
function surligner(obj, couleur){
	obj.style.backgroundColor= couleur;
}
function desurligner(obj, couleur){
	obj.style.backgroundColor= couleur;
}
function desurlignerVide(obj){
	obj.style.backgroundColor= "";
}


function funcPopup2(varUrl,varWidth,varHeight)	{
	WinPopUp = window.open (varUrl, "PopUp", "height="+varHeight+", width="+varWidth+", toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");
	WinPopUp.focus();
	var ScreenW = screen.availWidth;
	var ScreenH = screen.availHeight;
	WinPopUp.moveTo((ScreenW-varWidth)/2, (ScreenH-varHeight)/2);
}



<!--
function SourisOff() { //v3.0
  var i,x,a=document.source; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function changement(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=changement(n,d.layers[i].document); return x;
}

function SourisOn() { //v3.0
  var i,j=0,x,a=SourisOn.arguments; document.source=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=changement(a[i]))!=null){document.source[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->



var IB=new Object;
var posX=0;posY=0;
var xOffset=10;yOffset=18; 
function infoBulleV1(texte) {
	contenu="<div class='bulle'>"+texte+"</div>";
	var finalPosX=posX-xOffset;
	if (finalPosX<0) finalPosX=0;
	if (document.layers) {
		document.layers["bulle"].document.write(contenu);
		document.layers["bulle"].document.close();
		document.layers["bulle"].top=posY+yOffset;
		document.layers["bulle"].left=finalPosX;
		document.layers["bulle"].visibility="show";
	}
	if (document.all) {
		bulle.innerHTML=contenu;
		document.all["bulle"].style.top=posY+yOffset;
		document.all["bulle"].style.left=finalPosX;
		document.all["bulle"].style.visibility="visible";
	}
	else if (document.getElementById) {
		document.getElementById("bulle").innerHTML=contenu;
		document.getElementById("bulle").style.top=posY+yOffset;
		document.getElementById("bulle").style.left=finalPosX;
		document.getElementById("bulle").style.visibility="visible";
	}
}
function getMousePos(e) {
	if (document.all) {
		posX=event.x+document.body.scrollLeft;
		posY=event.y+document.body.scrollTop;
	}
	else {
		posX=e.pageX;
		posY=e.pageY;
	}
}
function infoBulleCacheV1() {
	if (document.layers) {
		document.layers["bulle"].visibility="hide";
	}
	if (document.all) {
		document.all["bulle"].style.visibility="hidden";
	}
	else if (document.getElementById) {
		document.getElementById("bulle").style.visibility="hidden";
	}
}

function InitBulle(ColTexte,ColFond,ColContour,NbPixel) {
	IB.ColTexte=ColTexte;IB.ColFond=ColFond;IB.ColContour=ColContour;IB.NbPixel=NbPixel;
	if (document.layers) {
		window.captureEvents(Event.MOUSEMOVE);window.onMouseMove=getMousePos;
		document.write("<LAYER name='bulle' top=0 left=0 visibility='hide'></LAYER>");
	}
	if (document.all) {
		document.write("<div id='bulle' style='position:absolute;top:0;left:0;visibility:hidden'></div>");
		document.onmousemove=getMousePos;
	}
	else if (document.getElementById) {
		document.onmousemove=getMousePos;
		document.write("<div id='bulle' style='position:absolute;top:0;left:0;visibility:hidden'></div>");
	}
}
InitBulle("#000000","#ddedba","#000000",1);



var spanModes = new Object();
	
function registerSpan(id){
	spanModes[id] = false;
}

function AfficheTxt(id, NomImg){
	var mode = spanModes[id];	
	
	if(mode==null) { mode = false; }
	
	mode = !mode;
	
	spanModes[id] = mode;
	
	var title = 'Hide';
	var display = 'inline';
	var img = NomImg + '.jpg'  ;
	
	if(!mode) {
		title = 'Show';
		display = 'none';
		img = NomImg + '_noir.jpg'  ;
	}
	
	var titleSpan = document.getElementById(id + 'Title');
	var imgSpan = document.getElementById(id + 'Img');
	
	if(titleSpan!=null)	{
		titleSpan.innerText = title;
	}
	
	if(imgSpan!=null) {
		imgSpan.src = '/img/' + img + '';
	}
		
	document.getElementById(id + 'Span').style.display = display;		
}

function RechargePage(init) { 
	if (init==true) with (navigator) {
		if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=RechargePage; 
		}
	}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
RechargePage(true);

function RechercheObj(n, d) { 
	var p,i,x;
	if(!d) d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n];
	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=RechercheObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function AfficherMarqueCalque() { //v6.0
	var i,p,v,obj,args=AfficherMarqueCalque.arguments;
	for (i=0; i<(args.length-2); i+=3)
		if ((obj=RechercheObj(args[i]))!=null) {
			v=args[i+2];
			if (obj.style) {
			obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
		}
		obj.visibility=v;
	}
}

function ChangeUrl(panier) {
	if (panier.pays_livraison_auto.selectedIndex != 0) {
		location.href = panier.pays_livraison_auto.options[panier.pays_livraison_auto.selectedIndex].value;
	}
	else {
		alert('Selectionnez votre pays...');
	}
}

function changeto(highlightcolor){
	source=event.srcElement
	if (source.tagname=="TR"||source.tagname=="TABLE")
	return
	while(source.tagName!="TR")
	source=source.parentElement
	if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
	source.style.backgroundColor=highlightcolor
}

function changeback(originalcolor){
	if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
	return
	if (event.toElement!=source)
	source.style.backgroundColor=originalcolor
}

