﻿function isString(obj)
{ 
    if (typeof(obj) == 'string')
    {
        return true; 
    }
    else if (!obj)
    { 
        return false; 
    }
    else if ((typeof(obj) == 'object') && obj.toLowerCase) 
    { 
        return true; 
    } 
    return false; 
} 
function isUndefined(obj) 
{
    return typeof(obj) == 'undefined';
}
function isFunction(obj) 
{
    return typeof(obj) == 'function';
}
function isObject(obj)
{
    return (typeof(obj) == 'object' && !obj) || isFunction(obj);
}
function isNumber(obj) 
{
    return typeof(obj) == 'number' && isFinite(obj);
}
function isNull(obj) 
{
    return typeof(obj) == 'object' && !obj;
}
function isBoolean(obj) 
{
    return typeof(obj) == 'boolean';
}
function isIEObject(obj) 
{
    return isObject(obj) && typeof(obj.constructor) != 'function';
}
function isArray(obj) 
{
    return isObject(obj) && obj.constructor == Array;
}
function openWindow(page,width,height)
{
    window.open(page,'popup','top=50,left=50,width='+width+',height='+height+',resizable=0,scrollbars=0,toolbar=0,location=0,directories=0,menubar=0');
}
function openScrollWindow(page,width,height)
{
    window.open(page,'popup','top=50,left=50,width='+width+',height='+height+',resizable=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0');
}

function swapNav(obj, classname)
{
    obj.className = classname;
}
function swapImg(obj, img)
{
    var strOn = "_on.gif";
    var strOff = ".gif";
    var strSource = obj.src;
    strSource = (strSource.indexOf(strOn) > -1) ? strSource.replace(strOn, strOff) : strSource.replace(strOff, strOn);
    obj.src = strSource;
}
function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}

// Paramètres d'une animation Flash
var flashParams = {};
flashParams.menu = "false";
flashParams.play = "true";
//flashParams.loop = "true";
flashParams.wmode = "transparent";
flashParams.quality = "best";
flashParams.scale = "noScale";
flashParams.salign = "TL";
//flashParams.bgcolor = "#FFFFFF";
//flashParams.devicefont = "false";
flashParams.allowScriptAccess = "sameDomain";
flashParams.codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0";
flashParams.pluginspage = "http://www.macromedia.com/go/getflashplayer";

// Attributs d'une animation Flash
var flashAttributes = {};                
flashAttributes.id = "flashFile";
flashAttributes.name = "flashFile"; 
flashAttributes.align = "center";

function InsertFlashAnim(url, width, height, flashVars)
{
    flashvars.playerMode = "embedded";
    
    swfobject.embedSWF(url, "flashContent", width, height, "9.0.0",
        "/flash/swf/expressInstall.swf", flashVars, flashParams, flashAttributes);
}

function InsertFlashAnimInDiv(url, width, height, flashVars, divId)
{
    flashvars.playerMode = "embedded";
    
    swfobject.embedSWF(url, divId, width, height, "9.0.0",
        "/flash/swf/expressInstall.swf", flashVars, flashParams, flashAttributes);
}

