var uid = new Date().getTime();
//create proxy to director shockwave
//var dirProxy = new DirProxy('<? echo $uid ?>', 'http://www.destination-surf.com/globe/JavaScriptDirectorGateway.swf');
var dirProxy = new DirProxy(uid, 'http://www.destination-surf.com/globe/JavaScriptDirectorGateway.swf');
var lastReturnedLingoValue = 0;
var lastFunction = "";
var lastArguments = "";

function goto(long,lat,alt){
  dirProxy.call('goto', 50,50,4000);
}

function filterspots(idlist){
  dirProxy.call('filterspots', idlist);
}


function getValueFromLingo(aFunctionName){
	dirProxy.call('returnLingoData',aFunctionName);
}

function getLingoData(aValue){
  lastReturnedLingoValue = aValue;
  
  if(lastFunction=="changeZoom"){
  	
  }
}
////////////////////////////////////

if(ShockwaveVersion>=11){
  var tag = new DirTag("globe/standalone11.dcr", 585, 435, true);
  tag.setDirvars(uid);
  tag.write(document);
}else{
  //document.write("Shockwave : " + String(ShockwaveVersion) + "<hr>");
  document.write('<table border="0" bgcolor="#FFFFFF" width="400" valign="top" align="center" cellpadding="5" style="border:2px dashed #880000;"><tr><td><p align="justify">');
  document.write("Vous ne disposez pas du plugin <strong><a href='http://www.adobe.com/go/EN_US-H-GET-SHOCKWAVE' target='_blank'>Adobe Shockwave Player</a></strong> version 11, n&eacute;cessaire pour afficher notre Globe 3D et vous permettre d'élaborer votre Trip Surf ! <br><br>");
  document.write("Pour installer ce plugin, rien de plus facile et rapide ! Cliquez sur <a href='http://www.adobe.com/go/EN_US-H-GET-SHOCKWAVE' target='_blank'><strong style='color:#EE8800'>ce lien</strong></a> et suivez les instructions.<br><br>");
  if(isIE){
    document.write("Une fois le plugin install&eacute;, vous devrez peut être <strong>fermer votre navigateur puis revenir sur cette page</strong> pour que l'installation soit prise en compte.<br><br>");
  }else{
    document.write("Une fois le plugin install&eacute;, vous devrez <strong>actualiser cette page</strong> pour que l'installation soit prise en compte.<br><br>");  
  }
  document.write("Cette installation n'est n&eacute;cessaire qu'une seule fois, vous n'aurez plus à l'effectuer par la suite.<br><br>");
  document.write("Bonne découverte de la Planète Destination Surf !");
  
  document.write('</p></td></tr></table>');
}

if(debug){
	document.write("Flash : " + String(FlashVersion) + "<hr>");
	document.write("Shockwave : " + String(ShockwaveVersion) + "<hr>");
	document.write(misc_data);
	document.write("<hr><font color=red>" + ctnu);
}

///////////////////////////////////
function clickIE4(){
  if (event.button==2){
    return false;
  }
}

function clickNS4(e){
  if (document.layers||document.getElementById&&!document.all){
    if (e.which==2||e.which==3){
      return false;
    }
  }
}

if (document.layers){
  document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS4;
  }
  else if (document.all&&!document.getElementById){
    document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("return false");
