/*
 * MyFonts Webfont Build ID 738513, 2011-03-29T16:29:57-0400
 * 
 * The fonts listed in this notice are subject to the End User License
 * Agreement(s) entered into by the website owner. All other parties are 
 * explicitly restricted from using the Licensed Webfonts(s).
 * 
 * You may obtain a valid license at the URLs below.
 * 
 * Webfont: Calluna Sans Regular
 * URL: http://new.myfonts.com/fonts/exljbris/calluna-sans/regular/
 * Foundry: exljbris
 * Copyright: Copyright (c) 2010 by Jos Buivenga. All rights reserved.
 * License: http://www.myfonts.com/viewlicense?1056
 * Licensed pageviews: 100,000/month
 * CSS font-family: CallunaSans-Regular
 * CSS font-weight: normal
 * 
 * Webfont: Calluna Sans Semibold Italic
 * URL: http://new.myfonts.com/fonts/exljbris/calluna-sans/semibold-ital/
 * Foundry: exljbris
 * Copyright: Copyright (c) 2010 by Jos Buivenga. All rights reserved.
 * License: http://www.myfonts.com/viewlicense?1056
 * Licensed pageviews: 100,000/month
 * CSS font-family: CallunaSans-SemiboldItalic
 * CSS font-weight: normal
 *
 * (c) 2011 Bitstream, Inc
*/

// safari 3.1: data-css
// firefox 3.6+: woff
// firefox 3.5+: data-css
// chrome 4+: data-css
// chrome 6+: woff
// IE 5+: eot
// IE 9: woff
// opera 10.1+: data-css
// mobile safari: svg/data-css
// android: data-css

var browserName, browserVersion, webfontType,  webfontTypeOverride;
 
if (typeof(customPath) == 'undefined')
	var customPath = false;


if (typeof(woffEnabled) == 'undefined')
	var woffEnabled = true;


if (/myfonts_test=on/.test(window.location.search))
	var myfonts_webfont_test = true;

else if (typeof(myfonts_webfont_test) == 'undefined')
	var myfonts_webfont_test = false;


if (customPath)
	var path = customPath;

else {
	var scripts = document.getElementsByTagName("SCRIPT");
	var script = scripts[scripts.length-1].src;

	if (!script.match("://") && script.charAt(0) != '/')
		script = "./"+script;
		
	var path = script.replace(/\\/g,'/').replace(/\/[^\/]*\/?$/, '');
}


if (myfonts_webfont_test)
	document.write('<script type="text/javascript" src="' +path+ '/MyFontsWebfontsOrderM2828222_test.js"></script>');


if (/webfont=(woff|ttf|eot)/.test(window.location.search))
{
	webfontTypeOverride = RegExp.$1;

	if (webfontTypeOverride == 'ttf')
		webfontTypeOverride = 'data-css';
}


if (/MSIE (\d+\.\d+)/.test(navigator.userAgent))
{
	browserName = 'MSIE';
	browserVersion = new Number(RegExp.$1);
	if (browserVersion >= 9.0 && woffEnabled)
		webfontType = 'woff';
	else if (browserVersion >= 5.0)
		webfontType = 'eot';
}
else if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))
{
	browserName = 'Firefox';
	browserVersion = new Number(RegExp.$1);
	if (browserVersion >= 3.6 && woffEnabled)
		webfontType = 'woff';
	else if (browserVersion >= 3.5)
		webfontType = 'data-css';
}
else if (/Chrome\/(\d+\.\d+)/.test(navigator.userAgent)) // must check before safari
{
	browserName = 'Chrome';
	browserVersion = new Number(RegExp.$1);

	if (browserVersion >= 6.0 && woffEnabled)
		webfontType = 'woff';

	else if (browserVersion >= 4.0)
		webfontType = 'data-css';
}
else if (/Mozilla.*(iPhone|iPad).* OS (\d+)_(\d+).* AppleWebKit.*Safari/.test(navigator.userAgent))
{
		browserName = 'MobileSafari';
		browserVersion = new Number(RegExp.$2) + (new Number(RegExp.$3) / 10)

	if(browserVersion >= 4.2)
		webfontType = 'data-css';

	else
		webfontType = 'svg';
}
else if (/Mozilla.*(iPhone|iPad|BlackBerry).*AppleWebKit.*Safari/.test(navigator.userAgent))
{
	browserName = 'MobileSafari';
	webfontType = 'svg';
}
else if (/Safari\/(\d+\.\d+)/.test(navigator.userAgent))
{
	browserName = 'Safari';
	if (/Version\/(\d+\.\d+)/.test(navigator.userAgent))
	{
		browserVersion = new Number(RegExp.$1);
		if (browserVersion >= 3.1)
			webfontType = 'data-css';
	}
}
else if (/Opera\/(\d+\.\d+)/.test(navigator.userAgent))
{
	browserName = 'Opera';
	if (/Version\/(\d+\.\d+)/.test(navigator.userAgent))
	{
		browserVersion = new Number(RegExp.$1);
		if (browserVersion >= 10.1)
			webfontType = 'data-css';
	}
}


if (webfontTypeOverride)
	webfontType = webfontTypeOverride;

