﻿//\//////////////////////////////////////////////////////////////////////////////////
//\  quickSub 0.3.5
//\  Copyright Jason Brome 2003-2005. All rights reserved.
//\
//\  By Jason Brome (jason@methodize.org).  Last modified 2005-05-30
//\  http://www.methodize.org/quicksub/
//\
//\  Inspired by the overLIB script by Erik Bosrup (erik@bosrup.com)
//\  http://www.bosrup.com/web/overlib/
//\
//\  This program is free software; you can redistribute it and/or
//\  modify it under the terms of the GNU General Public License
//\  as published by the Free Software Foundation; either version 2
//\  of the License, or (at your option) any later version.
//\
//\  This program is distributed in the hope that it will be useful,
//\  but WITHOUT ANY WARRANTY; without even the implied warranty of
//\  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//\  GNU General Public License for more details.
//\
//\  You should have received a copy of the GNU General Public License
//\  along with this program; if not, write to the Free Software
//\  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//\
//\  Revision History
//\  0.3.5 Added FeedDemon, Moved Fyuze, Syndirella to Others...

var ESCAPED = 1;
var UNESCAPED = 2;

var lastyear = 25;
var lastnum = 1;

var txtSubscribe = 'Sommaire des volumes';

// Color and font settings for Netscape 4 (CSS Style Sheet used for modern browsers)
var q_hdrfont = 'Verdana';
var q_hdrsize = '1';
var q_hdrcolor = '#FFFFFF';
var q_bgcolor = '#415860';
var q_contentfont = 'Verdana';
var q_contentsize = '1';
var q_contentbgcolor = '#EEEEEE';

// Internal vars
var q_frame = self;
var over = null;
var oTimer;

// Determine browser type
var ns4 = (navigator.appName == 'Netscape' && parseInt(navigator.appVersion) == 4);
var ns6 = (document.getElementById)? true:false;
var ie4 = (document.all)? true:false;
if (ie4) {
	var docRoot = 'document.body';
}

if (ns4) {
	var oW = window.innerWidth;
	var oH = window.innerHeight;
	window.onresize = function () {if (oW!=window.innerWidth||oH!=window.innerHeight) location.reload();}
}

if (ie4) {
	if ((navigator.userAgent.indexOf('MSIE 5') > 0) || (navigator.userAgent.indexOf('MSIE 6') > 0)) {
		if(document.compatMode && document.compatMode == 'CSS1Compat') {
			docRoot = 'document.documentElement';
		}
	}
	if (ns6) {
		ns6 = false;
	}
}

