// ** Browser detection

var ss_detect = navigator.userAgent.toLowerCase();
var ss_OS,ss_browser,ss_total,ss_thestring;
var ss_version = 0;

if (checkIt('konqueror'))
{
	ss_browser = "Konqueror";
	ss_OS = "Linux";
}
else if (checkIt('omniweb')) ss_browser = "OmniWeb"
else if (checkIt('opera')) ss_browser = "Opera"
else if (checkIt('webtv')) ss_browser = "WebTV";
else if (checkIt('icab')) ss_browser = "iCab"
else if (checkIt('msie')) ss_browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	ss_browser = "Netscape Navigator"
	ss_version = ss_detect.charAt(8);
}
else ss_browser = "An unknown browser";

if (!ss_version) ss_version = ss_detect.charAt(place + ss_thestring.length);

if (!ss_OS)
{
	if (checkIt('linux')) ss_OS = "Linux";
	else if (checkIt('x11')) ss_OS = "Unix";
	else if (checkIt('mac')) ss_OS = "Mac"
	else if (checkIt('win')) ss_OS = "Windows"
	else ss_OS = "an unknown operating system";
}


function checkIt(string)
{
	place = ss_detect.indexOf(string) + 1;
	ss_thestring = string;
	return place;
}




// ** Select proper stylesheets dependin on browser detected

function choosestyle()
{
if (ss_browser == "Internet Explorer")
{
	document.write('<LINK rel="stylesheet" href="/commun/stylesheets/ie1.css" type="text/css">');
}
else if (ss_browser == "Netscape Navigator")
{
	document.write('<LINK rel="stylesheet" href="/commun/stylesheets/ns1.css" type="text/css">');
}
else
{
	document.write('<LINK rel="stylesheet" href="/commun/stylesheets/default1.css" type="text/css">');
}
}


// **<a onfocus="this.blur()" onclick="popWin(this.href,'popupwin','600','440','1center','no','no','no','no','no','no','no');return false" href="/test/popup/projets/chute_caron1.htm">
var win=null;
function popWin(url,popname,w,h,pos,scrl,loc,dir,sts,mb,tbr,rsz){
	if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!="center" && pos!="random") || pos==null){LeftPosition=10;TopPosition=10}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrl+',location='+loc+',directories='+dir+',status='+sts+',menubar='+mb+',toolbar='+tbr+',resizable='+rsz+'';
	win=window.open(url,popname,settings);
}


// ** name the opener window
// ** place in link 'onclick'  or <script language="JavaScript">thisWindowName('contact');</script>

function thisWindowName(name) {  
	if (document.images)
  	self.name = name;
}