function detectBrowser() {
	
	// CSS Browser Selector   v0.2.5
	// Documentation:         http://rafael.adm.br/css_browser_selector
	// License:               http://creativecommons.org/licenses/by/2.5/
	// Author:                Rafael Lima (http://rafael.adm.br)
	// Contributors:          http://rafael.adm.br/css_browser_selector#contributors

	var css_browser_selector = function() {
		var 
			ua=navigator.userAgent.toLowerCase(),
			is=function(t){ return ua.indexOf(t) != -1; },
			h=document.getElementsByTagName('html')[0],
			b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1)
				:is('gecko/')? 'gecko'
				:is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1
				:is('konqueror')?'konqueror'
				:is('applewebkit/')?'webkit safari'
				:is('mozilla/')?'gecko':'',
			os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':'';
		var c=b+os+' js';
		h.className += h.className?' '+c:c;
	}();	
}

detectBrowser();


//This function allow to load a media file in a div
function displayAnim(src,divId){
 	champs=src.split('.'); 
	
	codeAnim = '<div id="smphoneContent">';
		
	if (champs[1]=="swf"){
		fileName = champs[0];
		idAnim = "smPhoneAnim";
		animWidth = "163";
		animHeight= "307";
		/*codeAnim += "<script language='javascript'> if (AC_FL_RunContent == 0) { alert('This page requires AC_RunActiveContent.js.'); } ";
		codeAnim += "else { AC_FL_RunContent( 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','align', 'middle','play', 'true','loop', 'true','scale', 'showall','wmode', 'window','devicefont', 'false','menu', 'false','allowFullScreen', 'false','allowScriptAccess','sameDomain','salign', '','bgcolor', '#ffffff',";
		codeAnim += "'width','"+animWidth+"','height','"+animHeight+"','id','"+idAnim+"','name','"+idAnim+"','movie','"+fileName+"','src','"+fileName+"'); }</script></div>";*/		


		codeAnim += "<object width='"+animWidth+"' height='"+animHeight+"'><param name=movie value"+src+"'></param><param name=allowFullScreen value=true></param><embed src='"+src+"' type=application/x-shockwave-flash allowfullscreen=true width='"+animWidth+"' height='"+animHeight+"'></embed></object>";
						
	}else{
		codeAnim += "<img src='"+src+"' alt='' />";
		
	}
	
	codeAnim += "</div>";
	document.getElementById(divId).innerHTML = codeAnim;
	return false;	

}

function setActiveTab(tabName,idTab){
	var d = document.getElementById(tabName+idTab);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById(tabName+i)) {document.getElementById(tabName+i).className=''; }
	}
	if (d) {
		d.className='active'		
	}
}

function closeLightBox(divId){
	document.getElementById(divId).style.display="none";
	document.getElementById('lightBoxContent').innerHTML = '';
	
}

function openLightBox(content,width,height){
	
	document.getElementById('lightBoxContent').innerHTML = '<img src="'+content+'" />';
	//Optimization : Detect the type of content, and load it on the div (html page, image, etc.)
		
	halfHeight= height/2;
	halfWidth=width/2;
	
	document.getElementById('light').style.width=(width+16)+"px";
	document.getElementById('light').style.height=(height+16)+"px";
	document.getElementById('light').style.marginTop="-"+halfHeight+"px";
	document.getElementById('light').style.marginLeft="-"+halfWidth+"px";
	//document.getElementById('light').style.left=(document.documentElement.clientWidth/2)+"px";
	//document.getElementById('light').style.top=(document.documentElement.clientHeight/2)+"px";	
		
	document.getElementById('lightBox').style.width=document.documentElement.clientWidth+"px";
	document.getElementById('lightBox').style.height=document.documentElement.clientHeight+"px";
	document.getElementById('fade').style.width=document.documentElement.clientWidth+"px";
	document.getElementById('fade').style.height=document.documentElement.clientHeight+"px";	
	
	document.getElementById('lightBox').style.display="block";
	
}

function openClose(element){
	var status = "";
	status = document.getElementById(element+"Content").style.display;
	if (status != "block") {
		status = "block";
	}else{
		status = "none";
	}	
	document.getElementById(element+"Content").style.display = status;
}

