// 02-2011 for GTF Ingo Preuss (http://www.germantype.com)


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


/* ------------- FontTester ----------------------------------------*/  

var fontsize=15;

function textSize(dec) {
fontsize+=(dec==1)?1:(-1);
if (fontsize<1) fontsize=1;
 document.getElementById("tt_start").style.fontSize=""+fontsize+"pt";
 document.getElementById("tt_abc").style.fontSize=""+fontsize+"pt";
 document.getElementById("tt_latin").style.fontSize=""+fontsize+"pt";
 document.getElementById("tt_cyril").style.fontSize=""+fontsize+"pt";
 document.getElementById("tt_greek").style.fontSize=""+fontsize+"pt";
}

/* ------------- FontTester-Switcher ----------------------------------------*/

var ids=new Array('tt_start','tt_abc','tt_latin','tt_cyril','tt_greek');

function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}


/* --------------------- JS Inverser Text -------------------------- */

function ViewInvers() {
if (
 document.getElementById("tt_abc").style.backgroundColor == "white") {
 document.getElementById("tt_abc").style.backgroundColor = "black";
 document.getElementById("tt_abc").style.color = "white";
}

if (
 document.getElementById("tt_latin").style.backgroundColor == "white") {
 document.getElementById("tt_latin").style.backgroundColor = "black";
 document.getElementById("tt_latin").style.color = "white";
}

if (
 document.getElementById("tt_cyril").style.backgroundColor == "white") {
 document.getElementById("tt_cyril").style.backgroundColor = "black";
 document.getElementById("tt_cyril").style.color = "white";
}

if (document.getElementById("tt_greek").style.backgroundColor == "white") {
 document.getElementById("tt_greek").style.backgroundColor = "black";
 document.getElementById("tt_greek").style.color = "white";
}

if (document.getElementById("tt_start").style.backgroundColor == "white") {
 document.getElementById("tt_start").style.backgroundColor = "black";
 document.getElementById("tt_start").style.color = "white";
}

else {
 document.getElementById("tt_start").style.backgroundColor = "white";
 document.getElementById("tt_start").style.color = "black";

 document.getElementById("tt_abc").style.backgroundColor = "white";
 document.getElementById("tt_abc").style.color = "black";
 
 document.getElementById("tt_latin").style.backgroundColor = "white";
 document.getElementById("tt_latin").style.color = "black";
 
 document.getElementById("tt_greek").style.backgroundColor = "white";
 document.getElementById("tt_greek").style.color = "black";
 
 document.getElementById("tt_cyril").style.backgroundColor = "white";
 document.getElementById("tt_cyril").style.color = "black";
 }
}

/* --------------------- Webfont Load Enhancer -------------------------- */

var EventHelpers=new function(){var me=this;var safariTimer;var isSafari=/WebKit/i.test(navigator.userAgent);var globalEvent;me.init=function(){if(me.hasPageLoadHappened(arguments)){return}if(document.createEventObject){globalEvent=document.createEventObject()}else{if(document.createEvent){globalEvent=document.createEvent("HTMLEvents")}}me.docIsLoaded=true};me.addEvent=function(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,false)}else{if(obj.attachEvent){obj["e"+evType+fn]=fn;obj[evType+fn]=function(){obj["e"+evType+fn](self.event)};obj.attachEvent("on"+evType,obj[evType+fn])}}};me.addPageLoadEvent=function(funcName){var func=eval(funcName);
/*@cc_on @*/
/*@if (@_win32)
         pageLoadEventArray.push(func);
         return;
         /*@end @*/
if(isSafari){pageLoadEventArray.push(func);if(!safariTimer){safariTimer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(safariTimer);me.runPageLoadEvents();return}set=true},10)}}else{if(document.addEventListener){var x=document.addEventListener("DOMContentLoaded",func,null)}else{me.addEvent(window,"load",func)}}};var pageLoadEventArray=new Array();me.runPageLoadEvents=function(e){if(isSafari||e.srcElement.readyState=="complete"){for(var i=0;i<pageLoadEventArray.length;i++){pageLoadEventArray[i]()}}};me.hasPageLoadHappened=function(funcArgs){if(funcArgs.callee.done){return true}funcArgs.callee.done=true};function init(){
/*@cc_on @*/
/*@if (@_win32)

         document.write('<script id="__ie_onload" defer src="' +

         ((location.protocol == 'https:') ? '//0' : 'javascript:void(0)') + '"><\/script>');

         var script = document.getElementById("__ie_onload");

         me.addEvent(script, 'readystatechange', me.runPageLoadEvents);

         /*@end @*/
}init()};EventHelpers.addPageLoadEvent("EventHelpers.init");var TypeHelpers=new function(){var a=this;a.hasSmoothing=function(){if(typeof(screen.fontSmoothingEnabled)!="undefined"){return screen.fontSmoothingEnabled}else{try{var c=document.createElement("canvas");c.width="35";c.height="35";c.style.display="none";document.body.appendChild(c);var b=c.getContext("2d");b.textBaseline="top";b.font="32px Arial";b.fillStyle="black";b.strokeStyle="black";b.fillText("O",0,0);for(var d=8;d<=32;d++){for(var f=1;f<=32;f++){var h=b.getImageData(f,d,1,1).data;var g=h[3];if(g!=255&&g!=0){return true}}}return false}catch(e){return null}}};a.insertClasses=function(){var b=a.hasSmoothing();var c=document.getElementsByTagName("html")[0];if(b==true){c.className+=" hasFontSmoothing-true"}else{if(b==false){c.className+=" hasFontSmoothing-false"}else{c.className+=" hasFontSmoothing-unknown"}}}};EventHelpers.addPageLoadEvent("TypeHelpers.insertClasses");(function(){var g=document,c=g.documentElement,a=g.createElement("style");if((c.style.MozTransform==="")||(c.style.OTransform==="")){a.textContent="body{visibility:hidden}";c.firstChild.appendChild(a);function b(){a.parentNode&&a.parentNode.removeChild(a)}addEventListener("load",b,false);setTimeout(b,3000)}})();

/* --------------------- Webfont Load Enhancer -------------------------- */
