<!--
var errors,s;

function calcHeight(the_iframe)
{
var the_height=document.getElementById(the_iframe).contentWindow.document.body.scrollHeight;//find the height of the internal page
var the_width=document.getElementById(the_iframe).contentWindow.document.body.scrollWidth;//find the width of the internal page
document.getElementById(the_iframe).style.height=the_height+20;//change the height of the iframe
//document.getElementById(the_iframe).style.width=the_width;//change the width of the iframe
}    


function trim(e) {return e.replace(/(^\s*)|(\s*$)/g, "");}

function minmaxstr(e,smin,smax)
{
  var l = trim(e);
  if ((l.length<smin) || (l.length>smax)) return false; else return true;
}

function do_search()
{
	if (minmaxstr(document.sform.r.value,3,50)==false) { alert(err_search);document.sform.r.focus(); return;}
	document.sform.submit();
	return;
}


function error(z){errors++;return ('\n- '+z);}

function link(e,w,target){var s = "/?lg="+lang+"&";if (e!='' || e!='0') s+="e="+e+"&";if (w!=0) s+="w="+w;if (target!="") s+="#"+target;window.location = s;}


function popwin(url)
{var newwindow;newwindow=window.open(url);if (window.focus) {newwindow.focus()}}

function popwin2(url,param)
{var newwindow;newwindow=window.open(url,'p',param);if (window.focus) {newwindow.focus()}}


function popup_callback()
{var nw=window.open('callback.aspx','callback','resizable=yes,scrollbars=no,menubar=no,width=400,height=400;');if (window.focus) {nw.focus()}}

function popchat()
{
    document.getElementById('chatdiv').style.display = 'block';
    myscroll('chatdiv');
    //var chatwindow=window.open("http://www.vitaleurope.com/chat.htm",'chat','scrollbars=auto,menubar=no,width=306,height=250;');if (window.focus) {chatwindow.focus()}
}

function closechat()
{
    //document.getElementById('chatdiv').innerHTML = '';
    document.getElementById('chatdiv').style.display = 'none';    
}

function send()
{
	errors=0;s='';
	var a = document.questionare;
	a1 = new text(a.firstname); if (!a1.length(2))  {a1.color(0);s+=error(err_fn);}
	a2 = new text(a.lastname);  if (!a2.length(2))  {a2.color(0);s+=error(err_ln);}
	a4 = new text(a.email);     if (!a4.isemail()) 	{a4.color(0);s+=error(err_email);}
	a5 = new text(a.telephone); if (!a5.istel()) 	{a5.color(0);s+=error(err_tel);}

    a.vld.value = "1";
	if (errors>0) {alert(err_head+'\n'+s);} else { a.submit();}
}


function text(i)
{
	if (i.value) this.value = i.value;
	this.trim = function(){return i.value.replace(/(^\s*)|(\s*$)/g, "");}
	this.istel = function(){var re = new RegExp('^[0-9 #()-\\/]+$');if (i.value.match(re)) return true;}
	this.isnum = function(){var re = new RegExp('^[0-9]');if (i.value.match(re)) return true;}
	this.isemail = function(){if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(i.value)) return true;}
	this.isdate = function(){var monthLength = new Array(31,28,31,30,31,30,31,31,30,31,30,31);z = i.split(',');var day= z[0];var month=z[1];var year=z[2];if (!day || !month || !year) return false;if (year/4 == parseInt(year/4)) monthLength[1] = 29;if (day > monthLength[month-1]) return false;monthLength[1] = 28;var now = new Date(); now = now.getTime();var dateToCheck = new Date();dateToCheck.setYear(year);dateToCheck.setMonth(month-1);dateToCheck.setDate(day);var checkDate = dateToCheck.getTime();if (!checkDate) return false; var futureDate = (now < checkDate);if (!futureDate) {return -2} else {return true;}}
	this.length = function(m){if (this.trim(i.value).length>=m) return true;}
	this.color = function(c){y='white';z='black';if (!c){y='orange';z='white'} i.style.background=y;i.style.color=z;}
	if (i.value) this.color(1);
}

function myscroll(thename) {
  var theTop = 0;
  var theHeight = 0;
  var objtop = 0;
  if (document.documentElement && document.documentElement.scrollTop)
  {
     theTop = document.documentElement.scrollTop;
     theHeight = document.documentElement.clientHeight;
  }
  else if (document.body)
  {
     theTop = document.body.scrollTop;
     theHeight = document.body.clientHeight;
  }
  theobj=document.getElementById? document.getElementById(thename):document.all.thename;
  thepoz = (theHeight / 2) + theTop - 100;
  objtop = theobj.style.top.replace('px','');
  if ((parseInt(objtop,10)<theTop) || (parseInt(objtop,10)>theTop + theHeight - 100))
    theobj.style.top=thepoz+'px';
}

function showyoutube(id,link) {
    var d = document.getElementById(id);
    d.innerHTML = '<object width="430" height="385"><param name="movie" value="http://www.youtube.com/v/' + link + '&hl=en&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + link + '&hl=en&fs=1&rel=0&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="430" height="385"></embed></object>';
    window.location.hash="pl";
    return false;
}

function lip_confirm()
{
    var iid = document.getElementById("cb_lip_ok");
    if (iid != null)
    {
        if (!iid.checked) 
        {
            alert('Please accept Trading Terms before booking!');
            return false;
        }
    }
    return true;
}

function start_patient_waiting_room_dvd() {

    var flashvars = {};
    var params = {};
    params.base = "http://www.invisalign.fr/SiteCollectionImages/media";
    params.allowFullScreen = "true";
    var attributes = {};
    swfobject.embedSWF("http://www.invisalign.fr/SiteCollectionImages/media/patient_waiting_room_FR.swf", "PatientWaitingRoom", "245", "193", "9.0.0", "http://www.invisalign.fr/SiteCollectionImages/media/expressInstall.swf", flashvars, params, attributes);
}

//-->
