function setSurvey(survey, value){
	var objsv = eval('document.forms[0].' + survey);
	if ( objsv ) {
		objsv.value = value;
	}
}


function skipField( field, next_field ) {
	try{
		if( field.value.length == field.maxLength ){
			var next = document.getElementById( next_field );
			next.focus();
			next.select();
		}
	}catch(err){
		return false;
	}	
	return true;
}


function isNumberKey(evt) {
   var charCode = (evt.which) ? evt.which : event.keyCode
   if (charCode > 31 && (charCode < 48 || charCode > 57))
      return false;
	  return true;
}


function disclaimer (url){
	window.open('disclaimer.asp?url='+url,'disclaimer','width=300,height=250');
}


function Switch_lang(ad) {
	if (ad.indexOf('/en/') != -1) {
		location.href=ad.substring(0,ad.indexOf('/en/'))+'/fr/'+ad.substring(ad.indexOf('/en/')+4);
	}
}


function openWindow(windowName, theUrl, width, height) {

	agent = navigator.userAgent;
	params  = '';
	params += 'toolbar=0,';
	params += 'location=0,';
	params += 'directories=0,';
	params += 'status=0,';
	params += 'menubar=0,';
	params += 'scrollbars=0,';
	params += 'top=0,';
	params += 'left=0,';
	params += 'resizable=0,';
	params += 'width=' + width + ',';
	params += 'height=' + height;

	win = window.open(theUrl, windowName , params);

	if (agent.indexOf('Mozilla/2') != -1 && agent.indexOf('Win') == -1) {
		win = window.open(url, windowName , params);
	}

	if (!win.opener) {
		win.opener = window;
		win.opener = right;
	}
	
}
