//jQuery("head").append("<link type=\"text/css\" rel=\"stylesheet\" href=\"/css/common/js.css\" media=\"screen\" />");
document.write("<link type=\"text/css\" rel=\"stylesheet\" href=\"/css/common/js.css\" media=\"screen\" />");
// function tag Google Analytics/weborama/...
function sendTag(Action,Name,Type) {
	try {
		switch(Type) {
			case	"stats_weborama" :
				try {
					jQuery('#stats_weborama').remove();
					jQuery('body').append('<img id="stats_weborama" src="'+Name+'" border="0" width="1" height="1" alt="" />');					
				} catch(exc) {
					//…
				}
				break;
			default:
			case	"stats_google" :
				switch(Action) {
					case	"event" :
						pageTracker._trackEvent("click", Name);
						break;
					default:
					case	"page" :
						pageTracker._trackPage(Name);
						break;
				}
				break;
		}		
	} catch(exc) {
		//…
	}
}
function thisMovie(movieName) {
     if (navigator.appName.indexOf("Microsoft") != -1) {
         return window[movieName];
     } else {
         return document[movieName];
     }
 }

function callFAQ(){
	callSection('faq');		
	return false;
}
function callSection(section){
	// callSection js to SWF
	thisMovie("flashcontent").callSection(section);
	return false;
}
function shareVideoFB(id,title){
	console.log('id :: '+id+' title :: '+title);
	var domainName 	= '1erage.mixa.fr';
	var url 		= 'http://'+domainName+'/video/'+id;
	title			= '1er âge, 1ers rires : '+ title;
	window.open('http://www.facebook.com/sharer.php?u=' +encodeURIComponent(url)+'&t='+ encodeURIComponent(title),'sharer','toolbar=0,status=0,width=626,height=436'); 
	return false;
}
function popit(type,page,largeur,hauteur,popupname){
	if(!popupname || popupname ==''){
		popupname = "pop_up"
	}
	var top		= (screen.height-hauteur)/2;
	var left	= (screen.width-largeur)/2;
	switch(type){
		case 1 :
			var fenetre = window.open(page,popupname,"top="+top+",left="+left+",width="+largeur+", height="+hauteur+",resizable=yes,scrollbars=yes");
			break;
		case 2 :
			var fenetre = window.open(page,popupname+Math.round((Math.random()*10000000000000)),"top="+top+",left="+left+",width="+largeur+", height="+hauteur+",scrollbars=yes,status=yes,toolbar=yes,resizable=yes,menubar=yes,location=yes");
			break;
		case 3 :
			var fenetre = window.open(page,popupname+Math.round((Math.random()*10000000000000)),"top="+top+",left="+left+",width="+largeur+", height="+hauteur+",scrollbars=no,status=no,toolbar=no,resizable=no,menubar=no,location=no");
			break;
		case 4 :
			var fenetre = window.open(page,popupname+Math.round((Math.random()*10000000000000)),"top="+top+",left="+left+",width="+largeur+", height="+hauteur+",scrollbars=yes,status=no,toolbar=no,resizable=yes,menubar=no,location=no");
			break;
		case 5 :
			var fenetre = window.open(page,popupname+Math.round((Math.random()*10000000000000)),"top="+top+",left="+left+",width="+largeur+", height="+hauteur+",resizable=yes,scrollbars=yes");
			break;
		case 0:
		default :
			var fenetre = window.open(page,popupname+Math.round((Math.random()*10000000000000)),"top=0,left=0,width="+screen.width+", height="+screen.height+",scrollbars=yes,status=yes,toolbar=yes,resizable=yes,menubar=yes,location=yes");
			break;
	}
	fenetre.focus();
}

// Functions for FLASH SWF
function popupCredits(){
	popit(3,'/credits.html',500,402,'');
	return false;
}
function externalUrl(url){
	document.location=url;
}
function popitGamme(url){
	document.location=url;
}
