<!--

// popup a windows with given size
function popUp(URL, x, y)
{
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+x+",height=" + y + "');");
}

// get the current ptviewer applet
function getptv()
{
  var forAll='';
  if (document.ptviewer)
  {
    forAll = document.ptviewer;
  }
  else if (document.applets)
  {
    forAll = document.applets['ptviewer'];
  }
  else if (document.getElementById)
  {
    forAll = document.getElementById('ptviewer');
  }
  return forAll;
}

// create a cookie
function setCookie(name, value, days)
{
    if (!days) days = 1; // default to 1 day if empty
    var expdate = new Date();
    expdate.setTime(expdate.getTime() + days*24*60*60*1000);
    document.cookie = name + "=" + escape(value) + "; expires=" + expdate.toGMTString();
}

// form validation : number
function validateNumber(field, msg, min, max)
{
    if (!min) { min = 0 }
    if (!max) { max = 255 }
    if ( (parseInt(field.value) != field.value) ||
             field.value.length < min ||
             field.value.length > max)
    {
        alert(msg);
        field.focus();
        field.select();
        return false;
    }
    return true;
}

// form validation : string
function validateString(field, msg, min, max)
{
    if (!min) { min = 1 }
    if (!max) { max = 65535 }
    if (!field.value || field.value.length < min || field.value.length > max)
    {
        alert(msg);
        field.focus();
        field.select();
        return false;
    }
    return true;
}

// form validation : email
function validateEmail(email, msg, optional)
{
    if (!email.value && optional)
    {
        return true;
    }
    var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z]){2,}$/;
    if (!re_mail.test(email.value))
    {
        alert(msg);
        email.focus();
        email.select();
        return false;
    }
    return true;
}

function PutMail( which )
{
	switch (which)
	{
 		case 1 :
			var NM = "autopano";
			var DM = "kolor.com";
			break;
		default :
			var NM = "alexandre.jenny";
			var DM = "kolor.com";
			break;
	}
	var TXT = "<a href=\"mailto:" + NM + "@" + DM + "\">" + NM + "@" + DM + "</a>";
	document.write( TXT );
}

-->