/* AUTEUR: iprim.i (c) 2000-2002 */

function check(fen) {
    if (window.name != fen) {
    top.location.href= "index.htm" ;
    }
    return ;
}

function Choix(vChoix,lat) {
    var libCie ; var idChoix ;
    libCie=top.choix.Cie[vChoix] ; 
    if (libCie=="") libCie="<I>spectacle ŕ préciser</I>" ;
    
    if (vChoix<10) idChoix="0" + vChoix ;
    else idChoix="" + vChoix ;

    if (lat==1) {
    top.infos.document.forms[0].imG.value = idChoix ;   
    top.infos.document.forms[0].legG.value = libCie ;   
    }
    else{
    top.infos.document.forms[0].imD.value = idChoix ;   
    top.infos.document.forms[0].legD.value = libCie ;   
    }
    top.infos.document.forms[0].submit();
    top.infos.focus();
    //return ;
}

function auto(num) {
    switch (num){
    case 1 :
    Choix(3,1) ;
    Choix(8,2) ;
    break ;
    default :  //dont case 0
    Choix(0,1) ;
    Choix(0,2) ;
    break ;
    }
}

function Fenetre(page,largeur,hauteur,options) {
  if (options==undefined) options="menubar=no,status=no,resizable=yes";
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  NewWindow = open("","iiPopup","") ;
  if (parent.name!="iiPopup") { NewWindow.close();}
  NewWindow = open("","iiPopup","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
  NewWindow.location = page ;
  NewWindow.focus();
  return;
}


function VersionNavigateur(Netscape, Explorer) 
{
  if ((navigator.appVersion.substring(0,3) >= Netscape && navigator.appName == 'Netscape') ||      
      (navigator.appVersion.substring(0,3) >= Explorer && navigator.appName.substring(0,9) == 'Microsoft'))
    return true;
else 
    return false;
}

function visuGf(fichier,tm,nomFen) {
    var options = "status=1,menubar=1,scrollbars=1,resizable=1" ;
    var hauteur = screen.height*0.7 ;
    var largeur = screen.width*0.8 ;
    var top=(screen.height-hauteur)/2 ;
    var left=(screen.width-largeur)/2 ;
    options = "screenX="+left+",screenY="+top+",width="+largeur+",height="+hauteur+","+options ;

    NewWindow = open("",nomFen,options) ;
    NewWindow.location.href = "visuGf.php?str="+fichier+"&tm="+tm ; 
    NewWindow.focus() ;
    
    return ;    
}
function navigUtil(ext) {

var frameTest="util" ;
if (!ext) ext="" ;
if (ext.substring(0,1)!="?") {
    if (top.frames[frameTest]) {
        top.frames[frameTest].location.href=frameTest+ext+".htm" ;
        }
    else {
        top.window.location.href="index"+ext+".htm" ;
        }
    }
else {
    if (top.frames[frameTest]) {
        top.frames[frameTest].location.href=frameTest+".php"+ext ;
        }
    else {
        top.window.location.href="index.htm"+ext ;
        }
    }

return  ;   
}

function clicSouris() {
    var f = window.event.offsetX ;
    var g = window.event.offsetY ;
    var a = window.event.srcElement.id ;
    var b = parseInt(document.getElementById('crea').style.width) ;
    var c = parseInt(document.getElementById('crea').style.height) ;
    switch (a) {
       case "zone" :
       f = Math.abs((200-f)*2) ;
       g = Math.abs((200-g)*2) ;
       break ; 
       case "crea2" :
       f = ((b/2)-f)*2 ;
       g = ((c/2)-g)*2 ;
       f = Math.abs(f) ;
       g = Math.abs(g) ;
       break ;  
       case "bleu" :
       f = 35 ;
       g = 35 ;
       break ;
    }
    document.getElementById('crea').style.width=Math.min(395,f);
    document.getElementById('crea').style.height=Math.min(395,g);
}

function affForm() {
    var b = parseInt(document.getElementById('crea').style.width) ;
    var c = parseInt(document.getElementById('crea').style.height) ;
    var a = "formul.php?sizeX="+b+"&sizeY="+c ;//alert
    Fenetre(a, 680, 480,"menubar=no,scrollbars=yes,status=yes,resizable=yes");
}
  
/* 
function iiMail(dest) {
var hostN = window.location.hostname ;
if (hostN!="www.iprimi.net") hostN+="/iprimicom" ;
else hostN ="www.iprimi.com" ;
hostN="http://"+hostN+"/eMail/mell2.php?dest="+dest ;
//alert(hostN);
Fenetre(hostN,600,400);
  return;
}
*/
