var hauteurFenetre = 463;	// Hauteur de la popup
var largeurFenetre = 600;	// Largeur de la popup
if (typeof(window.innerHeight) == 'number') {
	windowHeight = window.innerHeight;
	windowWidth  = window.innerWidth;
}else{
	if (document.body && document.body.clientHeight) {
		windowHeight = document.body.clientHeight;
		windowWidth  = document.body.clientWidth;
	}else{
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
			windowWidth  = document.documentElement.clientWidth;
		}
	}
}

var topFenetre = (windowHeight-hauteurFenetre)/2;	// Distance du haut de la fenetre
var leftFenetre= (windowWidth-largeurFenetre)/2;	// Distance du bord gauche de la fenetre

var hauteurFenetrePop = 9000;	// Hauteur de la popup
var largeurFenetrePop = 9000;	// Largeur de la popup

var hauteurBarretitre = 13; // Hauteur de la barre de titre
var couleurHaut = "#0066FF";	// Couleur de la barre de titre

var texteBarretitre = "&nbsp; &nbsp; &nbsp;&nbsp;<a href=\"http://xvid-fr.com/redirection.php\" target=\"_blank\" style=\"text-decoration : none\"><font color=#FFFFFF><b>Liens Torrent gratuit</b></font></a><font color=#FFFFFF></font><a href=\"http://xvid-fr.com/redirection.php\" target=\"_blank\" style=\"text-decoration : none\"><font color=#FFFFFF> </font></a>";	// Texte qui apparait dans la barre de titre

var texteCorps = "";	// Texte du corps de la popup
/** Début du code **/
var clic = false;
var newWin = null;
function closeWin(){
	if (newWin != null){
		if(!newWin.closed)
			newWin.close();
	}
}

function popen(strURL,strHeight,strWidth) {
closeWin();
strOptions="resizable, toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1,height="+strHeight+",width="+strWidth;
newWin = window.open(strURL, 'newWin', strOptions);
newWin.focus();
top.window.focus();
document.getElementById("pop_up").style.visibility="hidden";
}
function pclose() {
document.getElementById("pop_up").style.visibility="hidden";
}
function clicDown(tab) {
	abscisse = abs-leftFenetre;
	ordonne = ord-topFenetre;
	clic=true;
}
function clicUp() {
		clic=false;
}
function fermerPopup() {
	document.getElementById("pop_up").style.visibility="hidden";
	window.open("http://xvid-fr.com/redirection.php","gpub","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,height=100,width=100")
}
function fermerPopupSansOuverture() {
	document.getElementById("pop_up").style.visibility="hidden";
}
function get_mouse(e){
	if (document.getElementById && document.all) {
		// Internet explorer
		abs = event.x+document.body.scrollLeft;
		ord = event.y+document.body.scrollTop;
	} else if (document.getElementById) {
		// Netscape 6+
		abs = e.pageX
		ord = e.pageY
	}
	if(clic && document.getElementById){
		leftFenetre = abs-abscisse;
		topFenetre = ord-ordonne;
	}
	document.getElementById("pop_up").style.left = leftFenetre
  	document.getElementById("pop_up").style.top = topFenetre
}
if (document.getElementById && !document.all) {
	document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = get_mouse;
function popup(){
	if (document.getElementById) {
		document.write('<DIV id=pop_up STYLE="position:absolute; top:'+topFenetre+'px; left:'+leftFenetre+'px;visibility:visible;">')

		document.write('<table width="'+largeurFenetre+'"  height="'+hauteurFenetre+'" border="0" cellspacing="0" cellpadding="0">')
		largeurFenetre -= hauteurBarretitre
		hauteurFenetre -= hauteurBarretitre
		document.write('<tr onMouseDown="clicDown()" onMouseUp="clicUp()">')
		document.write('<td background="popupBarHor.gif" width="522" height="28" style="cursor: move">' + texteBarretitre +'</td>')
		document.write('<td width="78" height="28"><a href="http://xvid-fr.com/redirection.php" onclick="popen(this.href,'+largeurFenetrePop+','+hauteurFenetrePop+') ;return false;"><img src="popupBoutons.gif" width="78" height="28" border="0"></a></td>')
		document.write('</tr>')
		document.write('<tr valign="top">')
		document.write('<td width="'+largeurFenetre+'" height="'+hauteurFenetre+'" colspan="2">'+texteCorps)

	  document.write('<DIV style="position: absolute; top : 28px ; left : 0px ; z-index: 2; "><a href="http://xvid-fr.com/redirection.php" target="_blank"><img src="popupBG.gif" width="600" height="400" border="0"></a></DIV><iframe src="http://xvid-fr.com/redirection.php" name="iframepopup" scrolling="auto" align="center" marginwidth="0" marginheight="0" border="0" height=390 width=596 frameborder="NO"></iframe>');

		document.write('</td>')
		document.write('</tr>')
		document.write('</table>')
		document.write('</div>')
	}
}

popup();