// quicksub(url)
// Loads parameters into global runtime variables.
function quicksub(oLink, nivo) {

	if (oTimer) {
		clearTimeout(oTimer);
	}

    var niv = '';
    for (var iniv=0; iniv< nivo; iniv++) {
         niv += '../';
    }
	var text = '<center><table bgcolor='+ q_bgcolor+'>';
	for(var iCount = 1; iCount <= lastyear; iCount++) {
		if (iCount==lastyear & lastnum!=2)
		{
		  text += ('<tr><td>'+(iCount+1986)+' ('+iCount+')</td><td><a href="'+niv+'volumes/NET'+iCount+'1.html">1/2</a></td><td></td></tr>');
		} else {
		  if (iCount<=12)
		  {
		     switch(iCount) {
		        case 1:
		              text += ('<tr><td>'+(iCount+1986)+' ('+iCount+')</td><td><a href="'+niv+'volumes/NET'+iCount+'1.html">1</a></td><td><a href="'+niv+'volumes/NET'+iCount+'2.html">2</a></td><td><a href="'+niv+'volumes/NET'+iCount+'3.html">3</a></td></tr>');
		         break;
		        case 9:
		              text += ('<tr><td>'+(iCount+1986)+' ('+iCount+')</td><td><a href="'+niv+'volumes/NET'+iCount+'1.html">1</a></td><td><a href="'+niv+'volumes/NET'+iCount+'2.html">2</a></td><td><a href="'+niv+'volumes/NET'+iCount+'H.html">HS</a></td></tr>');
		          break;
		          case 12:
		              text += ('<tr><td>'+(iCount+1986)+' ('+iCount+')</td><td><a href="'+niv+'volumes/NET'+iCount+'1.html">1/2/3</a></td><td><a href="'+niv+'volumes/NET'+iCount+'4.html">4</a></td></tr>');
		           break;
		        default:
		     text += ('<tr><td>'+(iCount+1986)+' ('+iCount+')</td><td><a href="'+niv+'volumes/NET'+iCount+'1.html">1</a></td><td><a href="'+niv+'volumes/NET'+iCount+'2.html">2</a></td></tr>');
		           break;
		      }
		  } else {
		     text += ('<tr><td>'+(iCount+1986)+' ('+iCount+')</td><td><a href="'+niv+'volumes/NET'+iCount+'1.html">1/2</a></td><td><a href="'+niv+'volumes/NET'+iCount+'3.html">3/4</a></td></tr>');
		  }
		}
	}
	
    text += '<tr><td colspan="4"><a href="'+niv+'lauteurs.php">Index des auteurs</td></tr>';

	if ( (ns4) || (ie4) || (ns6) ) {
		q_frame = self;
		if (ns4) over = q_frame.document.quickSub
		if (ie4) over = q_frame.quickSub.style
		if (ns6) over = q_frame.document.getElementById("quickSub");
	}
	
	if(!ns4) {
		var layerhtml = '<div class=\'qsheader\'>' + txtSubscribe + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=\"javascript:return closeqs();\" onMouseOver=\"return closeqs();\">[<b>x</b>]</A></div>'
			+ '<div class=\'qscontent\'>' + text + '</center></div>';
	} else {
		var closing = "<TD ALIGN=RIGHT><A HREF=\"javascript:return closeqs();\" onMouseOver=\"return closeqs();\"><FONT COLOR=\""+q_hdrcolor+"\" FACE=\""+q_hdrfont+"\" SIZE=\""+q_hdrsize+"\">[<b>x</b>]</FONT></A></TD>";
		var layerhtml = "<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR=\'"+q_bgcolor+"\'><TR><TD>"
			+"<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD>"
			+"<B><FONT COLOR=\""+q_hdrcolor+"\" FACE=\""+q_hdrfont+"\" SIZE=\""+q_hdrsize+"\">" + txtSubscribe + "</FONT></B></TD>"+closing+"</TR></TABLE>"
			+"<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\'"+ q_contentbgcolor + "\'\">"
			+"<TR><TD VALIGN=TOP><FONT FACE=\""+q_contentfont+"\" SIZE=\""+q_contentsize+"\">"+text+"</FONT></TD></TR>"
			+"</TABLE></center>";
	}
	layerWrite(layerhtml);
	placeLayer(oLink);
	showObject(over);
	
	return true;
}

function closeqs() {
	if (over != null) hideObject(over);
	return true;
}

function placeLayer(oLink) {
	var placeX, placeY, iOffset, aPosition;
	
	aPosition = findPosition(oLink);
	placeX = 170;
	placeY = 150;
	if ( (ns4) || (ie4) ) {
		over.left = (ie4 ? placeX + 'px' : placeX);
		over.top = (ie4 ? placeY + 'px' : placeY);
	} else if (ns6) {
		over.style.left = placeX + "px";
		over.style.top = placeY + "px";
	}
}

function layerWrite(txt) {
	if (ns4) {
		var lyr = q_frame.document.quickSub.document
		lyr.write(txt)
		lyr.close()
	} else if (ie4) {
		q_frame.document.all["quickSub"].innerHTML = txt
	} else if (ns6) {
		range = q_frame.document.createRange();
		range.setStartBefore(over);
		domfrag = range.createContextualFragment(txt);
		while (over.hasChildNodes()) {
			over.removeChild(over.lastChild);
		}
		over.appendChild(domfrag);
	}
}

function showObject(obj) {
	if (ns4) obj.visibility = "show";
	else if (ie4) obj.visibility = "visible";
	else if (ns6) obj.style.visibility = "visible";
}

function hideObject(obj) {
	if (ns4) obj.visibility = "hide";
	else if (ie4) obj.visibility = "hidden";
	else if (ns6) obj.style.visibility = "hidden";
}

function findPosition (oLink) {
	if (oLink.offsetParent) {
		for (var iPosX = 0, iPosY = 0; oLink.offsetParent; oLink = oLink.offsetParent) {
			iPosX += oLink.offsetLeft;
			iPosY += oLink.offsetTop;
		}
		return [iPosX, iPosY];
	} else {
		return [oLink.x, oLink.y];
	}
}

function timeqs () {
	if(!ns4) {
		var iDelay = 500;

		if (oTimer) {
			clearTimeout(oTimer);
		}

		if ((ns4 && over.visibility != 'hide') ||
			(ie4 && over.visibility != 'hidden') ||
			(ns6 && over.style.visibility != 'hidden')) {
			oTimer = setTimeout(hideqs, iDelay);
		}
	}
}

function hideqs () {
	if (oTimer) {
		clearTimeout(oTimer);
	}

	closeqs();
}

function delayqs () {
	if (oTimer) {
		clearTimeout(oTimer);
	}
}
