/*
*   schilleramplatz.de -- core.js
*   (c) 2011  Philipp Kleinhenz <zweistecken@lopho.org>
*   
*   Background clip text: SVG emulator
*   (c) 2011  Alexander Myadzel <mailbox@myadzel.ru>
*
*/
function backtext(){var p={xhtml:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink"};var e="background-clip";var s="position:relative;display:inline;width:auto;";var j="color:transparent;display:inline;position:relative;z-index:2;cursor:text;white-space:nowrap;vertical-align:baseline;";var i=[];var m=null;var n=0;var r={};function o(){if(b()){l()}}function b(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}function q(d){return document.getElementById(d)}function k(u,v){var t=(document.defaultView||window);var d=function(x){return x.toLowerCase().replace(/\-(\w)/g,function(){return arguments[1].toUpperCase()})};if(t.getComputedStyle){try{return t.getComputedStyle(u,null).getPropertyValue(v)}catch(w){}}else{if(u.currentStyle){return u.currentStyle[d(v)]}else{return u.style[d(v)]}}}function a(d){return parseFloat(k(d,"font-size"))+parseFloat(d.offsetHeight)+parseFloat(d.offsetWidth)}function l(){var F=document.getElementsByClassName(e);if(F.length){for(var y=0;y<F.length;y++){var G=F[y];G.setAttribute("style",s);var x=G.textContent;G.innerHTML="";var B=document.createElementNS(p.xhtml,"span");B.textContent=x;B.setAttribute("style",j+"height:"+G.offsetHeight+"px; width:"+G.offsetWidth+"px;");G.appendChild(B);var E=parseFloat(k(B,"width"));var u=parseFloat(k(B,"height"));var z=parseFloat(k(B,"font-size"));var t=document.createElementNS(p.svg,"svg");t.setAttribute("version","1.1");t.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns",p.svg);t.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",p.xlink);t.setAttribute("baseProfile","full");t.setAttribute("x","0");t.setAttribute("y","0");t.setAttribute("width",0);t.setAttribute("height",0);G.appendChild(t);B.setAttribute("style",j);var D=G.hasAttribute("onclick")?(G.onclick())["pattern"]:null;if(D){if(typeof r[D]=="undefined"){var d=document.createElementNS(p.svg,"defs");t.appendChild(d);var w=document.createElementNS(p.svg,"pattern");w.setAttribute("id","pattern_"+D);w.setAttribute("x","0");w.setAttribute("y","0");w.setAttribute("patternUnits","userSpaceOnUse");d.appendChild(w);var v=document.createElementNS(p.svg,"image");v.setAttributeNS(p.xlink,"xlink:href",D);v.setAttribute("x","0");v.setAttribute("y","0");w.appendChild(v);r[D]=true}}var A=document.createElementNS(p.svg,"text");A.textContent=x;A.setAttribute("x","0");A.setAttribute("y","0");A.setAttribute("font-size",z);A.setAttribute("dominant-baseline","text-before-edge");if(window.opera){A.setAttribute("textLength",E);A.setAttribute("y",z)}if(D){A.setAttribute("fill","url(#pattern_"+D+")")}t.appendChild(A);i.push({span:B,svg:t,text:A,pattern:w,image:v,img:null});if(D){var C=new Image();C.onload=(function(I,H){c(I,H)})(C,i[y]);C.src=D}G.setAttribute("style",j)}f()}}function c(t,d){(function(){if(t.complete&&t.width>0&&t.height>0){d.img=t;g(d)}else{setTimeout(arguments.callee,10)}})()}function g(t){t.pattern.setAttribute("width",t.img.width);t.pattern.setAttribute("height",t.img.height);t.image.setAttribute("width",t.img.width);t.image.setAttribute("height",t.img.height);t.svg.setAttribute("style","position: absolute; top: 0; left: 0; z-index: 1");t.span.setAttribute("style",j);var v=t.span.offsetWidth;var d=t.span.offsetHeight;var u=parseFloat(k(t.span,"font-size"));t.svg.setAttribute("width",v);t.svg.setAttribute("height",d);t.text.setAttribute("font-size",u)}function h(){for(var d=0;d<i.length;d++){g(i[d])}}function f(){m=document.createElementNS(p.xhtml,"span");m.id="fontsize-measurer";m.setAttribute("style","display: inline; position: absolute; left: -1000px; top:0;");m.innerHTML="&#160;";document.getElementsByTagName("body")[0].appendChild(m);n=a(m);(function(){var d=a(m);if(n!=d){h();n=d}setTimeout(arguments.callee,100)})()}o()}function stretch(d,a){var b=document.getElementById(d);var c=document.documentElement.clientHeight-a+window.pageYOffset;b.setAttribute("style","height:"+c+"px;")}window.onload=(function(){if((/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent))||(/MSIE (\d+\.\d+);/.test(navigator.userAgent))){}else{backtext()}stretch("links",260)});window.onresize=(function(){stretch("links",260)});window.onscroll=(function(){stretch("links",260)});


