// I-COMPARATEUR 

function cipop() {
	document.getElementById('iCover').style.visibility = 'hidden';
	document.getElementById('iPop').style.visibility = 'hidden';
	document.getElementById('iPopMainDiv').innerHTML = '';
}

function oipop(w, h, u) {
	iPopMainDivHtml =  '<div id="iCover" onclick="cipop();" style="visibility:hidden"></div>';
	iPopMainDivHtml += '<div id="iPop"  class="iPop" style="visibility:hidden"></div>'
	document.getElementById('iPopMainDiv').innerHTML = iPopMainDivHtml;
	
	document.getElementById('iPop').style.margin = getScrollHeight()-h/2 + 'px 0px 0px -' + w/2 + 'px';
	document.getElementById('iPop').style.width = w + 'px';
	document.getElementById('iPop').style.height = h + 'px';
	document.getElementById('iPop').style.visibility = 'visible';
	
	var _docHeight = (window.innerHeight + window.scrollMaxY || document.body.offsetHeight);
	document.getElementById('iCover').style.height = _docHeight+10 + 'px';
	document.getElementById('iCover').style.visibility = 'visible';
	
	iPopHtml = '<iframe width="' + w + '" height="' + h + '" frameborder="0" scrolling="no" src="' + u + '"></iframe>';
	document.getElementById('iPop').innerHTML = iPopHtml;
}

/**************************************************************/

function addbmk(ctitle, curl) {
	if (window.sidebar) { 
		window.sidebar.addPanel(ctitle, curl, ""); 
	} else if( document.all) {
		window.external.AddFavorite(curl, ctitle);
	} else if( window.opera && window.print ) {
		return true;
	}
}

function setrssbmk(s,n) {
	setURL = location.href;
	setURL = setURL.replace(/&service=rss$/i, '');
	setURL = setURL.replace(/&service=rss\&/i, '\&');
	setURL = setURL.replace(/&service=bmk$/i, '');
	setURL = setURL.replace(/&service=bmk\&/i, '\&');
	setURL += '&service=' + s;
	if (n==1) {
		window.open(setURL);
		parent.cipop();
	} else if (n==0) {
		parent.location.href=setURL;
	}
}

/**************************************************************/

function getScrollWidth() {
	var w = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;
	return w ? w : 0;
}

function getScrollHeight() {
	var h = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
	return h ? h : 0;
}