// ________________________________________________________
// Get query string
function __getQueryString(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 decodeURIComponent(results[1].replace(/\+/g, " "));
	}
}

// ________________________________________________________
// Init
function __init(){
	// External link
	$("a[rel*='external']").click(function(){
		this.target = "_blank";
	});
	
	// Lightbox
	if($(".lightbox").length > 0){
		$(".lightbox").colorbox();
	}
	
	// Form contact
	$("p.btn-send a").click(function(e){
		$("form:last").submit();
		
		return false;
	});
}

$(document).ready(function(){
	$.browser.msie6 = $.browser.msie && /MSIE 6\.0/i.test(window.navigator.userAgent) && !/MSIE 7\.0/i.test(window.navigator.userAgent);
	$.lang = window.location.href.indexOf("/en/") > 0 ? "en" : "fr";
	
	__init();
});