switch (webfontType)
{
		case 'eot':
		document.write("<style>\n");
//				document.write("@font-face {font-family:\"CallunaSans-BoldItalic\";src:url(\"" + path + "/webfonts/eot/style_196635.eot\");}\n");
//				document.write("@font-face {font-family:\"CallunaSans-BlackItalic\";src:url(\"" + path + "/webfonts/eot/style_196636.eot\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-Italic\";src:url(\"" + path + "/webfonts/eot/style_196637.eot\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-Bold\";src:url(\"" + path + "/webfonts/eot/style_196638.eot\");}\n");
//				document.write("@font-face {font-family:\"CallunaSans-Black\";src:url(\"" + path + "/webfonts/eot/style_196639.eot\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-Semibold\";src:url(\"" + path + "/webfonts/eot/style_196640.eot\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-Regular\";src:url(\"" + path + "/webfonts/eot/style_196641.eot\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-SemiboldItalic\";src:url(\"" + path + "/webfonts/eot/style_196642.eot\");}\n");
//				document.write("@font-face {font-family:\"CallunaSans-LightItalic\";src:url(\"" + path + "/webfonts/eot/style_196643.eot\");}\n");
//				document.write("@font-face {font-family:\"CallunaSans-Light\";src:url(\"" + path + "/webfonts/eot/style_196644.eot\");}\n");
				document.write("</style>");
		break;
		
		case 'woff':
		document.write("<style>\n");
//				document.write("@font-face {font-family:\"CallunaSans-BoldItalic\";src:url(\"" + path + "/webfonts/woff/style_196635.woff\") format(\"woff\");}\n");
//				document.write("@font-face {font-family:\"CallunaSans-BlackItalic\";src:url(\"" + path + "/webfonts/woff/style_196636.woff\") format(\"woff\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-Italic\";src:url(\"" + path + "/webfonts/woff/style_196637.woff\") format(\"woff\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-Bold\";src:url(\"" + path + "/webfonts/woff/style_196638.woff\") format(\"woff\");}\n");
//				document.write("@font-face {font-family:\"CallunaSans-Black\";src:url(\"" + path + "/webfonts/woff/style_196639.woff\") format(\"woff\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-Semibold\";src:url(\"" + path + "/webfonts/woff/style_196640.woff\") format(\"woff\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-Regular\";src:url(\"" + path + "/webfonts/woff/style_196641.woff\") format(\"woff\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-SemiboldItalic\";src:url(\"" + path + "/webfonts/woff/style_196642.woff\") format(\"woff\");}\n");
//				document.write("@font-face {font-family:\"CallunaSans-LightItalic\";src:url(\"" + path + "/webfonts/woff/style_196643.woff\") format(\"woff\");}\n");
//				document.write("@font-face {font-family:\"CallunaSans-Light\";src:url(\"" + path + "/webfonts/woff/style_196644.woff\") format(\"woff\");}\n");
				document.write("</style>");
		break;
	
		case 'data-css':
		document.write("<link rel='stylesheet' type='text/css' href='" + path + "/webfonts/datacss/MyFontsWebfontsOrderM2828222.css'>");
		break;
	
		case 'svg':
		document.write("<style>\n");
//				document.write("@font-face {font-family:\"CallunaSans-BoldItalic\";src:url(\"" + path + "/webfonts/svg/style_196635.svg#CallunaSans-BoldItalic\") format(\"svg\");}\n");
//				document.write("@font-face {font-family:\"CallunaSans-BlackItalic\";src:url(\"" + path + "/webfonts/svg/style_196636.svg#CallunaSans-BlackItalic\") format(\"svg\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-Italic\";src:url(\"" + path + "/webfonts/svg/style_196637.svg#CallunaSans-Italic\") format(\"svg\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-Bold\";src:url(\"" + path + "/webfonts/svg/style_196638.svg#CallunaSans-Bold\") format(\"svg\");}\n");
//				document.write("@font-face {font-family:\"CallunaSans-Black\";src:url(\"" + path + "/webfonts/svg/style_196639.svg#CallunaSans-Black\") format(\"svg\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-Semibold\";src:url(\"" + path + "/webfonts/svg/style_196640.svg#CallunaSans-Semibold\") format(\"svg\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-Regular\";src:url(\"" + path + "/webfonts/svg/style_196641.svg#CallunaSans-Regular\") format(\"svg\");}\n");
				document.write("@font-face {font-family:\"CallunaSans-SemiboldItalic\";src:url(\"" + path + "/webfonts/svg/style_196642.svg#CallunaSans-SemiboldItalic\") format(\"svg\");}\n");
//				document.write("@font-face {font-family:\"CallunaSans-LightItalic\";src:url(\"" + path + "/webfonts/svg/style_196643.svg#CallunaSans-LightItalic\") format(\"svg\");}\n");
//				document.write("@font-face {font-family:\"CallunaSans-Light\";src:url(\"" + path + "/webfonts/svg/style_196644.svg#CallunaSans-Light\") format(\"svg\");}\n");
				document.write("</style>");
		break;
		
	default:
		break;
}

// added these for classability
if(webfontType in {'eot':'','woff':'','data-css':'','svg':''}) {
    document.write('<style>\n');
    document.write('.csBold { font-family: CallunaSans-Bold !important; }\n');
    document.write('.csItalic { font-family: CallunaSans-Italic !important; }\n');
    document.write('.csSemibold { font-family: CallunaSans-Semibold !important; }\n');
    document.write('.csSemiboldItalic { font-family: CallunaSans-SemiboldItalic !important; }\n');
    document.write('.csRegular { font-family: CallunaSans-Regular !important; }\n');
    document.write('</style>\n');
}
