﻿
   
        var Count = 0;
        var Text = "Bienvenue chez votre pizzéria de quartier en ligne: Pizza-by-Night Paris - Restauration rapide de qualité, chez vous en quelques clics!";
        var Speed = 90;
        var timerID = null;
        var TimerRunning = false; 
        var i = 0; 
        while(i ++ < 140) 
            Text = " " + Text;
            function Scroll()
            { 
                window.status = Text.substring(Count++, Text.length);
                if (Count == Text.length) 
                    Count = 0;
                    timerID = setTimeout("Scroll()", Speed);
                    TimerRunning = true;
            }
            function Start()
            {
                Stop();
                Scroll();
            }
            function Stop()
            {
                if(TimerRunning)
                    clearTimeout(timerID); 
                    TimerRunning = false;
            }
            Start();
   
   
   
    function loadImages() {
        if (document.getElementById) {  
            document.getElementById('hidepage').style.visibility = 'hidden';
        }
        else {
            if (document.layers) {  
                document.hidepage.visibility = 'hidden';
            }
            else {
                document.all.hidepage.style.visibility = 'hidden';
              }
           }
    }

    function noclic(clic) {
    var mess="Copyright Pizza-by-Night 2009"; 
    if (navigator.appName == 'Netscape' && clic.which==3) {
    alert(mess);
    }
    else
    if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
    alert(mess);
    }}
    if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
    }
    document.onmousedown = noclic;



    function loadImages() {
    if (document.getElementById) {  
    document.getElementById('hidepage').style.visibility = 'hidden';
    }
    else {
    if (document.layers) {  
    document.hidepage.visibility = 'hidden';
    }
    else {
    document.all.hidepage.style.visibility = 'hidden';
          }
       }
    }



function favoris() 
{ 
    if ( navigator.appName != 'Microsoft Internet Explorer' )
    { window.sidebar.addPanel("Pizza-by-Night Paris", "http://pizzabynight.fr", "Pizza-by-Night"); } 
    else { window.external.addFavorite("http://pizzabynight.fr","Pizza-by-Night Paris"); 
        } 
} 

function uri() 
{ 
    var p, h, u; 
    p = location.protocol; h = location.hostname; u = location.href; 
    return h;
} 

/*function window_onbeforeunload()
{
    //alert(typeof window.opener);
    //alert(document.formMain.visited.value);
        if( document.formMain.visited.value == "" )// 1er chargement de la page
        {
            document.formMain.visited.value = "1"; //la page est rafraichie et l'utilisateur est toujours sur la page (Postabcks)   
        }
        if( document.formMain.visited.value == "2" ) //la page est rafraichie et l'utilisateur n'est plus sur la page, on déduit qu'il change d'adresse ou qu'il quite le navigateur donc qu'il quitte le site
        {
            var strChUserAgent = navigator.userAgent;
            var intSplitStart = strChUserAgent.indexOf("(",0);
            var intSplitEnd = strChUserAgent.indexOf(")",0);
            var strChStart = strChUserAgent.substring(0,intSplitStart);
            var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
            var strChEnd = strChUserAgent.substring(strChEnd);
            //Browser detecté
            if ( strChEnd.indexOf("MSIE") != -1){ // IE? si oui
                deconnectwindow=window.open("disconnect.aspx?idc=" + document.getElementById("TxtBxidc").value,"_Blank","location=0,status=0,scrollbars=0,width=500,height=350");return False;
            }
            else {
                deconnectwindow=window.open("disconnect.aspx?idc=" + document.getElementById("TxtBxidc").value,"deconnexion...","location=0,status=0,scrollbars=0,width=500,height=350");return False;
            }
        }
}*/



function openPop(url,largeur,hauteur)
{
    var Dessus=(screen.height/2)-((hauteur/2)+50);
    var Gauche=(screen.width/2)-(largeur/2);
    var features= 'height='+hauteur+',width='+largeur+',top='+Dessus +',left='+Gauche+",scrollbars=yes, status='1'";
    var strChUserAgent = navigator.userAgent;
    var intSplitStart = strChUserAgent.indexOf("(",0);
    var intSplitEnd = strChUserAgent.indexOf(")",0);
    var strChStart = strChUserAgent.substring(0,intSplitStart);
    var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
    var strChEnd = strChUserAgent.substring(strChEnd);
    //Browser detecté
    if ( strChEnd.indexOf("MSIE") != -1){ // IE? si oui
        deconnectwindow=window.open(url + "&idc=" + document.getElementById("TxtBufferIdCli").value ,"_Blank",features);
    }
    else {
        deconnectwindow=window.open(url + "&idc=" + document.getElementById("TxtBufferIdCli").value ,"Pizza-by-Night - La Carte",features);
    }

}

var coeff=2;//Coefficient de reduction
var larg=200;//largeur maxi de l'image
var haut=200;//hauteur maxi de l'image
var coeffinit=coeff;

function changerImg() {

if (document.image1.width < larg) {
    coeff = coeff-0.2;
    document.image1.width = Math.round(larg/coeff);
    document.image1.height = Math.round(haut/coeff);
    chang=window.setTimeout('changerImg();',10);//vitesse de l'effet
}
else {window.clearTimeout(chang);}
}

function initialImg() {
if (document.image1.width > larg/coeffinit) {
    window.clearTimeout(chang);
    coeff = coeff+0.2;
    document.image1.width = Math.round(larg/coeff);
    document.image1.height = Math.round(haut/coeff);
    initi=window.setTimeout('initialImg();',10);//vitesse de l'effet
}
else {window.clearTimeout(initi);}
}

function fullScreen(objet) {
	var monObj = document.getElementById(objet);
	if (monObj)
	{
		monObj.focus();
		monObj.style.height = screen.height * 0.8;
		monObj.style.width = screen.width * 0.8;
	}
}

//var repeat=0 //enter 0 to not repeat scrolling after 1 run, othersise, enter 1
//var title=document.title
//var leng=title.length
//var start=1
//function titlemove() {
  //titl=title.substring(start, leng) + title.substring(0, start)
  //document.title=titl
  //start++
  //if (start==leng+1) {
    //start=0
    //if (repeat==0)
    //return
  //}
  //setTimeout("titlemove()",140)
//}
//if (document.title)
//titlemove()

        function favoris() { 
            if ( navigator.appName != 'Microsoft Internet Explorer' )
            { window.sidebar.addPanel("pizzabynight.fr", "http://www.pizzabynight.fr", "pizzabynight.fr"); } 
            else { window.external.AddFavorite("http://www.pizzabynight.fr","pizzabynight.fr"); } } 

