﻿/*m - member id
fl - 0 | 1 if from legend
t - type b | t | p (public)
*/
function OpenLink(m, fl, t, dp){
	if(fl){
		if(t == 'b'){
			window.open(dp+'/themes/default/fbusiness.html', 'info', 'height=400,width=600');
		}
		else{
			//must be t
			window.open(dp+'/themes/default/ftechnician.html', 'info', 'height=400,width=600');			
		}
	}
	else if(m != '' && m > 0){
		if(t == 'b'){
			window.open(dp+'/themes/default/mbusiness.html', 'info', 'height=400,width=600');
		}
		else{
			//must be t
			window.open(dp+'/themes/default/mtechnician.html', 'info', 'height=400,width=600');			
		}	
	}
	else if(t == 'p'){
		alert('Member does not offer services to the general public.');
	}	

	return false;
}


function submitDynForm(fid){
	var l = document.getElementById(fid + "_l").value;
	l = l.toLowerCase();
	l = l.replace(/\s/g, '-');
	var fp = '';
	if(fid == "formusa"){
		fp = "usa/";
	}
	else if(fid == "formca"){
		fp = "canada/";
	}
	
	
	window.location = fp + l + ".html";
}