/*
 * MyFonts Webfont Build ID 587082, 2011-02-13T17:38:30-0500
 * 
 * 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: Pirulen
 * Url: http://new.myfonts.com/fonts/larabie/pirulen/pirulen/
 * Foundry: Larabie
 * Copyright: (c) 2004-2009 Ray Larabie. See attached license agreement for more information. If EULA is missing, visit www.larabiefonts.com for an updated version of this font. Languages by Chikako Larabie
 * License: http://www.myfonts.com/viewlicense?1056
 * Licensed pageviews: unlimited/month
 * CSS font-family: PirulenRg-Regular
 * 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(woffEnabled) == 'undefined'){
	var woffEnabled = true;
}

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

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

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).*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;
}
//alert(webfontType);
switch (webfontType){
	
	case 'eot':
	document.write("<style>\n");
			document.write("@font-face {font-family:\"PirulenRg-Regular\";src:url(\"fonts/eot/pirulen.eot\");}\n");
			document.write("@font-face {font-family:\"SansationLight\";src:url(\"fonts/eot/Sansation_Regular-webfont.eot\");}\n");
			/*document.write("@font-face {font-family:\"SansationBold\";src:url(\"fonts/eot/Sansation_Bold-webfont.eot\");}\n");*/
			document.write("</style>");
	break;
	
	case 'woff':
	document.write("<style>");
	
	document.write("@font-face{\n");
	document.write("font-family:\"PirulenRg-Regular\";\n");
	document.write("src:url(\"fonts/woff/pirulen.woff\") format(\"woff\");\n }\n");
	
	document.write("@font-face{\n");
	document.write("font-family:\"SansationLight\";\n");
	document.write("src:url(\"fonts/woff/Sansation_Regular-webfont.woff\") format(\"woff\");\n }\n");
	
	/*document.write("@font-face{\n");
	document.write("font-family:\"SansationBold\";\n");
	document.write("src:url(\"fonts/woff/Sansation_Bold-webfont.woff\") format(\"woff\");\n }\n");*/
  	document.write("</style>");
	break;

	case 'data-css':
	document.write("<link rel='stylesheet' type='text/css' href='fonts/datacss/pirulen.css'>");
	document.write("<style>\n");
	document.write("@font-face{font-family:\"SansationLight\";src:url(\"fonts/ttf/Sansation_Regular-webfont.ttf\") format(\"truetype\");}");
	/*document.write("@font-face{font-family:\"SansationBold\";src:url(\"fonts/ttf/Sansation_Bold-webfont.ttf\") format(\"truetype\");}");*/
	document.write("</style>");
	break;

	case 'svg':
	document.write("<style>\n");
			document.write("@font-face {font-family:\"PirulenRg-Regular\";src:url(\"fonts/svg/pirulen.svg#PirulenRg-Regular\") format(\"svg\");}\n");
			document.write("@font-face {font-family:\"SansationLight\";src:url(\"fonts/svg/Sansation_Regular-webfont.svg#webfontJY9BDD6R\") format(\"svg\");}\n");
			/*document.write("@font-face {font-family:\"SansationBold\";src:url(\"fonts/svg/Sansation_Bold-webfont.svg#webfonth1l4beys\") format(\"svg\");}\n");*/
				document.write("</style>");
		break;
		
	default:
	break;
}


