// JavaScript Document
/**
* Show / Hide a element with JQuery
*
*/
function SH2( sEl, force ){
	
	if ( typeof oSH_Element == "undefined" ) return false;
	var oEl = oSH_Element[ sEl ];
	if ( typeof oEl == "undefined" ) return false;
	if ( typeof force != "undefined"  ){ oEl.visible = !force; }
	var speed = oEl.speed || "normal";
	if ( /\d+/.test( speed ) ) speed = parseInt( speed );
	
	if ( IS_JQUERY ) {
		// avec JQuery
		if ( oEl.visible ){
			switch ( oEl.effect ){
				case 'glisse':
				case 'slide':
					$('#' + oEl.block ).slideUp( speed ); break;
				case 'fondu':
				case 'fade':
					$('#' + oEl.block ).fadeOut( speed ); break;
				case '':
				case 'simple':
				default:
					$('#' + oEl.block ).show(); break;
			}
			$('#' + oEl.controller ).removeClass( oEl.classOn );
			$('#' + oEl.controller ).addClass( oEl.classOff );			
		} else {
			switch ( oEl.effect ){
				case 'glisse':
				case 'slide':
					$('#' + oEl.block ).slideDown( speed ); break;
				case 'fondu':
				case 'fade':
					$('#' + oEl.block ).fadeIn( speed ); break;
				case '':
				case 'simple':
				default:
					$('#' + oEl.block ).hide(); break;
			}
			$('#' + oEl.controller ).removeClass( oEl.classOff );
			$('#' + oEl.controller ).addClass( oEl.classOn );			
		}

		// on modifie l'image
		if ( oEl.image && oEl.imageOn && oEl.imageOff ) $('#' + oEl.image ).set( "src", oEl.visible ? oEl.imageOn : oEl.imageOff );
	}else{
		// sans JQuery
		if ( oEl.visible ) {
			MM_findObj( oEl.block ).style.display = "none";
		}else{
			MM_findObj(  oEl.block ).style.display = "";
		}
		if ( oEl.image && oEl.imageOn && oEl.imageOff ) {
			MM_findObj( oEl.controller ).className = oEl.visible ? oEl.classOn : oEl.classOff ;
		}
	}
	oEl.visible = ! oEl.visible;
	return true;
};


function runFlvPlayer( oParam ){
	var hostname = "http://" + window.location.hostname + ':' + window.location.port + (new RegExp("(/[^/]*/)")).exec( window.location.pathname )[0];
	var so = new SWFObject( hostname + "themes/default/misc/flvplayer-1.swf", "con" + oParam.id, oParam.width, oParam.height, "8", "#000000");
	
	// alert( hostname );
	
	so.addVariable("f_skin", escape( hostname + "themes/default/misc/" + oParam.skin) ); //
	so.addVariable("f_url", escape( hostname + "upload/" + oParam.url) ); //
	so.addVariable("f_width", oParam.width); //
	so.addVariable("f_height", oParam.height); //
	so.addVariable("f_param", oParam.params ); //
	so.addVariable("f_volume", oParam.volume || 50 ); //
	
	//var oippo = prompt( "url", hostname + "themes/default/misc/flvplayer-1.swf" );
	
	so.write(oParam.id);
};
