
var KribiVersion = "2,14"; // EB Sep-24-2008


function set3Dtype(currentPage){
	if (currentPage.substring(currentPage.length - 9, currentPage.length) == "pure.html")
	{
		if ((navigator.platform == "Win32")&&(navigator.appName == "Microsoft Internet Explorer"))
		{
			//line below can be commented for testing Panoramas in IE while authoring: reactivate after site completion.
			window.location.href = currentPage.substring(0, currentPage.length - 9) + ".html";
		}
	}
	else
	{
		if ((navigator.platform != "Win32")||(navigator.appName != "Microsoft Internet Explorer"))
		{
			window.location.href = currentPage.substring(0, currentPage.length - 5) + "pure.html"
		}
	}
}


function createflashobject(filepath, width, height) {
	FlashZone.innerHTML = '<object id="FlashObject" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="' + width + '" height="' + height + '"><param name=movie value="' + filepath + '"><param name="quality" value="high"><param name="allowScriptAccess" value="sameDomain"><embed src="' + filepath + '" width="' + width + '" height="' + height + '" autostart="True" loop="True" quality="high" bgcolor="#000000" name="FlashObject" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
}


function CreatePanorama (filepath, width, height)
{
  if (isIE)  
  {
    PurePlayerZone.innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' id='PurePlayer' width='"+width+"' height='"+height+"' codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=9,0,0,0'> <param name='movie' value='PurePlayer.swf' /> <param name='allowScriptAccess' value='sameDomain' /> <param name='allowFullScreen' value='true' /> <param name='flashvars' value='panorama="+filepath+"' /> </object>"; 
    return;
  }

  if (DetectFlashVer(9,0,0)) 
  { // we have detected an acceptable version, embed the Flash Content SWF when all tests are passed
    AC_FL_RunContent("name","PurePlayer","src","PurePlayer","width",width,"height",height,"id","PurePlayer",
      "flashvars","panorama="+filepath,"allowFullScreen","true","allowScriptAccess","sameDomain",
        "type","application/x-shockwave-flash","pluginspage","http://www.adobe.com/go/getflashplayer");
    return;    
  }

// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
  if (DetectFlashVer(6,0,65)) 
  {
    // MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
    // This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
    // DO NOT MODIFY THE FOLLOWING FOUR LINES
    // Location visited after installation is complete if installation is required
    var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
    var MMredirectURL = window.location;
    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
    var MMdoctitle = document.title;
    AC_FL_RunContent("src","playerProductInstall","FlashVars","MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
      "width",width,"height",height,"align","middle","id","PurePlayer","quality","high","bgcolor","#ffffff","name","PurePlayer",
        "allowScriptAccess","sameDomain","allowFullScreen","true","type","application/x-shockwave-flash",
          "pluginspage","http://www.adobe.com/go/getflashplayer");
    return;     
  } 

// flash is too old or we can't detect the plugin
  var alternateContent = '<font color="#BB0000">Adobe Flash Player requiert une mise &agrave; jour.'
    + ' Ce contenu requiert Adobe Flash Player.</font> '
    + '<a href=http://www.adobe.com/go/getflash/>T&eacute;l&eacute;charger Flash</a>';
  PurePlayerZone.innerHTML = alternateContent;  // insert non-flash content
    
}

//  EB Jan-22-2008 |=>
var ApartmentName = ''; 
var CurObjName = '';  
var DescriptionFunction;
var DescriptionZoneId;  

function SetCurrentPanoramaApartment (name,descrFunc,descrZone)
{  
  ApartmentName = name;
  DescriptionFunction = descrFunc;
  DescriptionZoneId = descrZone;   
}
	
function OpenPanorama (objName) 
{
  if (CurObjName == objName) return;
  CurObjName = objName; 
  DescriptionZoneId.innerHTML = DescriptionFunction(CurObjName);
  var panoramaPath = "flash/" + ApartmentName + CurObjName + ".ivp"
  CreatePanorama(panoramaPath,456,320);
}

function setFloorPure(level,room)
{
	planPure.src = "images/" + ApartmentName + "plan" + level + ".jpg";
	planPure.useMap = "#plan2D" + level;
	OpenPanorama(room);
}


// EB Jan-22-2008 =>|

function SetFurniture(furniture){
	alert(furniture);
}

function showHelp(){
	aide.style.visibility = "visible";
}

function hideHelp(){
	aide.style.visibility = "hidden";
}

function switchimage(myimage, imagesrc){
	myimage.src = imagesrc;
}

function visiteNonDisponible(apartType){
	alert("La visite interactive n'est pas disponible pour le type " + apartType + ". \nVous pouvez télécharger le plan PDF ci-contre.")
}
