// Copyright © 2002 by Business Software & Consulting, All Rights Reserved.
//
// You may incorporate this BSC-WARE sample code into your own code
//////////////////////////////////////////////////////////////

var pointcom = location.href.lastIndexOf(".fr")
var pointcom = pointcom+3
var Chemin = location.href.substring(0,pointcom);
//if (Chemin.substring(pointcom-3,pointcom) == 'htt')
//var Chemin = "http://bruno";

var srcBase = Chemin+'/'
var srcImage = Chemin+'/images/'
var srcJs = Chemin+'/js/'
var srcFr = Chemin+'/fr/'
var srcEn = Chemin+'/en/'
var srcSoftfr = Chemin+'/fr/software/'
var srcPackfr = Chemin+'/fr/software/pack/'
var srcSoften = Chemin+'/en/software/'
var srcPacken = Chemin+'/en/software/pack/'

if (navigator.appName == 'Netscape')
    var language = navigator.language;
else
    var language = navigator.browserLanguage;

var code = language.substring(0,2);

if (code == '' || code == 'fr' || code == 'ca' || code == 'be' || code == 'gp' || code == 'mq' || code == 'pf')
varLangue = 'fr';
else
varLangue = 'en';

//////////////////////////////////////////////////////////////
function prix(val){

	if (val == "pbpes1"){
		document.write('995');}
	if (val == "pbpes2"){
		document.write('1 895');}
	if (val == "pbpes3"){
		document.write('3 995');}

	if (val == "psm"){
		document.write('2 890');}
	if (val == "psc"){
		document.write('3 490');}
	if (val == "mxevo"){
		document.write('3 500');}
	if (val == "mxevoac"){
		document.write('10 000');}

	if (val == "mx"){
		document.write('1 990');}
	if (val == "bi"){
		document.write('990');}
	if (val == "biint"){
		document.write('1 790');}
	if (val == "gp"){
		document.write('269');}

	if (val == "fac"){
		document.write('795');}
	if (val == "ac"){
		document.write('1500');}
	else {document.write('');}
}
//////////////////////////////////////////////////////////////
function treeUrl(){
varPromo = "";
if (varPromo == ""){
	if(navigator.appVersion.substring(22,25) != "5.5"){
		var varUrl = decodeURI(location.pathname);
		varUrl = varUrl.replace(/\//g," > ");
		varUrl = varUrl.replace(/\\/g," > ");
		varUrl = varUrl.replace(/> fr >/g,"> français >");
		varUrl = varUrl.replace(/> en >/g,"> english >");
		varUrl = varUrl.replace(/> cgi-bin >/g," ");
		varUrl = varUrl.replace(/.html/g," ");
		varUrl = varUrl.replace(/.cgi/g," ");
		varUrl = varUrl.replace(/_/g," ");
		varUrl = varUrl.replace(/p2/g,"(page 2)");
		varUrl = varUrl.replace(/p3/g,"(page 3)");
		varUrl = varUrl.replace(/p4/g,"(page 4)");
		varUrl = varUrl.toUpperCase();
		varUrl = varUrl.replace(/> C:/," ");
		varUrl = varUrl.replace(/>  BSC SITE/," ");
		varUrl = varUrl.replace(/> BSC-WARE-2003.COM/," ");

		document.write("<font class=\"BscGreenNote\">" + varUrl + "</font>");
		}
	else {
		if (varLangue == 'fr')
		document.write("<font class=\"BscGreenNote\">Internet Explorer 5.5 (ou version utlérieure) est nécessaire pour bénéficier de toutes les fonctionnalités de ce site</font>");
		else
		document.write("Internet Explorer 5.5 (or later versions) is required to benefit from all the site\'s features");
		}
	}
else {
	document.write(varPromo);
	}
}	
//////////////////////////////////////////////////////////////
function Timer(division,temps){
TimerID = window.setTimeout('Afficher('+division+')',temps);
}
//////////////////////////////////////////////////////////////
function WaitRedirect(){
TimerID = window.setTimeout('Redirect()',0);
}
//////////////////////////////////////////////////////////////
function Redirection(){
alert('Test');
}
function Redirect(){
/*
   ns = (document.layers) ? true : false ;
   ie = (document.all) ? true : false ;

   if (ns){
	if (varLangue == 'fr')
	    window.open('fr/introduction.html','_self','fullscreen=yes, scrollbars=auto');
	else
	    window.open('en/introduction.html','_self','fullscreen=yes, scrollbars=auto');
	}
   else if (ie){
	if (varLangue == 'fr')
	    window.open('fr/introduction.html','_self','fullscreen=yes, scrollbars=auto');
	else
	    window.open('en/introduction.html','_self','fullscreen=yes, scrollbars=auto');
	}
   else{
	if (varLangue == 'fr')
	    window.open('pdf/bsc_plaquette_vfr.pdf','_self','fullscreen=yes, scrollbars=auto');
	else
	    window.open('pdf/bsc_plaquette_ven.pdf','_self','fullscreen=yes, scrollbars=auto');
	}
*/
if (varLangue == 'fr')
    window.open('fr/introduction.html','_self','fullscreen=yes, scrollbars=auto');
else
    window.open('fr/introduction.html','_self','fullscreen=yes, scrollbars=auto');
	//window.open('en/introduction.html','_self','fullscreen=yes, scrollbars=auto');

}

//////////////////////////////////////////////////////////////
function flashContact(){
if (varLangue == 'fr')
	window.open('http://www.marketor.fr/fr/contact/contact.html','contact','top=200, left=300, width=320, height=125, toolbar=no, scrollbar=0, resize=no');
else
	window.open('http://www.marketor.fr/en/contact/contact.html','contact','top=200, left=300, width=320, height=125, toolbar=no, scrollbar=0, resize=no');
}
//////////////////////////////////////////////////////////////
//function Popup(dossier,cible){
//if (varLangue == 'fr')
	//window.open('http://www.marketor.fr/fr/'+dossier+'/'+cible+'.html','fils','top=260, left=370, width=460, height=275, toolbar=no, scrollbar=0, resize=no');
//else
	//window.open('http://www.marketor.fr/fr/'+dossier+'/'+cible+'.html','fils','top=260, left=370, width=460, height=275, toolbar=no, scrollbar=0, resize=no');
//}
//////////////////////////////////////////////////////////////
function Color(division,color){
Titre1.style.backgroundColor = 'FFFFFF';
Titre2.style.backgroundColor = 'FFFFFF';
Titre3.style.backgroundColor = 'FFFFFF';
Titre4.style.backgroundColor = 'FFFFFF';
Titre5.style.backgroundColor = 'FFFFFF';
Titre6.style.backgroundColor = 'FFFFFF';

division.style.backgroundColor = color;
}
//////////////////////////////////////////////////////////////
function Cacher(layerId) {
/*
   ns = (document.layers) ? true : false ;
   ie = (document.all) ? true : false ;
   layerDiv = (ns) ? document.layerId : layerId.style;
   if (ns)
      layerDiv.visibility = "hide";
   else //if(ie)
      layerDiv.visibility = "hidden";
*/
layerId.style.visibility = "hidden";

}
//////////////////////////////////////////////////////////////
function Afficher(layerId){
/*
   ns = (document.layers) ? true : false ;
   ie = (document.all) ? true : false ;
   layerDiv = (ns) ? document.layerId : layerId.style;
   if (ns)
      layerDiv.visibility = "show";
   else if (ie)
      layerDiv.visibility = "visible";
*/
layerId.style.visibility = "visible";
}
//////////////////////////////////////////////////////////////
function CacheMenu(){
Cacher(Menu1);
Cacher(Menu2);
Cacher(Menu3);
Cacher(Menu4);
Cacher(Menu5);
Cacher(Menu6);
}
//////////////////////////////////////////////////////////////
function CacheMenuSauf(layerId){
CacheMenu()
Afficher(layerId);
}
//////////////////////////////////////////////////////////////
var Open = ""
var Closed = ""

function preload(){
	if(document.images){
		Open = new Image();
		Open.src = srcImage+'file_o.gif';
		Closed = new Image();
		Closed.src = srcImage+'file_c.gif';
	}
}
function Paragraph(layerId,Image){
/*
   ns = (document.layers) ? true : false ;
   ie = (document.all) ? true : false ;
   layerDiv = (ns) ? document.layerId : layerId.style;

   if (ns){
	if (layerDiv.display=='hidden'){layerDiv.display = 'show';Image.src=Open.src;}
	else{layerDiv.display = 'hide';Image.src=Closed.src;}
	 }
   else if (ie){
	if (layerDiv.display=='none'){layerDiv.display = '';Image.src=Open.src;}
	else{layerDiv.display = 'none';Image.src=Closed.src;}
	}
*/
if (layerId.style.display=='none'){layerId.style.display = '';Image.src=Open.src;}
else{layerId.style.display = 'none';Image.src=Closed.src;}

}
function SMenuOn(layerId){
/*
   ns = (document.layers) ? true : false ;
   ie = (document.all) ? true : false ;
   layerDiv = (ns) ? document.layerId : layerId.style;
   if (ns){
	layerDiv.display = 'show';
	 }
   else if (ie){
	layerDiv.display = '';
	}
*/
layerId.style.display = '';
}
function SMenuOff(layerId){
/*
   ns = (document.layers) ? true : false ;
   ie = (document.all) ? true : false ;
   layerDiv = (ns) ? document.layerId : layerId.style;
   if (ns){
	layerDiv.display = 'hide';
	 }
   else if (ie){
	layerDiv.display = 'none';
	}
*/
layerId.style.display = 'none';
}
function SMenu(layerId){
SMenuOff(PConseil);
SMenuOff(PSystemes);
SMenuOff(PBusinessPlan);
SMenuOff(PPlanWare);
}
//////////////////////////////////////////////////////////////
function Extend(layerId){
/*
   ns = (document.layers) ? true : false ;
   ie = (document.all) ? true : false ;
   layerDiv = (ns) ? document.layerId : layerId.style;

   if (ns){
	if (layerDiv.overflow=='hidden'){layerDiv.overflow = 'show';}
	else{layerDiv.overflow = 'hide';}
	 }
   else if (ie){
	if (layerDiv.overflow =='hidden'){layerDiv.overflow = 'visible';}
	else{layerDiv.overflow = 'hidden';}
	}
*/
if(layerId.style.overflow == 'hidden')
	layerId.style.overflow = "visible";
else
	layerId.style.overflow = "hidden";
}
function PrintReady(layerId){
if (varLangue == 'fr')
	alertPrint = 'Paramétrez les marges d\'impression à 5 mm avant d\'imprimer \n ou choisissez l\'impression en mode paysage';
else
	alertPrint = 'You should set your browser margins to 5 mm \n or print in landscape mode';

   ns = (document.layers) ? true : false ;
   ie = (document.all) ? true : false ;
   layerDiv = (ns) ? document.layerId : layerId.style;

   if (ns){
	if (layerDiv.height == ''){
		layerDiv.height = 800;
		window.print();
		alert(alertPrint);}
	else{window.location.reload();}
	 }
   else if (ie){
	if (layerDiv.height == ''){
		layerDiv.height = 800;
		window.print();
		alert(alertPrint);}
	else{window.location.reload();}
	}
}
//////////////////////////////////////////////////////////////
function Search(){

	if (document.getSelection) txt = document.getSelection();
	else if (document.selection) txt = document.selection.createRange().text;
	else return;

var selection = "http://www.marketor.fr/cgi-bin/farfouineur.pl?terms=" + txt + "&boolean=AND&case=Insensitive&result_par_page=5";
window.open(selection,'new','width=470,height=555,top=50,left=300,toolbar=no,location=no,directories=no,status=no,menubar=no, scrollbars=no,resizable=yes');
}
//////////////////////////////////////////////////////////////
function Fullscreen(){
var LaPage = location.href.substring(location.href.lastIndexOf("/")+1);
window.open(LaPage,'','fullscreen=yes, scroolbars=auto');
}
//////////////////////////////////////////////////////////////
function Language(lang){
if (lang == 'en')
var LaPage = "http://www.marketor.fr/en" + location.href.substring(location.href.lastIndexOf("/fr/")+3);
else
if (lang == 'fr')
var LaPage = "http://www.marketor.fr/fr" + location.href.substring(location.href.lastIndexOf("/en/")+3);

window.open(LaPage,'_self');
}
//////////////////////////////////////////////////////////////

