//HELPER FUNCTIONS

/* hide email address */
function safemail(name, domain, display) {
	displayed=(typeof(display)=="undefined") ? name+"@"+domain : display
	document.write('<a href=mailto:' + name + '@' + domain + '>' + displayed + '</a>');
};


// flash

function flash (w, h, fla, xml, id) {
	var flashHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
					+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ w +'" height="'+ h +'">'
					+ '<param name="movie" value="/assets/videos/'+ fla +'" />'
					+ '<param name="quality" value="high" />'
					+ '<param name="allowFullScreen" value="false" />'
					+ '<param name="scale" value="noscale" />'
					+ '<param name="wmode" value="transparent" />'
					+ '<param name="FlashVars" value="xmlfile=/assets/videos/' + xml + '&xmlfiletype=Default" />'
					+ '<embed src="/assets/videos/'+ fla +'" width="'+ w +'" height="'+ h +'" quality="high" '
					+ 'FlashVars="xmlfile=/assets/videos/' + xml + '&xmlfiletype=Default" '
					+ 'pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" allowfullscreen="false" scale="noscale">'
					+ '</embed></object>';

	$(id).html(flashHTML);		
			
}

// add thickbox css and parameters
function append_TB_params(id, w, h, modal) {
	
	//grab the href for the link and assign it to a variable
	var uri = $(id).attr("href");
	
	//add the thickbox class
	$(id).addClass('thickbox')
		
	//add the params for thickbox
	uri = uri+'?width='+ w +'&height='+ h;
	
	//add modal if modal varable is true
	if(modal) {
	
		uri = uri+'&modal=true';
	}
	
	//rewrite the uri
	$(id).attr("href",uri);
			
}