//begin functions to hide and display information
function iif(condition, string1, string2) {
	
	if(condition) return string1;
	return string2;
}

function displayHide(fieldName) {
	
		if(document.getElementById) {
			var d=document.getElementsByTagName('div');
			for(var i=0;i<d.length;i++)
				if(d[i].id==fieldName) {
					d[i].style.display=iif(d[i].style.display=='', 'none', '');
				}
		} else
			alert('Unable to hide!');

		plusfield = '_' + fieldName;
			
		if(document.getElementById) {
			var d=document.getElementsByTagName('span');
			for(var i=0;i<d.length;i++)
				if(d[i].id==plusfield) {
					d[i].innerHTML=iif(d[i].innerHTML=='-', '+', '-');
				}
		} else
			alert('Unable to hide!');
}
//end functions to hide and display information

function displayFullinfo()
{
	fullInfo.style.display = 'inline';
	shortInfo.style.display = 'none';
}

function displayShortinfo()
{
	fullInfo.style.display = 'none';
	shortInfo.style.display = 'inline';
}

function go_link_tool(page,width,height){
        if ((width < 1000) && (height < 1000)){
                window.open(page,"go_link_tool", "menubar=yes,toolbar=yes,scrollbars=yes,width=" + width + ",height=" + height + ",resizable=no")
        }
}

function go_link_no_tool(page,width,height){
        if ((width < 1000) && (height < 1000)){
                window.open(page,"go_link_no_tool", "scrollbars=yes,width=" + width + ",height=" + height + ",resizable=no")
        }
}

function go_link_tool_resize(page,width,height){
        if ((width < 1000) && (height < 1000)){
                window.open(page,"go_link_tool", "toolbar=yes,scrollbars=yes,width=" + width + ",height=" + height + ",resizable=yes")
        }
}

function go_link_no_tool_resize(page,width,height){
        if ((width < 1000) && (height < 1000)){
                window.open(page,"go_link_no_tool", "scrollbars=yes,width=" + width + ",height=" + height + ",resizable=yes")
        }
}

function windowCases(groupID, color, root) {
	var page = "http://www.fclaw.com/practices/rep-cases.cfm?groupID=" + groupID + "&color=" + color;
	window.open(page, 'NewDocument', 'width=500,height=380,scrollbars=yes,resizable=no,toolbar=no,menubar=no,location=no,left=150,top=200')
}

function windowClimateVideo(root) {
	var page = root + "/seminar/climate-video.cfm";
	window.open(page, 'NewDocument', 'width=362,height=252,scrollbars=no,resizable=no,toolbar=no,menubar=no,location=no,left=150,top=200')
}

function windowClimateListen(root, page) {
	var page = root + "/seminar/" + page;
	window.open(page, 'NewDocument', 'width=362,height=252,scrollbars=no,resizable=no,toolbar=no,menubar=no,location=no,left=150,top=200')
}

function windowWatch(root, page) {
	var page = root + "/seminar/" + page;
	window.open(page, 'NewDocument', 'width=362,height=252,scrollbars=no,resizable=no,toolbar=no,menubar=no,location=no,left=150,top=200')
}

function windowCOBRA(root, page) {
	var page = root + "/seminar/" + page;
	window.open(page, 'NewDocument', 'width=600,height=500,scrollbars=no,resizable=no,toolbar=no,menubar=no,location=no,left=50,top=50')
}

function validateEmailProfile(){
	with(document.emailprofile) {
		
		if(empty(txtToEmail.value)) return errorFocus("Please enter an Email Address.", txtToEmail);
		if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(txtToEmail.value))
		{
			alert("Please enter a valid email address.");  
			txtToEmail.focus();			
			return false;
		}	
		
		if(empty(txtFromEmail.value)) return errorFocus("Please enter an Email Address.", txtFromEmail);
		if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(txtFromEmail.value))
		{
			alert("Please enter a valid email address.");  
			txtFromEmail.focus();			
			return false;
		}

	
	}	
}

function mailDisclaimer(email, root)
{
     var url = root + '/email-disclaimer.cfm?nomenu=1&nohtml=1&email=' + email
     var windowOptions = 'width=600,height=500,scrollbars=yes,resizable=no,toolbar=no,menubar=no,location=no,left=150,top=200';
     var win = window.open(url,'_new', windowOptions);
}


//begin functions to hide and display information
function iif(condition, string1, string2) {
	
	if(condition) return string1;
	return string2;
}
