// pop-up function

var newWin = null;

function closeWin()
{
	if (newWin != null)
	{
		if(!newWin.closed)
			newWin.close();
	}
}

function writeHTML(a){document.write(a);}

function popUp(strURL,strType,strWidth,strHeight)
{
	closeWin();
	
	var strOptions="";
	if (strType=="console") 
		strOptions="resizable,height="+strHeight+",width="+strWidth;

	if (strType=="fixed") 
		strOptions="status,height="+strHeight+",width="+strWidth;

	if (strType=="elastic") 
		strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;

	if (strType=="scroll") 
		strOptions="scrollbars,resizable,height="+strHeight+",width="+strWidth;

	newWin = window.open(strURL, 'newWin', strOptions);

	newWin.focus();
}

function buildMail(strAddress, strUrl,style)
{
	document.write('<a hre' + 'f="mai' + 'lto:' + strAddress +'@' + strUrl + '" class="'+ style +'">' + strAddress +'@' + strUrl +'</a>') ;
}

function openWebCam(img, lang)
{
   window.open("/webcam.php?img=" + escape(img) + "&lang="+lang, "Webcams", "height=460, width=550, scrollbars=1, resizable=1");
}

function checkChampsPourFormBooking()
{
         var AgreeCourseBookingForm = document.getElementById("ok_AgreeCourseBookingForm");
        var ReadTermsAndConditions = document.getElementById("ok_ReadTermsAndConditions");
        
        if(ReadTermsAndConditions.checked && AgreeCourseBookingForm.checked)
        return true;
        else
        {
        	alert("You must accept the declarations.");
        	return false;
        }
}

