// if (navigator.geolocation) {
// 	navigator.geolocation.getCurrentPosition(function(position) {
// 		callback(position.coords.latitude, position.coords.longitude);
// 		alert(position.coords.latitude, position.coords.longitude);
// 	});
// } else {
// 	alert("Geolocation services are not supported by your browser.");
// } 

function setCookie(c_name,value,expiredays) {
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie = c_name+ "=" +escape(value) + ((expiredays==null) ? "" : "; expires="+exdate.toGMTString()) + "; path=/; domain=."+escape("legrandecran.ca");
}
function getCookie(c_name) {
	if (document.cookie.length>0) {
		c_start=document.cookie.indexOf(c_name);
			if (c_start!=-1) { 
				c_start=c_start + c_name.length+1; 
				c_end=document.cookie.indexOf(";",c_start);
				if (c_end==-1) c_end=document.cookie.length;
				return unescape(document.cookie.substring(c_start,c_end));
			} 
		}
	return "";
}
function confirmAction() {
	var confirmCheck = confirm("Voulez-vous accéder à la version optimisé pour le iPhone/iPod Touch?");
	if(confirmCheck==true) {
		setCookie("iphoneVersion","on",365);
		return;
	} else {
		setCookie("iphoneVersion","off",365);
		window.location = "http://www.legrandecran.ca/";
	}
}

function alertVersion() {
	if(getCookie("iphoneVersion")!="on") {
		setTimeout("confirmAction();",500);
	}
}

function iPhoneVersionOff() {
	setCookie("iphoneVersion","off",365);
	window.location = "http://www.legrandecran.ca/";
}

window.addEvents({
	'domready': function() {
		var LeQueb = new LeQueb_iui();
		//alertVersion();
	},
	'load': function() {
		// Ajouter les background-color du rating
		$$('.ratingStarsWrap .starsAndBgWrap').setStyle('background','#999999');
		$$('.ratingStarsWrap .starsAndBgWrap .starsBg').setStyle('background','#b23130');
	}
});

