//
//  $Id: guidon.js,v 1.6 2003/02/24 08:19:30 manu Exp $
//
//  $Log: guidon.js,v $
//  Revision 1.6  2003/02/24 08:19:30  manu
//  bug in mapswin
//
//  Revision 1.5  2003/01/24 08:44:19  manu
//  added maps related functions
//
//  Revision 1.4  2002/11/15 16:16:18  carrere
//  related_info: fenetre dimensionne pour infos de match de Related Families
//
//  Revision 1.3  2002/10/11 09:51:37  manu
//  modif hierarchy
//
//  Revision 1.2  2002/10/10 08:52:11  manu
//  More functions
//
//  Revision 1.1.1.1  2002/07/16 12:09:43  manu
//  ProDom with guidon Graphics User Interface
//
//

var win = null;
function changeURL(newURL, winName) {
    if (win && win.open && !win.closed) {
	win.close();
    }
    win = window.open(newURL, winName, 'resizable,menubar,location,status,scrollbars,titlebar,toolbar');
}

function help(topic) {
    infowin=window.open(topic,
			'STRUCTURE_VIEWER_HELP_FILE',
			"resizable=yes,scrollbars=yes,status=no,directories=no,menubar=yes,width=800,height=450");
}

//
// clear_script, select_left_script = used only by 3D pages
// 

function clear_form() {
    for(var i=0; i < document.PDBFORM.length; i++) {
	document.PDBFORM.elements[i].checked = 0;
    }
}
	
function select_left(name) {
    for(var i=0; i < document.PDBFORM.length; i++) {
	if (document.PDBFORM.elements[i].name == name){
	    document.PDBFORM.elements[i].checked = 1;
	}
    }
}

//
// ouvreFen = Open an new window
// 

var nouvWin=null;
var proprietes="location=0,width=300,height=200,top=250,left=150";
function ouvreFen(fich) {
    if (nouvWin) {
	nouvWin.close();
	nouvWin=null;
    }
    nouvWin=window.open (fich,"satellite",proprietes);
} 

//
// changeImage = change the image when the mouse rolls over
// 

function changeImage (image,nsource){
    image.src=nsource;
}

//
// related_info = Open a new window for Blas results for related families
// 

var nouvWin=null;
var proprietes="location=0,width=800,height=200,top=250,left=150";
function related_info(fich) {
    if (nouvWin) {
	nouvWin.close();
	nouvWin=null;
    }
    nouvWin=window.open (fich,"relateddata",proprietes);
} 

//
// addat= add the at sign in a complicated way
//        hope the spammers will not understand it
//        
// addma= add the protocol in a complicated way, too
// 
// maps = the reverse of spam
//

function addat(addr) {
    return addr+'@';
}

function addma(addr) {
    return 'mail' + 'to' + ':' + addr;
}

function maps(addr) {
    var url = addat(addr);
    url = url + 'prabi.fr';
    url = addma(url);
    mapswin = window.open(url);
    mapswin.close();
};

