﻿var posBan4=0, ban4, delaiBan4 ;
var msgBan4= 'Bienvenue sur le site de Nicolito dédié à l\'univers de Captain Tsubasa :o)' ;

function banniere()
{
  window.status = "www.ncdnicolito.com" ;
  return true ;
}

var popupsDir = "./" ;
var popupImage = 0 ;
function openImage(partId, mangaId, imageName)
{
	/*
    if (popupImage != 0)
    {
            popupImage.close() ;
            popupImage = 0 ;
    }
    */

    /*var flags = "width=120,height=100,resizable=no,toolbar=no,menubar=no,scrollbars=no" ;*/
	var flags = "width=50,height=50,resizable=no,toolbar=no,menubar=no,scrollbars=no" ;
    var popupName = "popupImage" ;
    var popupURL = popupsDir + "popup_image/popup_image.php5?partId="+partId+"&mangaId="+mangaId+"&imageName="+imageName ;
       popupImage=window.open(popupURL, popupName, flags) ;
       //popupImage.moveTo(6000,6000) ;
       popupImage.opener = self;
       popupImage.focus() ;
       //return false ;
}

var popupDiapo = 0 ;
function diaporama(section, part, id)
{
    /*if (popupDiapo != 0)
    {
            popupDiapo.close() ;
    }*/
    var flags = "width=10,height=10,resizable=yes,toolbar=no,menubar=no,scrollbars=yes" ;
    var popupName = "popupDiapo" ;
    var popupURL = popupsDir + "diaporama/diaporama.php5?section="+section+"&part="+part+"&id="+id ;
    popupDiapo=window.open(popupURL, popupName, flags) ;
    popupDiapo.opener = self;
    popupDiapo.focus() ;
    //return false ;
}

var popupTmpTrads = 0 ;
function tmpTrad(section, part, id)
{
    var flags = "width=1435 height=1100 top=10, left=10,resizable=yes,toolbar=no,menubar=no,scrollbars=yes" ;
    var popupName = "popupTmpTrad" ;
    var popupURL = popupsDir + "tmp/displayTmp.php5?section="+section+"&part="+part+"&id="+id ;
    popupDiapo=window.open(popupURL, popupName, flags) ;
    popupDiapo.opener = self;
    popupDiapo.focus() ;
}

function DisplayDiaporama(section, part, id)
{
    var popupURL = popupsDir + "diaporama/diaporama.php5?section="+section+"&part="+part+"&id="+id ;
    var normal = false ;
	if (window.innerWidth != null)
	{
		normal = true ;
	}
    var className = "" ;
    switch (part)
    {
		case "golden23" :
			if (normal == true)
			{
				className = "diapoGolden23_visible_normal" ;
			}
			else
			{
				className = "diapoGolden23_visible_ie" ;
			}
		break ;
		
		case "gf2k6" :
			if (normal == true)
			{
				className = "diapoGF2k6_visible_normal" ;
			}
			else
			{
				className = "diapoGF2k6_visible_ie" ;
			}
		break ;
		
		case "fcrb" :
			if (normal == true)
			{
				className = "diapoFCRB_visible_normal" ;
			}
			else
			{
				className = "diapoFCRB_visible_ie" ;
			}
		break ;
		
		case "gd" :
			if (normal == true)
			{
				className = "diapoGD_visible_normal" ;
			}
			else
			{
				className = "diapoGD_visible_ie" ;
			}
		break ;
		
		case "asg" :
		if (section == "yj")
		{
			if (normal == true)
			{
				className = "diapoASG_visible_normal" ;
			}
			else
			{
				className = "diapoASG_visible_ie" ;
			}
		}
		else
		{
			if (normal == true)
			{
				className = "diapoASGTrad_visible_normal" ;
			}
			else
			{
				className = "diapoASGTrad_visible_ie" ;
			}
		}
		break ;
		
		case "hy" :
			if (normal == true)
			{
				className = "diapoHY_visible_normal" ;
			}
			else
			{
				className = "diapoHY_visible_ie" ;
			}
		break ;
		
		case "fc" :
			if (normal == true)
			{
				className = "diapoFC_visible_normal" ;
			}
			else
			{
				className = "diapoFC_visible_ie" ;
			}
		break ;
		
		default :
		break ;		
	
    }
			var div = document.getElementById("diapo") ;
			if (div)
			{
				var iFrame = document.getElementById("diapoFrame") ;
				if (iFrame != null)
				{
					iFrame.src = popupURL ;
					div.className = className ;
				}
			}
}

var popupLink = 0 ;
function openLink()
{
        /*if (popupLink != 0)
        {
                popupLink.close() ;
        }*/
        var flags = "width=680,height=170,top=10,left=10,resizable=no,toolbar=no,menubar=no,scrollbars=no" ;
        var popupName = "popupLink" ;
        var popupLinkURL = "./sections/liens/liensPopup.php5" ;
        popupLink=window.open(popupLinkURL, popupName, flags) ;
        popupLink.focus() ;
        //return false ;
}

var fichePersoPopup = 0 ;

function fichePerso(persoID)
{
	/*
        if (fichePersoPopup != 0)
        {
           fichePersoPopup.close() ;
        }
    */   
        //var hash=getHash();
        //var flags = "width=840,height=720,top=10,left=10,resizable=no,toolbar=no,menubar=no,scrollbars=no" ;
        //var popupName = "fichePersoPopup" ;
        //var popupURL = popupsDir + "fiche_persos/fiche_perso.php3?hash=" + hash + "&persoID="+persoID ;
        //fichePersoPopup=window.open(popupURL, popupName, flags) ;
        //fichePersoPopup.opener=self ;
        //fichePersoPopup.focus() ;
        //print "<iframe src='" + popupUrl + "'></iframe>" ;
}


		function HideDiaporama()
		{
			var div = document.getElementById("diapo") ;
			if (div)
			{
				div.className = "diapoHidden" ;
				var iFrame = document.getElementById("diapoFrame") ;
				if (iFrame != null)
				{
					iFrame.src = "" ;
				}
			}	
		}
		
		
function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
