// JavaScript Document
function GetURL(icUrl){
	if(icUrl != "#")window.location.href = icUrl;
	else alert("pas d'url");
}
function getDocHeight() {
    var db = document.body;
    var dde = document.documentElement;

    var docHeight = Math.max(db.scrollHeight, dde.scrollHeight, db.offsetHeight, dde.offsetHeight, db.clientHeight, dde.clientHeight);
    return docHeight;
}
function DoLayout(){
    DoResize();
}
function ResizeContent(){
    /*    if(document.getElementById("sousMenu")){
    if(document.getElementById("divContent").offsetHeight < document.getElementById("sousMenu").offsetHeight){
    document.getElementById("divContent").style.height = document.getElementById("sousMenu").offsetHeight+"px";
    }
    }
    */
    DoResize();
      
}
function DoResize() {
    try {
        $("#subsubmenu").height($("#content").height());
    }
    catch (err) {
        //Handle errors here
    }

}
function PrintOpenerContent(){
    document.getElementById("divContentToPrint").innerHTML = window.opener.document.getElementById("divContentScroll").innerHTML;
    window.print();
    window.close();
}

myWindow = null;
function Popup(icURL, icWIdth, icHeight, ilResisable, icWindowName){
	myWindow = window.open (icURL, icWindowName, "status=0,toolbar=0,menubar=0,location=0,resizable="+ ilResisable +",scrollbars=1,fullscreen=0,directories=0,top=20,left=" + ((screen.availWidth - icWIdth) / 2) + ",height=" + icHeight + ",width=" + icWIdth);
}


var NavMenu;
var SousNavMenu;
function DoLayout(){
  NavMenu = document.getElementById("NavMenu");
  SousNavMenu = document.getElementById("SousNavMenu");
  ResizeContent();
}

function ActiveVideoPlayer(cUrl, cBg){
	var so = new SWFObject("/Ext/Layouts/Common.Layout9b/SNABiennale/images/Videos/Video_player.swf", "VideoPlayer", "500", "400", "9.0.28", "#FFFFFF", "false");
	so.addParam('allowscriptaccess','always');
	so.addParam('allowfullscreen','true');
	so.addParam("menu", "false");
	so.addVariable('videoFile',"/Ext/Layouts/Common.Layout9b/SNABiennale/images/Videos/" + cUrl);
	so.addVariable('skin',"/Ext/Layouts/Common.Layout9b/SNABiennale/images/Videos/SkinUnderAllNoFullNoCaption.swf");
	so.addVariable('skinColor',cBg);
	so.write('player');	
}

function GetFlashMovie(swfFile, width, height, divToWrite, bgcolor){
    if(document.getElementById(divToWrite)){
        var swfObjId = swfFile.substring(0,swfFile.indexOf(".swf"));
        var so = new SWFObject("/Ext/Layouts/Common.Layout9b/SNABiennale/images/" + swfFile, swfObjId, width, height, "9.0.28", bgcolor, true);
        so.addParam("quality", "high");
        so.addParam("menu", "false");
        so.addParam("allowScriptAccess", "sameDomain");
        so.addParam("salign ", "T");
        so.useExpressInstall('/Styles/expressinstall.swf');
        so.write(divToWrite);
       
            if (document.getElementById("content")) {

                var offset = 0;
                if (document.getElementById("header")) {
                    offset += $("#header").height();
                }
                if (document.getElementById("submenu")) {
                    offset += $("#submenu").height();
                }
                var newheight = getDocHeight() - offset - 10;
                $("#content").height(newheight);
            }
       

        DoResize();
        
    }    
}

window.onresize=ResizeContent;
window.onchange=ResizeContent;

