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 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 media(linkPage){
	url = linkPage;
	window.open(url,"media","width=789,height=540,resizable=no,scrollbars=no,status=no,menubar=no,location=no,toolbar=no");
}


function campus(linkPage){
	url = linkPage;
	window.open(url,"campus","width=561,height=330,resizable=no,scrollbars=no,status=no,menubar=no,location=no,toolbar=no");
}


function footer(linkPage){
	url = linkPage;
	window.open(url,"footer","width=864,height=540,resizable=yes,scrollbars=yes,status=yes,menubar=yes,location=yes,toolbar=yes");
}


function registration (url){
	 window.open('http://www.tcssc.com/member/register.php?EventLeagueID=323&PageAction=EventSummary','registration',					'width=800,height=600,resizable=yes,scrollbars=yes,status=yes,menubar=yes,location=yes,toolbar=yes');
}


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 += '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;
	}
}
