// DECLARATION DE VARIABLE GLOBALE
var platform;
var browser;
var version;
var adjWidth;
var adjHeight;

// PROPRIETE POUR L OUVERTURE D UN FULL SCREEN SOUS NETSCAPE
windowprops = "top=0,left=0,resizable=yes" + ",width=" + screen.width + ",height=" + screen.height;
// RECUPERATION DE LA VERSION DU BROWSER
version = parseInt(navigator.appVersion);
// RECUPERATION DE LA PLATEFORME + NAVIGATEUR
if(navigator.userAgent.indexOf('Win') == -1) {
platform = 'Macintosh';
} else {
platform = 'Windows';
}

if(navigator.appName.indexOf('Netscape') == -1) {
browser = 'IE';
} else {
browser = 'Netscape';
}

// AJUSTEMENT DES PROPRIETES POUR LES MAC.
if((platform == 'Macintosh') && (browser == 'Netscape')) { adjWidth = 20;
adjHeight = 35;
}
if((platform == 'Macintosh') && (browser == 'IE')) {
adjWidth = 20;
adjHeight = 35;
winOptions = 'fullscreen=yes';
}

// AJUSTEMENT DES PROPRIETES POUR LES PC.
if((platform == 'Windows') && (browser == 'Netscape')) {
adjWidth = 12;
adjHeight = 12;
}
if((platform == 'Windows') && (browser == 'IE')) {
adjWidth = 10;
adjHeight = 28;
}

// FONCTION DE LANCEMENT
function launch(newURL, newName, newFeatures, orgName) {
var remote = open(newURL, newName, newFeatures);
if (remote.opener == null){
remote.opener = window;
remote.opener.name = orgName;
return remote;
}
}

// LANCEMENT PLEIN ECRAN
function LaunchFullScreen()
{
var winWidth = screen.availWidth;
var winHeight = screen.availHeight;
// TEST SUR LA TAILLE DE L ECRAN
if(window.screen.availwidth < 650) {
// Ecran 640x480
this.location = "troppetit.php";
} else {
// Ecran de taille suffisante
if((winWidth < 2000)&&((browser == 'IE') && (version >= 4))) {
// Lancement sous IE vers. 4 et +
var fullscreenWindow = launch("http://www.centrale-mobilite-basse-normandie.com/cartographie/index.php", "maincarto", "channelmode=0,dependent=0,directories=0,fullscreen=1,location=0,menubar=0,resizable=1,scrollbars=0,status=1,toolbar=0");
} else {
// Lancement sous netscape
window.open("http://www.centrale-mobilite-basse-normandie.com/cartographie/index.php", "maincarto", windowprops);
}
}
}


function LaunchInBrowser()
{
var winWidth = screen.availWidth;
var winHeight = screen.availHeight;
// TEST SUR LA TAILLE DE L ECRAN
if(window.screen.availwidth < 800) {
// Ecran de taille suffisante
this.location = "troppetit.php";
} else {
// Tout est ok on lance dans le browser courant
this.location = "urlfenetrecourante";
}
}

function LaunchInPopUp() 
{
// TEST SUR LA TAILLE DE L ECRAN
if(window.screen.availwidth < 650) {
// Ecran 640x480
this.location = "troppetit.asp";
} else {
// Tout est ok on lance dans une pop up avec les propriétées adaptées.
window.open("http://www.centrale-mobilite-basse-normandie.com/cartographie/index.php","maincarto","width=960,height=600,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,left=1,top=1,x=1,y=1");
}
}