<!--

h = '';
s = '';
p = '';


//--------------------------------------------------------------------------------------------
function getlocstrings(w) {
	h = w.location.href;

	s = w.location.search;

	if (s.length > 0 && s.indexOf('?') < 0) {
		s = '?' + s;
	}

	p = w.location.pathname + s;

	if (p.indexOf('?') >= 0) {
		p = p.substring(0, p.indexOf('?'));
	}

	if (p.indexOf('/') >= 0) {
		p = p.substring(p.lastIndexOf('/')+1);
	}

	if (s.indexOf('?') >= 0) {
		s = s.substring(s.indexOf('?')+1);
	}
}


//--------------------------------------------------------------------------------------------
function checkmenu(w, eq, val, newval) {
	var idx1, idx2, s1, s2, m, str;

	idx1 = s.indexOf('menu=');

	if (idx1 >= 0) {
		idx2 = (s.indexOf('&',idx1+5) >= 0) ? s.indexOf('&',idx1+5) : s.length;

		m = s.substring(idx1+5, idx2);

		s1 = s.substring(0, idx1);
		s2 = s.substring(idx2);
	} else {
		idx = s.length;
		m = '';
		s1 = s;
		s2 = '';
	}

	if ((eq && m == val) || (!eq && m != val)) {
		str = p + '?' + s1;

		if (s1 != '' && s1.charAt(s1.length-1) != '&') {
			str += '&';
		}

		str += 'menu=' + newval + s2;

		w.location.href = str;
	}
}


//--------------------------------------------------------------------------------------------
function addBookmark() {
	if (navigator.platform == 'Dreamcast') {
		location = 'x-avefront://---.dream/proc/menu/add-bookmark';
	} else if (navigator.userAgent.indexOf('MSIE') > 0) {
		window.external.AddFavorite('http://blueswirl.shorturl.com', '-= Blue Swirl =-');
	} else if ((typeof(window.sidebar)=='object') && (typeof(window.sidebar.addPanel)=='function')) {
		window.sidebar.addPanel('-= Blue Swirl =-', 'http://blueswirl.shorturl.com', '');
	} else {
		alert('Press CTRL+D to bookmark this page.');
	}
}


//--------------------------------------------------------------------------------------------
function checkParent() {
	var f;

	f = top.frames;

	if (f.length > 0) {
		//if (f.length == 5 && f[1].name == 'menu' && f[4].name == 'fenetre') {
		if (f.length >= 5 && f[1].name == 'menu' && f[4].name == 'fenetre') {
			getlocstrings(f[4]);
			checkmenu(f[4], 0, 'off', 'off');
		} else {
			//alert(f.length);
			top.location.href = location.href;
		}
	} else {
		getlocstrings(window);
		checkmenu(window, 1, 'off', 'on');
	}
}


//--------------------------------------------------------------------------------------------
function refreshMSscrollbars() {
	var arr = new Array('userdesc', 'longcomment', 'screenshots1');
	var el;
	var i;
	
	if (typeof(document.body) != 'undefined' && typeof(document.body.style) != 'undefined'
				&& typeof(document.body.style.scrollbarFaceColor) != 'undefined') {
		document.body.style.scrollbarFaceColor			= '#0080ff';
		document.body.style.scrollbarShadowColor		= 'lavender';
		document.body.style.scrollbarHighlightColor		= 'white';
		document.body.style.scrollbar3dlightColor		= '#0080ff';
		document.body.style.scrollbarDarkshadowColor	= '#3131b5';
		document.body.style.scrollbarTrackColor			= 'lavender';
		document.body.style.scrollbarArrowColor			= 'lavender';
	}
	
	for (i=0; i<sizeof(arr); i++) {
		el = document.getElementById(arr[i]);
		
		if (typeof(el) == 'undefined' || typeof(el.style) == 'undefined'
				|| typeof(el.style.scrollbarFaceColor) == 'undefined') {
			continue;
		}

		el.style.scrollbarFaceColor			= '#9cd7ff';
		el.style.scrollbarShadowColor		= 'white';
		el.style.scrollbarHighlightColor	= 'white';
		el.style.scrollbar3dlightColor		= '#5bbdff';
		el.style.scrollbarDarkshadowColor	= '#5bbdff';
		el.style.scrollbarTrackColor		= '#e7f5ff';
		el.style.scrollbarArrowColor		= '#5bbdff';
	}
}


//--------------------------------------------------------------------------------------------
function highlightrow(el, active, selected) {
	if (el == null || typeof(el.style) == 'undefined') {
		return;
	}

	var rownum = -1;
	
	if (el.id.substring(0, 3) == 'row') {
		rownum = parseInt(el.id.substring(3));
	}
	
	if (active) {
		el.className = 'row_hover';
		//el.bgcolor = 'blue';
	} else {
		if (selected) {
			el.className = 'row_selected';
			//el.bgcolor = 'green';
		} else {
			if (rownum > -1) {
				el.className = (rownum % 2 == 0) ? 'row_even' : 'row_uneven';
				//el.bgcolor = (rownum % 2 == 0) ? 'lavender' : 'lightblue';
			} else {
				el.className = '';
				//el.bgcolor = '';
			}
		}
	}
}


checkParent();

//-->