<!--



var isdynamic = true;
function open_link(contenttype, object, language){
	s= window.location.href;
	if (isdynamic) {
		page = "index.cfm?contentid=" + object + "&language=" + language + "&rd=" + Math.random();
	} else {
		page = "/" + language + "/" + object + '.html'
	}
	document.location.href = page;
}

function cms_link(site ,contenttype, object, language){
	page = "/" + site + "/index.cfm?contentid=" + object + "&language=" + language + "&rd=" + Math.random();
	document.location.href = page;
}

function open_popup(page){
	page = page + "&rd=" + Math.random();
	window.open (page, 'adminConsole', 'left=300,top=5,width=700,height=680,scrollbars=yes,resizable=0,status=0,menubar=0,directories=0');
}

function open_popup_michelin(page){
	page = page + "&rd=" + Math.random();
	window.open (page, 'adminConsole', 'left=300,top=5,width=1100,height=550,scrollbars=yes,resizable=0,status=0,menubar=0,directories=0');
}

function open_popup2(page,l,h){
	window.open (page, 'pop', 'left=200,top=20,width='+l+',height='+h+',scrollbars=yes,resizable=0,status=no,menubar=no,directories=no');
}
function open_pictman2(page){
	page = page + "&rd=" + Math.random();
	window.open (page, 'adminPictures', 'left=300,top=10,width=650,height=450,scrollbars=yes,resizable=0,status=yes,menubar=no,directories=np');
}
function open_pictman(page){
	page = page + "&rd=" + Math.random();
	window.open (page, 'adminPictures', 'left=300,top=10,width=650,height=450,scrollbars=no,resizable=0,status=yes,menubar=no,directories=np');
}

function gotoAnchor(anchorname) {
	document.location.hash = anchorname;
	void(0);
}
function confirm_action (page){
	if (confirm("Are you sure you want to do this ?")) {
		page = page + "&rd=" + Math.random();
		open_popup (page, 'adminConsole', 'left=300,top=10,width=700,height=300,scrollbars=yes,resizable=1,status=no,menubar=no,directories=np');
		return false;}
	else {
		return false;
	}
}

function setCookie(name, value, expire) 
{   
    document.cookie = name + "=" + escape(value)   + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}

function saveLanguage(name) 
{
    var today = new Date();
    var expires = new Date();
    expires.setFullYear(today.getFullYear() + 1);
    setCookie("somfy", name, expires);
}
function getURLFromPOPUP(page){
		top.opener.location.href=page;
		return false;
	}

function getCookie(Name)
{
    var search = Name + "=";
    if (document.cookie.length > 0)
    { // if there are any cookies
        offset = document.cookie.indexOf(search);
        if (offset != -1)
        { // if cookie exists
            offset += search.length;
            // set index of beginning of value
            end = document.cookie.indexOf(";", offset);
            // set index of end of cookie value
            if (end == -1)
            {
                end = document.cookie.length;
            }
	    return unescape(document.cookie.substring(offset, end));
	}
    }
}


function popUp(url)
{ 
    sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
    self.name = "mainWin";
}


var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1);

function printThisPage() {
   	window.open(document.location.href+"&print=1","Print",'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=0,width=600,height=600');
    }
function printCatPage() {
   	window.open(document.location.href+"&print=1","Print",'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=0,width=615,height=600');
    }
		
function printThisPage2() {
   	window.open(document.location.href+"&print=1","Print",'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=0,width=650,height=600');
    }	

function printThis() {
  if (pr) { // NS4, IE5
    window.print();
  } else if (da && !mac) { // IE4 (Windows)
    vbPrintPage();
  } else { // other browsers
    alert("Sorry, your browser doesn't support this feature.");
  }
}

