// common.js - PSR 02/11/04

//Decode une adresse antispam et retourne l'adresse mail standard : mailto:nom@domaine
function affichMailtoAdresse(addresseArray){
    str = "mailto:";
    for(i = addresseArray.length-1; i>=0; --i)
    {
        str += addresseArray[i];
        
    }
    return str;
}

function decodMail(addresseArray){
    for(i = addresseArray.length-1; i>=0; --i)
    {
        document.write(addresseArray[i]);
    }
}

function adrMail(part1, part2) {
		adStr = part1 + '@' + part2;
		if(adStr.indexOf("?") != -1)
			adStr = adStr.substring(0,adStr.indexOf("?"));
		document.write(adStr);
}	


function dolink(part1, part2){
	link = 'mailto:' + part1 + '@' + part2;
	return link;
}	

// function dolink(ad){
//   link = 'mailto:' + ad.replace(/\.\..+t\.\./,"@"); 
//   return link;
//  }


function affichAnimFlash(sFichFlash,iVersion,iWidth,iHeight,sFichNoFlash){
     // alarm();
     document.write('<OBJECT width="'+ iWidth +'" height="' + iHeight + '" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> ');
     document.write(' <PARAM value="' + sFichFlash + '" name="movie"> ') ;
     document.write(' <PARAM value="high" name="quality">') ;
     document.write(' <EMBED height="170" width="600" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="../../../../IMG/swf/promo_rentree.swf" ') ;
     document.write(' </EMBED> ');
     document.write(' </OBJECT>') ;
}
 

function affichBanniereDefaut(){
      document.write ('<TABLE class="" cellSpacing=1 cellPadding=1 width="100%" border=0> \n');
      document.write ('<TBODY> \n'); 
      document.write ('<TR> \n');
      document.write ('<TD width=120> \n');
      document.write ('<TABLE class="" cellSpacing=1 cellPadding=3 width="100%" border=0> \n');
      document.write ('<TBODY> \n');
      document.write ('<TR> \n');
      document.write ('<TD align=middle><IMG height=70 alt="" src="../IMG/jpg/palme_quattro_P.jpg" width=70 border=0></TD></TR> \n');
      document.write ('<TR> \n');
      document.write ('<TD align=middle><IMG height=70 alt="" src="../IMG/jpg/masque_aries_P.jpg" width=70 border=0></TD></TR>  \n');
      document.write ('</TBODY></TABLE></TD> \n');
      document.write ('<TD align=middle> \n');
      document.write ('<TABLE class="" cellSpacing=1 cellPadding=1 width="100%" align=center border=0> \n');
      document.write ('<TBODY> \n');
      document.write ('<TR> \n');
      document.write ('<TD align=middle> \n');
      document.write ('<MARQUEE scrollAmount=2 scrollDelay=5> \n');
      document.write ('<P align=center><FONT color=#3399ff size=3><STRONG>PROMOTIONS DE LA RENTREE</STRONG></FONT></P></MARQUEE></TD> \n');
      document.write ('</TR> \n');
      document.write ('<TR> \n');
      document.write ('<TD align=middle><FONT color=#ff0066 size=5><STRONG>- 20 %</STRONG></FONT></TD></TR> \n');
      document.write ('<TR> \n');
      document.write ('<TD align=middle><FONT size=2><STRONG>Sur les palmes, masques, tubas et chaussons</STRONG></FONT></TD></TR> \n');
      document.write ('<TR> \n');
      document.write ('<TD align=middle><FONT color=#ff9966><STRONG><FONT size=2>de votre choix</FONT>&nbsp;</STRONG></FONT></TD></TR> \n');
      document.write ('</TBODY></TABLE><BR></TD> \n');
      document.write ('<TD width=120> \n');
      document.write ('<TABLE class="" cellSpacing=1 cellPadding=3 width="100%" border=0> \n');
      document.write ('<TBODY> \n');
      document.write ('<TR> \n');
      document.write ('<TD align=middle><IMG height=70 alt="" src="../IMG/jpg/tuba_baja_P.jpg" width=70 border=0></TD></TR> \n');
      document.write ('<TR> \n');
      document.write ('<TD align=middle><IMG height=70 alt="" src="../IMG/jpg/bottillon_atan_P.jpg" width=70 border=0></TD></TR> \n');
      document.write ('</TBODY></TABLE></TD></TR></TBODY></TABLE> \n');
}      

 
//   var MM_contentVersion = version;
//   var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"])  ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin  : 0 ;
//   if ( plugin ) 
//     var words = navigator.plugins["Shockwave Flash"].description.split(" ") ;
////     for (var i = 0 ; i < words.length ; ++i)
//       if (isNaN(parseInt(words[i])))
//         continue ;
//     var MM_PluginVersion = words[i] ; 
//     var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion ;
// 
//   else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) 
//     document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n') ; 
//     document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n') ;
//     document.write('</SCR' + 'IPT\> \n') ;
// 
//   if ( MM_FlashCanPlay ) 
//     document.write('<OBJECT classid="clsid :D27CDB6E-AE6D-11cf-96B8-444553540000"') ;
//     document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ') ;
//     document.write(' ID="script" WIDTH="'+ width +'" HEIGHT="' + height + '" ALIGN="">') ;
//     document.write(' <PARAM NAME=movie VALUE="' + sFichFlash + '"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> ') ; 
//     document.write(' <EMBED src="' + sFichFlash + '" quality=high bgcolor=#FFFFFF ') ;
//     document.write(' swLiveConnect=FALSE WIDTH="'+ width +'" HEIGHT="' + height + '" NAME="script" ALIGN=""') ;
//     document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">') ;
//     document.write(' </EMBED>') ;
//     document.write(' </OBJECT>') ;
//   else
//     document.write('<IMG SRC="' + sFichNoFlash + '" WIDTH="'+ width +'" HEIGHT="' + height + '"  usemap="#script" BORDER=0>') ;
//

var gright=560
var gbottom=80
//var gtop=120



//explorateurs
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;


// Browser detection
var agt=navigator.userAgent.toLowerCase();
// IE browser
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
// Netscape browser
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
              && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
              && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
// Others : wait and see !

onload = display_copyright;
onresize = resized;
	
function display_copyright() {
	hautFenetre = window.document.body.scrollHeight;						
	pos_X = 10;
	pos_Y = hautFenetre -100 ; 	

	document.getElementById('copyright').style.left = String(pos_X) + "px";
	document.getElementById('copyright').style.top = String(pos_Y) + "px";

	//code = '<div id="copyright" style="left:' + String(pos_X) + '; top :' + String(pos_Y) + '; position:absolute ; z-index: - 1>';
	//code = code + '<a href="http://www.shom.fr"><img src="IMG/templates/copyright_shom.gif" border="0" width="130" height="50" alt="" onmouseover="window.status =\'www.shom.fr\'; return true" onmouseout="window.status=\'\'"></a>';
	//code = code + '</div>';
	//alert(code);
	//document.write(code);
}

function resized(){
	setTimeout('display_copyright()',5)
}

