﻿/*Redimensionnement automatique des divs container de la page*/
function redimensionne()
{
	var intInnerHeight;
	var intHeightDisponible;
	var intMinHeight;

	if ($("#divGeneral").length != 0)
	{
		intInnerHeight = $("#divGeneral")[0].offsetHeight;
		intHeightDisponible = $(document).height() - 5;

		if (intInnerHeight < intHeightDisponible) { $("#divGeneral").height(intHeightDisponible); }

		intMinHeight = $("#divGeneral")[0].offsetHeight - $("#divHeader")[0].offsetHeight - $("#divBas")[0].offsetHeight;
		$("#divPrincipal").css("min-height", intMinHeight);

		$("#divDroite").height($("#divPrincipal").height() + 5);
	}
}
/*Fin de Redimensionnement automatique des divs container de la page*/

function MiseEnFormeDropDownListMultiple()
{
	$(".dropdowlistmultiple").dropdownchecklist({ maxDropHeight: 175, defaultText: "Faire un choix..." });
}

function InsererLogoFlash()
{
	var flashvars = {};
	var params = {};
	params.menu = "false";
	params.quality = "best";
	params.wmode = "transparent";
	var attributes = {};
	attributes.id = "logoflash";

	swfobject.embedSWF("/_layouts/SCI.WSS.Features.MasterPages/logo-flash.swf", "myFlash", "67", "67", "9.0.0", false, flashvars, params, attributes);
}

function ImprimerContenu(tagId) { ImprimerContenuAvecTitre(tagId, ""); }


var printWP;
var printWPTitre;
var printWPContenu;
function ImprimerContenuAvecTitre(tagId, strTitre)
{
	if (tagId)
	{
		printWPTitre = strTitre;
		printWPContenu = $("#" + tagId).html();
		printWP = window.open("/_layouts/SCI.WSS.Features.MasterPages/popup.html", "PopUpImprimerContenu");
	}
}

function bascule_visibilite(strDivID) {
    if ($("#"+strDivID).css("display") == "block") {
        $("#"+strDivID).hide();
    }
    else {
        $("#"+strDivID).show();
    }
}

function show(strDivID) { $("#"+strDivID).show(); }

function hide(strDivID) { $("#"+strDivID).hide(); }

$(document).ready(redimensionne);
$(document).ready(MiseEnFormeDropDownListMultiple);
$(document).ready(InsererLogoFlash);
$(window).resize(redimensionne);