function pictPopupOld(img,w,h,title) 
	{
		if('undefined'.indexOf(title) == 0){
			titre="SOMFY";
		}else{
			titre="SOMFY : "+title;
		}
		if('undefined'.indexOf(w) == 0){
			tw="100";
		}else{
			tw=w;
		}
		if('undefined'.indexOf(h) == 0){
			th="100";
		}else{
			th=h;
		}
		// window.moveTo((screen.width-w)/2,(screen.height-h)/2) ;
		w=open('','image','width='+tw+',height='+th+',toolbar=no,scrollbars=no,resizable=yes');
		w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
		w.document.write("<SCRIPT language=javascript>function checksize()  { var w = document.images[0].width + 12 ; var h = document.images[0].height + 30 ; if (document.images[0].complete) {  window.resizeTo(w,h) ;  window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>");
		w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
		w.document.write("");
		w.document.write("</BODY></HTML>");
		w.document.close();
	}

	function pictPopup(img,w,h,title) 
	{
		if('undefined'.indexOf(title) == 0){
			titre="SOMFY";
		}else{
			titre="SOMFY : "+title;
		}
		if('undefined'.indexOf(w) == 0){
			tw="100";
		}else{
			tw=w;
		}
		if('undefined'.indexOf(h) == 0){
			th="100";
		}else{
			th=h;
		}
		
		w=open('','image','width='+tw+',height='+th+',toolbar=no,scrollbars=no,resizable=yes');
		w.document.write("<HTML>\n<HEAD><TITLE>"+titre+"</TITLE></HEAD>\n");
		
		w.document.write("<SCRIPT language=javascript>\n	var NS = (navigator.appName==\"Netscape\")?true:false;\n");
/*
		w.document.write("\n	function fitPic() {");
		w.document.write("\n		iWidth = (NS)?window.innerWidth:document.body.clientWidth;");
		w.document.write("\n		iHeight = (NS)?window.innerHeight:document.body.clientHeight;");
		w.document.write("\n		if(document.images[0].width > iWidth){ ");
		w.document.write("\n			document.images[0].height = (document.images[0].height * iWidth / document.images[0].width);");
		w.document.write("\n			document.images[0].width = iWidth;");
		w.document.write("\n		}");
		w.document.write("\n		if(document.images[0].height > iHeight){ ");
		w.document.write("\n			document.images[0].width = (document.images[0].width * iHeight / document.images[0].height);");
		w.document.write("\n			document.images[0].height =  iHeight ;");			
		w.document.write("\n		}");
		w.document.write("\n		iWidth = document.images[0].width - iWidth;");
		w.document.write("\n		iHeight = document.images[0].height - iHeight;");
		w.document.write("\n		window.resizeBy(iWidth, iHeight-1);");
		w.document.write("\n		self.focus();");*/
		w.document.write("\n		function fitPic() {");
		w.document.write("\n				iWidth = (NS)?window.innerWidth:document.body.clientWidth;");
		w.document.write("\n				iHeight = (NS)?window.innerHeight:document.body.clientHeight;");
		w.document.write("\n				iWidth = document.images[0].width - iWidth;");
		w.document.write("\n				iHeight = document.images[0].height - iHeight;");
		w.document.write("\n				//document.body.style.overflow='hidden';");
		w.document.write("\n				window.resizeBy(iWidth, iHeight-1);");
		w.document.write("\n				self.focus();");
		w.document.write("\n			};");
		w.document.write("\n	};\n</SCRIPT>");
		w.document.write("\n\n<BODY onload=\"fitPic();\" leftMargin=\"0\" topMargin=\"0\" marginwidth=\"0\" marginheight=\"0\">");
		w.document.write("\n<IMG src='"+img+"' border=0>");
		w.document.write("\n</BODY>\n</HTML>");
		w.document.close();
	}
	
	function pictPopupSB(img,w,h,title) 
	{
		if('undefined'.indexOf(title) == 0){
			titre="SOMFY";
		}else{
			titre="SOMFY : "+title;
		}
		if('undefined'.indexOf(w) == 0){
			tw="100";
		}else{
			tw=w;
		}
		if('undefined'.indexOf(h) == 0){
			th="100";
		}else{
			th=h;
		}
		// window.moveTo((screen.width-w)/2,(screen.height-h)/2) ;
		w=open('','image','width='+tw+',height='+th+',toolbar=no,scrollbars=yes,resizable=yes');
		w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
		//w.document.write("<SCRIPT language=javascript>function checksize()  { var w = document.images[0].width + 12 ; var h = document.images[0].height + 30 ; if (document.images[0].complete) {  window.resizeTo(w,h) ;  window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>");
		w.document.write("<BODY  leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
		w.document.write("");
		w.document.write("</BODY></HTML>");
		w.document.close();
	}
	
	function moteurPopup(img,w,h,title) 
	{
		if('undefined'.indexOf(title) == 0){
			titre="SOMFY";
		}else{
			titre="SOMFY : "+title;
		}
		if('undefined'.indexOf(w) == 0){
			tw="100";
		}else{
			tw=w;
		}
		if('undefined'.indexOf(h) == 0){
			th="100";
		}else{
			th=h;
		}
		// window.moveTo((screen.width-w)/2,(screen.height-h)/2) ;
		w=open('','image','width='+tw+',height='+th+',toolbar=no,scrollbars=no,resizable=yes');
		w.moveTo((screen.width-w)/2,(screen.height-h)/2) ;
		w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
		//w.document.write("<SCRIPT language=javascript>function checksize()  { var w = document.images[0].width + 12 ; var h = document.images[0].height + 30 ; if (document.images[0].complete) {  window.resizeTo(w,h) ;  window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>");
		w.document.write("<BODY  leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0 onclick='javascript:window.close();'>");
		w.document.write("");
		w.document.write("</BODY></HTML>");
		w.document.close();
	}
	
	function pictLinkedPopup(img,w,h,title,url) 
	{
		if('undefined'.indexOf(title) == 0){
			titre="SOMFY";
		}else{
			titre="SOMFY : "+title;
		}
		if('undefined'.indexOf(w) == 0){
			tw="100";
		}else{
			tw=w;
		}
		if('undefined'.indexOf(h) == 0){
			th="100";
		}else{
			th=h;
		}
		// window.moveTo((screen.width-w)/2,(screen.height-h)/2) ;
		w=open('','image','width='+tw+',height='+th+',scrollbars=no,resizable=no,status=no,menubar=no,directories=no');
		w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE>");
				w.document.write("<SCRIPT language=javascript>\n	var NS = (navigator.appName==\"Netscape\")?true:false;\n");
/*
		w.document.write("\n	function fitPic() {");
		w.document.write("\n		iWidth = (NS)?window.innerWidth:document.body.clientWidth;");
		w.document.write("\n		iHeight = (NS)?window.innerHeight:document.body.clientHeight;");
		w.document.write("\n		if(document.images[0].width > iWidth){ ");
		w.document.write("\n			document.images[0].height = (document.images[0].height * iWidth / document.images[0].width);");
		w.document.write("\n			document.images[0].width = iWidth;");
		w.document.write("\n		}");
		w.document.write("\n		if(document.images[0].height > iHeight){ ");
		w.document.write("\n			document.images[0].width = (document.images[0].width * iHeight / document.images[0].height);");
		w.document.write("\n			document.images[0].height =  iHeight ;");			
		w.document.write("\n		}");
		w.document.write("\n		iWidth = document.images[0].width - iWidth;");
		w.document.write("\n		iHeight = document.images[0].height - iHeight;");
		w.document.write("\n		window.resizeBy(iWidth, iHeight-1);");
		w.document.write("\n		self.focus();");*/
		w.document.write("\n		function fitPic() {");
		w.document.write("\n				iWidth = (NS)?window.innerWidth:document.body.clientWidth;");
		w.document.write("\n				iHeight = (NS)?window.innerHeight:document.body.clientHeight;");
		w.document.write("\n				iWidth = document.images[0].width - iWidth;");
		w.document.write("\n				iHeight = document.images[0].height - iHeight;");
		w.document.write("\n				//document.body.style.overflow='hidden';");
		w.document.write("\n				window.resizeBy(iWidth, iHeight-1);");
		w.document.write("\n				self.focus();");
		w.document.write("\n			};");
		w.document.write("\n	\n</SCRIPT>");
		w.document.write("\n\n</HEAD><BODY leftMargin=\"0\" topMargin=\"0\" marginwidth=\"0\" marginheight=\"0\" onload='fitPic();'>");
		w.document.write("<a href='javascript:window.close();' onclick=\"top.opener.document.location = '"+url+"';\"><IMG src='"+img+"' border=0 usemap=\"#Map\"></a>");
		w.document.write("</BODY></HTML>");
		w.document.close();
	}

	function SWFPopup(swf,w,h,title) 
	{
		if('undefined'.indexOf(title) == 0){
			titre="SOMFY";
		}else{
			titre="SOMFY : "+title;
		}
		if('undefined'.indexOf(w) == 0){
			tw="100";
		}else{
			tw=w;
		}
		if('undefined'.indexOf(h) == 0){
			th="100";
		}else{
			th=h;
		}
		tw2 = new Number(tw) + 20;
		th2 = new Number(th) + 20;
		// window.moveTo((screen.width-w)/2,(screen.height-h)/2) ;
		w=open('','image','width='+tw2+',height='+th2+',toolbar=no,scrollbars=no,resizable=yes');
		w.document.write('<HTML><HEAD><TITLE>'+titre+'</TITLE></HEAD>');
		//w.document.write("<SCRIPT language=javascript>function checksize()  { var w = document.images[0].width + 12 ; var h = document.images[0].height + 30 ; if (document.images[0].complete) {  window.resizeTo(w,h) ;  window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>");
		w.document.write('<BODY  leftMargin=10 topMargin=10 marginwidth=0 marginheight=0><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+tw+'" height="'+th+'"><param name="movie" value="'+swf+'" /><param name="quality" value="high" /><embed src="'+swf+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash" width="'+tw+'" height="'+th+'"></embed></object>');
		w.document.write('</BODY></HTML>');
		w.document.close();
	}
	
	function getXmlHttpRequestObject() {
		if (window.XMLHttpRequest) {
			return new XMLHttpRequest();
		} else if(window.ActiveXObject) {
			return new ActiveXObject("Microsoft.XMLHTTP");
		}
	}

	function logShortUrlRedirection(sucode) 
	{
		var searchReq = getXmlHttpRequestObject();
		
		if (searchReq.readyState == 4 || searchReq.readyState == 0) {	
			searchReq.open("GET", 'log_redirection.cfm?sucode=' + sucode, true);
			searchReq.send(null);
		}	

	}

	function CustPopup(name,w,h,ccode,cname,caddress1,caddress2,caddress3,cpc,ccity,ckeywords,cphone,cfax,cemail,cwebsite,gphone,garea) 
	{
		var searchReq = getXmlHttpRequestObject();
		
		if (searchReq.readyState == 4 || searchReq.readyState == 0) {	
			searchReq.open("GET", 'get_customer_url_es.cfm?cid=' + ccode, true);
			searchReq.send(null);
		}	

		if('undefined'.indexOf(cname) == 0){
			titre="SOMFY";
		}else{
			titre="SOMFY : "+cname;
		}
		if('undefined'.indexOf(w) == 0){
			tw="100";
		}else{
			tw=w;
		}
		if('undefined'.indexOf(h) == 0){
			th="100";
		}else{
			th=h;
		}
		tw2 = new Number(tw) + 20;
		th2 = new Number(th) + 20;
		// window.moveTo((screen.width-w)/2,(screen.height-h)/2) ;
		w=open('name','image','width='+tw2+',height='+th2+',toolbar=no,scrollbars=no,resizable=yes');
		w.document.write('<HTML><HEAD><TITLE>'+titre+'</TITLE></HEAD><LINK rel="stylesheet" href="common/css/v2_style.css" type="text/css" />');
		//w.document.write("<SCRIPT language=javascript>function checksize()  { var w = document.images[0].width + 12 ; var h = document.images[0].height + 30 ; if (document.images[0].complete) {  window.resizeTo(w,h) ;  window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>");
		w.document.write('<BODY  leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>');
		w.document.write('	<table border="0" cellspacing="0" cellpadding="0" style="margin:10px;" bgcolor="#ffffff" width="370">');
		w.document.write('		<tr><td colspan="2">');
		w.document.write('			<table border="0" cellspacing="0" cellpadding="0" style="margin:10px;" bgcolor="#f1f1f1" width="350">');		
		w.document.write('				<tr bgcolor="#b2b2b2">');
        w.document.write('					<td colspan="3" class="textBoldBlanc" bgcolor="#b2b2b2" height="17" valign="middle" style="padding-left:10px;">'+cname+'</td>');
		w.document.write('				</tr>');
		w.document.write('				<tr><td>');
		w.document.write('					<table border="0" cellpadding="0" cellspacing="0" width="100%">');
		w.document.write('						<tr>');
		w.document.write('							<td colspan="3"><img src="common/img/spacer.gif" height="10" width="10"></td>');
		w.document.write('						</tr>');
		w.document.write('						<tr>');
		w.document.write('							<td width="10"><img src="common/img/spacer.gif" height="10" width="10"></td>');
		w.document.write('							<td class="text" valign="top">');
		
		
		w.document.write('								<table border="0" cellpadding="0" cellspacing="0" width="100%">');
		w.document.write('									<tr>');
		w.document.write('										<td class="text" valign="top">');
		if(caddress1 != '') w.document.write(caddress1+'<br>');
		if(caddress2 != '') w.document.write(caddress2+'<br>');
		if(caddress3 != '') w.document.write(caddress3+'<br>');
		w.document.write(cpc + ' ' + ccity + '<br>');		
		w.document.write('										</td>');
		w.document.write('									</tr>');
		w.document.write('									<tr><td class="text" valign="top">&nbsp;</td></tr>');
		w.document.write('									<tr>');
		w.document.write('										<td class="text" valign="top">');		
		if(cphone != '') w.document.write(gphone + ' : ' + cphone + '<br>');
		if(cfax != '') w.document.write('Fax:'  + cfax+'<br>');
		if(cemail != '') w.document.write('E-Mail: ' + decodeURI(cemail)+'<br>');
		if(cwebsite != '') w.document.write('Internet: ' + decodeURI(cwebsite)+'<br>');		
		w.document.write('										</td>');
		w.document.write('									</tr>');
		w.document.write('									<tr><td class="text" valign="top">&nbsp;</td></tr>');
		w.document.write('									<tr>');
		w.document.write('										<td class="text" valign="top">');		
		if(ckeywords != '') w.document.write(garea + ' : '+ckeywords+'<br>');
		w.document.write('										</td>');
		w.document.write('									</tr>');
		
		w.document.write('								</table>');
		
		w.document.write('							</td>');
		w.document.write('							<td width="10"><img src="common/img/spacer.gif" height="10" width="10"></td>');
		w.document.write('					</tr>');
		w.document.write('					<tr>');
		w.document.write('						<td colspan="3"><img src="common/img/spacer.gif" height="10" width="10"></td>');
		w.document.write('					</tr>');
		//w.document.write('				</td></tr>');		
		w.document.write('				</table>');
		w.document.write('			</td></tr>');		
		w.document.write('	</table>');
		w.document.write('			</td></tr>');
		w.document.write('		<tr><td><img src="common/img/template/logo_bas.gif"></td><td class=text align=right style="padding-right:10px;"><a href="javascript:void(0);" onclick="javascript:window.print();">Imprimir</a></td></tr>');		
		w.document.write('	</table>');
		w.document.write('</BODY></HTML>');
		w.document.close();
	}
	
	function hideVideo(){
		var fieldItem = window.document.getElementById('Layer1');
		fieldItem.style.visibility = 'hidden';
	}
	
	function hideLayers(){
		var fieldItem0 = window.document.getElementById('Flash0');
		var fieldItem1 = window.document.getElementById('Flash1');
		fieldItem0.style.visibility = 'hidden';
		fieldItem1.style.visibility = 'hidden';
	}
	
	function showVideo(){
		var trItem = window.document.getElementById('Layer1');
		trItem.style.visibility = 'visible';
	}

	function showLayerFlash(flashNumber){
		var trItem = window.document.getElementById('Flash'+flashNumber);
		trItem.style.visibility = 'visible';
	}
	function get_random()
	{
		var ranNum= Math.floor(Math.random()*2);
		return ranNum;
	}

	
	
	function showRandomLayer()
	{
   		var randomLayer=get_random();

		var layer=new Array(2)
		 layer[0]="I love JavaScript..sometimes.";
		 layer[1]="Why are you pushing my button?";
  
  		 showLayerFlash(randomLayer);
	  }





function activeSWFContent() {
	var ret = SWFGetArgs(arguments);
	SWFGenerateObject(ret.objAttrs, ret.params, ret.embedAttrs);
}

function SWFGenerateObject(objAttrs, params, embedAttrs) { 
	var str = '<object ';
	for (var i in objAttrs)
		str += i + '="' + objAttrs[i] + '" ';
	str += '>';
	for (var i in params)
		str += '<param name="' + i + '" value="' + params[i] + '" /> ';
	str += '<embed ';
	for (var i in embedAttrs)
		str += i + '="' + embedAttrs[i] + '" ';
	str += ' ></embed></object>';

	document.write(str);
}

function SWFGetArgs(args) {
	var ret = new Object();
	ret.embedAttrs = new Object();
	ret.params = new Object();
	ret.objAttrs = new Object();
	for (var i=0; i < args.length; i=i+2){
		var currArg = args[i].toLowerCase();    

		switch (currArg){	
			case "pluginspage":
			case "type":
			case "src":
				ret.embedAttrs[args[i]] = args[i+1];
				break;
			case "data":
			case "codebase":
			case "classid":
			case "id":
			case "onafterupdate":
			case "onbeforeupdate":
			case "onblur":
			case "oncellchange":
			case "onclick":
			case "ondblClick":
			case "ondrag":
			case "ondragend":
			case "ondragenter":
			case "ondragleave":
			case "ondragover":
			case "ondrop":
			case "onfinish":
			case "onfocus":
			case "onhelp":
			case "onmousedown":
			case "onmouseup":
			case "onmouseover":
			case "onmousemove":
			case "onmouseout":
			case "onkeypress":
			case "onkeydown":
			case "onkeyup":
			case "onload":
			case "onlosecapture":
			case "onpropertychange":
			case "onreadystatechange":
			case "onrowsdelete":
			case "onrowenter":
			case "onrowexit":
			case "onrowsinserted":
			case "onstart":
			case "onscroll":
			case "onbeforeeditfocus":
			case "onactivate":
			case "onbeforedeactivate":
			case "ondeactivate":
				ret.objAttrs[args[i]] = args[i+1];
				break;
			case "width":
			case "height":
			case "align":
			case "vspace": 
			case "hspace":
			case "class":
			case "title":
			case "accesskey":
			case "name":
			case "tabindex":
				ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
				break;
			default:
				ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
		}
	}
	return ret;
}


function ChangeLanguage(value){
	if (value != '') document.location.href = 'switchlanguage.cfm?language='+value;
}

function ChangeLanguageStatic(value){
	if (value != '') document.location.href = value;
}	

function addEvent(oElem, sEvType, fn, bCapture){
	return oElem.addEventListener?
		   oElem.addEventListener(sEvType, fn, bCapture):
		   oElem.attachEvent?
		   oElem.attachEvent('on' + sEvType, fn):
		   oElem['on' + sEvType] = fn;
}


function browserVersion(path) {
	this.path = (path) ? path : '../code/style/';
	this.isDynamic = (!window.navigator.appVersion.indexOf('4.') || !window.navigator.appVersion.indexOf('5.'));
	var version = navigator.appVersion
	var v = parseInt(version)
	var agent = navigator.userAgent.toLowerCase();
	this.isMac = (agent.indexOf('mac') >= 0);
	this.isLinux = (agent.indexOf('linux') >= 0);
	this.isOpera = (agent.indexOf('opera') >= 0);
	this.name = window.navigator.appName;
	this.isIE = (this.name == "Microsoft Internet Explorer");	
	this.isNS = (this.name =="Netscape");	
	this.isNS5 = ((this.name=="Netscape" || this.name=="Mozilla" ) && v==5);
	this.css = '<LINK REL="stylesheet" HREF="' + this.path;
	if(this.isMac)	this.css += 'Mac';
	if(this.isLinux) this.css += 'Linux';
	if(this.isIE)	this.css += 'IEStyle';
	else if (this.isNS) this.css += 'NSStyle';
	else this.css += 'IEStyle';
	this.css += (this.css == '' ? '' : '.css" TYPE="text/css">');	
}

function screenInfo() {
	if(b.isDynamic)	{	
		if(b.isIE) {
			this.width = document.body.clientWidth;
			this.height = document.body.clientHeight;
		}
		else if (b.isNS)  {
			this.width = window.innerWidth;	
			this.height = window.innerHeight; 		
		}
	}	
}

var b = new browserVersion();

//-->


