/*
* @Name @Font-Face Properties
* @Utility Adds Font-face abilities to CSS
*/
/*------------------------------------------------------------------------------
Function:       eCSStender.font-face.js
Author:         Aaron Gustafson (aaron at easy-designs dot net)
Creation Date:  2009-10-09
Version:        0.1
Homepage:       http://github.com/easy-designs/eCSStender.font-face.js
License:        MIT License 
Note:           If you change or improve on this script, please let us know by
                emailing the author (above) with a link to your demo page.
------------------------------------------------------------------------------*/
(function(){var c=false,a=true,d=null,b,f;if(typeof eCSStender==b){return}f=eCSStender;f.onComplete(function(){var m={eot:c,ttf:"truetype",otf:"opentype",svg:"svg"},v,s=f.methods.svg_id||c,p=f.fonts,n=p.length,u,t,o,k,w,h,q="",x="@font-face { % } ",j="url('%')",e="format('%')",g=d;for(u=0;u<n;u++){w="";t=p[u];o=t.src.replace(/url\(\s*['"]?([^'"\s)]*)['"]?\s*\)/,"$1");t.src=["local('"+t["font-family"]+"')"];for(v in m){if(f.isInheritedProperty(m,v)){continue}file=o+"."+v;if(l(file)){if(v=="eot"){w+="src: "+j.replace("%",file)+"; "}else{if(v=="svg"&&s!=""){file+="#"+s}t.src.push(j.replace("%",file)+(m[v]!=c?" "+e.replace("%",m[v]):""))}}}t.src=t.src.join(", ");for(prop in t){if(f.isInheritedProperty(t,prop)){continue}w+=prop+": "+t[prop]+"; "}q+=x.replace("%",w)}f.embedCSS(q);function l(y){if(y==d){return c}if(g==d){g=new r()}g.open("GET",y,c);g.send(d);var i=d;do{if(g.readyState==4){i=g.status}}while(i==d);return i==200?a:c}function r(){var i;try{i=new XMLHttpRequest()}catch(y){try{i=new ActiveXObject("Msxml2.XMLHTTP")}catch(y){try{i=new ActiveXObject("Microsoft.XMLHTTP")}catch(y){i=c}}}return(!i)?d:i}})})();