// récupération des arguments
var url = "http://www.meteorage.fr";

var httpParams = {
	position : 'horizontale',
	border : 1,
	height : '',
	width : '',
	imgminivigi : '/tmp/vigifoudre_mini.png',
	lang : 'fr',
	background : '7197C4',
	color : 'FFFFFF',
	/*background : 'E1E1E1',
	color : '000000',*/
	texte : '<img id="logo_mtrg" src="http://www.meteorage.fr/meteorage.fr/images/logo_mtrg.gif" width="100px" /><br/><span>VISIOFOUDRE &reg;</span><p style="position: relative; top: -15px">La foudre en temps-r&eacute;el<br/><a href="'+url+'/meteorage.fr/visiofoudre.php" target="_blank" title="Visiofoudre"><img src="'+url+'/meteorage.fr/images/icon_fleche_blanc.png" /> Visualisez la carte</a></p>'
}

if (typeof params_vigi != "undefined") {
	var paramsArr = params_vigi.split("&");

	for (var i=0; i < paramsArr.length; i++) {
		var index = paramsArr[i].indexOf("=");
		if (index) {
			var param = paramsArr[i].substring(0,index);
			var value = paramsArr[i].substring(index+1);
			if (httpParams[param]) httpParams[param] = value;
		}
	}
}
if (httpParams['position'] == 'horizontale') {
	if (httpParams['height'] == '') httpParams['height'] = '66';
	if (httpParams['width'] == '') httpParams['width'] = '230';
} else {
	if (httpParams['height'] == '') httpParams['height'] = '140';
	if (httpParams['width'] == '') httpParams['width'] = '155';
}

document.write('<style type="text/css">');
document.write('<!--');
document.write('.vigi { font-size: 12px; font-family: Arial, Helvetica, sans-serif; margin: 0; padding: 7px; height: '+httpParams['height']+'px; width: '+httpParams['width']+'px;');
if (httpParams['border'] == 1) document.write('border: 1px solid white; -moz-border-radius: 10px; -khtml-border-radius: 10px; -webkit-border-radius: 10px;');
if (httpParams['background']) document.write('background: #'+httpParams['background']+';');
if (httpParams['color']) document.write('color: #'+httpParams['color']+';');
document.write(' }');
document.write('.vigi img { border: 0; }');
document.write('.vigi a, .vigi a:visited { top:-10px; text-decoration: none; font-weight: bold;');
if (httpParams['color']) document.write('color: #'+httpParams['color']+';');
document.write(' }');
document.write('.vigi a:hover { text-decoration: none; font-weight: bold; color: #'+httpParams['color']+'; }');
document.write('.vigi p { margin: 0px; padding: 2px; text-decoration: none;}');
document.write('.vigi img { vertical-align: middle; }');
document.write('.vigi span { position: relative; top: -13px; left: 40px; font-weight: bold;}');

document.write('-->');
document.write('</style>');

document.write('<div class="vigi">');
if (httpParams['position'] == 'horizontale') {
	document.write(' <div style="float:left;">');
} else {
	document.write(' <div>');	
}
document.write(' <a href="'+url+'/meteorage.fr/visiofoudre.php" target="_blank" title="Visiofoudre">');
document.write(' <img src="'+url+httpParams['imgminivigi']+'" alt="Non disponible" />');
document.write(' </a>');
document.write(' </div>');
if (httpParams['position'] == 'horizontale') {
	document.write(' <div style="float:none; margin-left: 79px; top: 0px;">');
	document.write(httpParams['texte']);
	document.write(' </div>');
} else {
	document.write(' <div style="float:none;">');
	document.write(httpParams['texte']);
	document.write(' </div>');
}
document.write('</div>');

