var popup;
function openPopup (url,largeur,hauteur){
	gauche=(screen.width-largeur)/2;haut=(screen.height-hauteur)/2;
	if (popup && !popup.closed) {popup.close();};
	popup = window.open(url,'geWindow','scrollbars=yes,status=no,width='+largeur+',height='+hauteur+',top='+haut+',left='+gauche);
}
var plateforme=navigator.appName.substring(0,2);
//script d'impression
function printzepage() {
	if (plateforme=='Mi') {window.print();}
	if (plateforme=='Ne') {print();}
}
function goLink( zeLink ) {
	if ( zeLink != "" ) location.href=zeLink;
}

function deliaGo ( noLink ) {
	switch ( noLink ) {
		case 1 :
			location.href = '/index.php?template=thermalisme_medical';
			break;
		case 2 :
			location.href = '/index.php?template=remise_en_forme';
			break;
		default :
			break;
	}
}

function goFind() {
var valeur																;
	valeur = escape( document.formFind.strFind.value)					;
	if ( valeur != ""  ) {
		location.href="index.php?template=medSearch&extendedSearchWith="+valeur	;
	}
} 
function goFindTha() {
var valeur																;
	valeur = escape( document.formFind.strFind.value)					;
	if ( valeur != ""  ) {
		location.href="index.php?template=thaSearch&extendedSearchWith="+valeur	;
	}
} 



addExplorerHook ( "topFlash_FSCommand", "topFlash_DoFSCommand" )	;
function topFlash_DoFSCommand ( command, paramValue ) {
	if ( command == "movieClip" ) {
		if ( document.getElementById("leftFlash") ) {
			window.document.leftFlash.TGotoFrame ( "/", 2 )	;
			window.document.leftFlash.TPlay ( "/" )	;
		}
	}
}

var FlashMode = 0;
if (navigator.plugins && navigator.plugins.length > 0)
{
        if (navigator.plugins["Shockwave Flash"])
        {
                var plugin_version = 0;
                var words = navigator.plugins["Shockwave Flash"].description.split(" ");

                for (var i = 0; i < words.length; ++i)
                {
                        if (isNaN(parseInt(words[i])))
                        continue;
                        plugin_version = words[i];
                }
                if (plugin_version >= 6)
                {
                        var plugin = navigator.plugins["Shockwave Flash"];
                        var numTypes = plugin.length;
                        for (j = 0; j < numTypes; j++) 
                        {
                                mimetype = plugin[j];
                                if (mimetype)
                                {
                                        if (mimetype.enabledPlugin && (mimetype.suffixes.indexOf("swf") != -1))
                                                FlashMode = 1;
                                        // Mac wierdness
                                        if (navigator.mimeTypes["application/x-shockwave-flash"] == null)
                                                FlashMode = 0;
                                }
                        }
                }
        }
}

function addExplorerHook ( fNameVB, fNameJS ) {
	if ( navigator.appName && navigator.appName.indexOf("Microsoft") != -1 
		&& navigator.userAgent.indexOf("Windows") != -1 
		&& navigator.userAgent.indexOf("Windows 3.1") == -1) {
		document.write('<SCRIPT LANGUAGE=VBScript\> \n');
		document.write('  On Error Resume Next \n');
		document.write('  Sub ' + fNameVB + '(ByVal command, ByVal paramValue)\n');
		document.write('    Call ' + fNameJS + '(command, paramValue)\n');
		document.write('  End Sub\n');
		document.write('</SCRIPT\> \n');
	}
}



function insertSWF( movieURL, strParams, width, height, embedParms ) {
	var strHTML	;
	var transparency = ""	;
FlashMode=1;

	strParams += "&strNavigator="+navigator.appName		;
	strParams += "&strPlatform="+navigator.platform		;
	strHTML = '<OBJECT name='+name+' id='+name+' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
			+ ' codebase="/argosSites/francethermes/flash/swflash.cab#version=6,0,2,0" '
			+ ' WIDTH="'+width+'" HEIGHT="'+height+'">'
			+ '<PARAM name=movie VALUE="'+movieURL+'?'+strParams+'">'
			+ '<PARAM NAME=FlashVars VALUE="'+strParams+'" />'	;
	strHTML+= '<PARAM name=quality VALUE=high />';
	if (FlashMode == 1) {
		strHTML += '<embed  src="'+movieURL+'?'+strParams+'" quality=high '
				+ '    pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" '
				+ '    type="application/x-shockwave-flash" width="'+width+'" height="'+height+'">';
//				if ( navigator.appName.substr(0,2)=="Mi") strHTML += embedParms;
				strHTML += '</embed>' 
				+ '<noembed>'
				+ '</noembed>';
	} else {
//		strHTML += embedParms;
	}
	strHTML += '</OBJECT>'		;
	document.write ( strHTML )	;
}

function getCookie( sc ) { 
var cn									;
var cv = ""								;
var ch = ""								;
var ac = document.cookie.split(";")		;

	for(var i=0;i<ac.length;i++){
		ch = ac[i].split("=")[0]		;
		ch = ch.replace( " ","" );
		if ( ch == sc )  {
			cv=ac[i].split("=")[1];
			break;
		}
	}
	return unescape(cv.replace(/tspSpace/g," "));
}



function SetCookie (name, value) {
	var argv=SetCookie.arguments;
	var argc=SetCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=name+"="+escape(value)+
		((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
		((path==null) ? "" : ("; path="+path))+
		((domain==null) ? "" : ("; domain="+domain))+
		((secure==true) ? "; secure" : "");
}