var winapp; //declaration de la reference a la window de l'application

function NavFrame(LFrame, RFrame) {
	if (!parent.frames['left']) {
		parent.location = 'mainframe.asp';
		return;
		}
	if (LFrame != '')
		frames['left'].location=LFrame;
	if (RFrame != '')
		frames['right'].location=RFrame;
}

var hintCount = 0;

function ShowHint(txt) {
    //Si l'objet aHintLbl n'existe pas encore
    //alert("Texte d'aide :\n" + txt);
    if (parent.frames['menu'].document.applets['aHintLbl']) {
        parent.frames['menu'].document.applets['aHintLbl'].setText(txt);
        hintCount = 0;
    } else {
        if (hintCount++ > 500) return;
        setTimeout("ShowHint('" + txt.replace("'", "\\'") + "');", 50);
    }
}

function ShowHintNoFrame(txt) {

    //Si l'objet aHintLbl n'existe pas encore
    if (document.applets['aHintLbl']) {		
        document.applets['aHintLbl'].setText(txt);
        hintCount = 0;
    } else {
        if (hintCount++ > 500) return;		
        setTimeout("ShowHintNoFrame('" + txt.replace("'", "\\'") + "');", 50);
    }
}



function LoadHelp(HlpFile) {
	w = 500;
	h = 500;
	l = (screen.width - w)/2;
	t = (screen.height - h)/2;
	var winhelp = window.open('/help/'+HlpFile,'HELP','toolbar=0,location=0,directories=0,resizable=1,menubar=0,status=0,scrollbars=1,width='+w+',height='+h+',top='+t+',left='+l);
	if (winhelp.focus) winhelp.focus();
}

function ShowQuote() {
	w = 630;
	h = 500;
	l = (screen.width - w)/2;
	t = (screen.height - h)/2;
	var winord = window.open('quote.asp','ORDER','toolbar=0,location=0,directories=0,resizable=1,menubar=0,status=0,scrollbars=1,width='+w+',height='+h+',top='+t+',left='+l);
	if (winord.focus) winord.focus();
}

function Logon() {

	var sl = 50;
	var st = 50;
//	window.moveTo(sl+50, st+50);

	w = 450;
	h = 400;
//	l = (screen.width - w)/2;
//	t = (screen.height - h)/2;
	var winlog = window.open('LogonPopup.asp','LOG','toolbar=0,location=0,directories=0,resizable=1,menubar=0,status=0,scrollbars=no,width='+w+',height='+h+',top='+st+',left='+sl);
	if (winlog.focus) winlog.focus();
}

function LoadApp() {
	w = 800;
	h = 600;
	l = (screen.width - w)/2;
	t = (screen.height - h)/2;
	winapp = window.open('mainframe.asp','APP','toolbar=0,location=0,directories=0,resizable=1,menubar=0,status=0,scrollbars=1,width='+w+',height='+h+',top='+t+',left='+l);
	if (winapp.focus) winapp.focus();
}

function GetInfo(){
	w = 400;
	h = 500;
	l = (screen.width - w)/2;
	t = (screen.height - h)/2;
	var wininf = window.open('register.asp','INFO','toolbar=0,location=0,directories=0,resizable=1,menubar=0,status=0,scrollbars=1,width='+w+',height='+h+',top='+t+',left='+l);
	if (wininf.focus) wininf.focus();
}

function SendEmail(){
	w = 400;
	h = 500;
	l = (screen.width - w)/2;
	t = (screen.height - h)/2;
	var wineml = window.open('sendemail.asp','EMAIL','toolbar=0,location=0,directories=0,resizable=1,menubar=0,status=0,scrollbars=1,width='+w+',height='+h+',top='+t+',left='+l);
	if (wineml.focus) wineml.focus();
}

function Popup(URL){
	w = 500;
	h = 500;
	l = (screen.width - w)/2;
	t = (screen.height - h)/2;
	var winpop = window.open(URL,'POPUP','toolbar=0,location=0,directories=0,resizable=1,menubar=0,status=0,scrollbars=1,width='+w+',height='+h+',top='+t+',left='+l);
	if (winpop.focus) winpop.focus();
}

function WinPopup(URL, n, w, h) {
	l = (screen.width - w)/2;
	t = (screen.height - h)/2;
	var winpop = window.open(URL,n,'toolbar=0,location=0,directories=0,resizable=1,menubar=0,status=0,scrollbars=1,width='+w+',height='+h+',top='+t+',left='+l);
	if (winpop.focus) winpop.focus();
}

function LogPopup(URL, n, w, h) {
	l = (screen.width - w)/2;
	t = (screen.height - h)/2;
	var logpop = window.open(URL,n,'toolbar=0,location=0,directories=0,resizable=1,menubar=0,status=0,scrollbars=no,width='+w+',height='+h+',top='+t+',left='+l);
	if (logpop.focus) logpop.focus();
}
