function writeEmailAddress(to,at,link) {
	if ( typeof link == "undefined" ) {
		link = to + '@' + at;
	}
	document.write("<"+""+"a hre"+""+"f=" + "mail" + "to:" + to + "@" + at + ">" + link + "</"+"a>");
}

function recordOutboundLink(link, category, action) {
	try {
		var pageTracker=_gat._getTracker("UA-714626-1");
		pageTracker._initData();
		pageTracker._trackEvent(category, action);
	}catch(err){}
	setTimeout('window.open("' + link.href + '")', 100);
}

$(document).ready(function() {
	$('#uploadButton').uploadify({
		'uploader'  : '/scripts/jquery.uploadify-v2.1.4/uploadify.swf',
		'script'    : '/scripts/jquery.uploadify-v2.1.4/uploadify.php',
		'cancelImg' : '/scripts/jquery.uploadify-v2.1.4/cancel.png',
		'folder'    : '/uploads',
		'auto'      : true,
		'buttonText': 'Browse...',
		'fileExt'	: '*.gif;*.jpg;*.png;*.jpeg',
		'fileDesc'	: 'Photo files',
		'onComplete': function() {
			$('#uploadContainer').hide();
			$('#uploadThanks').show();
			setTimeout( function() {
				$('#submitContainer').dialog('close');
			}, 4000 );
		}
	});
	$('#submitContainer').dialog( {
		autoOpen: false,
		title: 'Submit something...',
		modal: true,
		open: function() {
			$('#uploadContainer').show();
			$('#uploadThanks').hide();
		}
	} );
});
