
function _addScript(src) {
	var obj = jQuery('<script type="text/javascript">');
	obj.attr('src', src);
	jQuery('head').append(obj);
}
function _addStyle(css) {
	var style = jQuery('<style type="text/css">');
	style.text(css);
	jQuery('head').append(style);
}
function isFontFaceSupported() {
	if (jQuery.browser.msie) {
		return false;
	}
	else if (jQuery.browser.safari && jQuery.browser.version.substr(0,3)=="532") {
		return true;
	}
	else if (jQuery.browser.opera && jQuery.browser.version.substr(0,4)=="9.80") {
		return true;
	}
	else if (jQuery.browser.mozilla && jQuery.browser.version.substr(0,5)=="1.9.1") {
		return true;
	}
	else {
		return false;
	}
}
function isFontAvailable(name) {
	name = name.replace(/['"<>]/g,'');

	var body  = document.body,
		test  = document.createElement('div'),
		installed = false,
		template =
			'<b style="display:inline !important; width:auto !important; font:normal 10px/1 \'X\',sans-serif !important">ii</b>'+
			'<b style="display:inline !important; width:auto !important; font:normal 10px/1 \'X\',monospace !important">ii</b>',
		ab;

	if (name) {
		test.innerHTML = template.replace(/X/g, name);

		test.style.cssText = 'position: absolute; visibility: hidden; display: block !important';

		body.insertBefore(test, body.firstChild);

		ab = test.getElementsByTagName('b');

		installed = ab[0].offsetWidth === ab[1].offsetWidth;

		body.removeChild(test);
	}

	return installed;
}
function SetFont(sel, family) {
	if (isFontFaceSupported()) {
		_addStyle(sel + ' {font-family:"' + family + '";}');
	}
	else if (Cufon) {
		Cufon.replace(sel, { fontFamily: family });
	}
}
