﻿/* Window */

function centerWindowOnScreen() {
	if (navigator.appName=="Microsoft Internet Explorer") {
		ty = document.body.clientHeight; tx = document.body.clientWidth;}
	else {
		ty = window.innerHeight; tx = window.innerWidth;}
	x = screen.availWidth/2 - tx/2
	y = screen.availHeight/2 - ty/2
	self.moveTo(x,y);
}

function new_browser(src, name, w, h) { //v1.0
	size=", width="+w+", height="+h
	browser=window.open(src, name, "scrollbars=yes, resizable=yes, toolbar=no, titlebar=no, status=yes, menubar=no, location=no, directories=no" + size)
}

//ouvre une fenetre fille de taille fixe   
function new_browser3(src,name,w,h)
{
	size=",width="+w+",height="+h
	browser=window.open(src,name,"resizable=no,scrollbars=no,toolbar=no,status=no,menubar=no,location=0,directories=no"+size)
}	

function new_window(src, name, w, h) { //v1.0
	size=", width="+w+", height="+h
	browser=window.open(src, name, "scrollbars=yes, resizable=no, toolbar=no, titlebar=no, status=no, menubar=no, location=no, directories=no" + size)
}

function zoomMe(o) {
	var win = window.open('zoom.asp?image=' + o, 'zoom', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no,width='+ 640 +',height='+ 480);
}

function FermeLayer()
{
	document.getElementById("MsgHome").style.visibility="hidden";
}


function LanceCalendrier()
{
	new_browser('calendrier/default.asp?form=Coordonnees&Item=DateLivraison','calendrier','200','200');
}

function finalisation()
{
	if((!control(document.Coordonnees.DateLivraison, 'alpha'))||(document.Coordonnees.DateLivraison.value==""))
	{	
		alert("La date de livraison n'est pas renseignée. La commande ne peut pas être validée.");
	}
	else
	{
		document.Coordonnees.submit();
	}
}
