﻿// IE PNG Fix 2.0
var IEPNGFix=window.IEPNGFix||{};IEPNGFix.tileBG=function(l,v,w){var t=this,W=t.data[l.uniqueID],X=Math.max(l.clientWidth,l.scrollWidth),V=Math.max(l.clientHeight,l.scrollHeight),K=l.currentStyle.backgroundPositionX,k=l.currentStyle.backgroundPositionY,q=l.currentStyle.backgroundRepeat;if(!W.tiles){W.tiles={elm:l,src:'',cache:[],img:new Image,old:{}}}
var i=W.tiles,c=i.img.width,C=i.img.height;if(v){if(!w&&v!=i.src){i.img.onload=function(){this.onload=null;IEPNGFix.tileBG(l,v,1)};return i.img.src=v}}else{if(i.src)w=1;c=C=0}
i.src=v;if(!w&&X==i.old.w&&V==i.old.h&&K==i.old.x&&k==i.old.y&&q==i.old.r){return}
var Q={top:'0%',left:'0%',center:'50%',bottom:'100%',right:'100%'},x,y,pc;x=Q[K]||K;y=Q[k]||k;if(pc=x.match(/(\d+)%/)){x=Math.round((X-c)*(parseInt(pc[1])/100))}
if(pc=y.match(/(\d+)%/)){y=Math.round((V-C)*(parseInt(pc[1])/100))}
x=parseInt(x);y=parseInt(y);var z={'repeat':1,'repeat-x':1}[q],repeatY={'repeat':1,'repeat-y':1}[q];if(z){x%=c;if(x>0)x-=c}
if(repeatY){y%=C;if(y>0)y-=C}
t.hook.enabled=0;if(!({relative:1,absolute:1}[l.currentStyle.position])){l.style.position='relative'}
var I=0,o,E=z?X:x+0.1,O,e=repeatY?V:y+0.1,R,r,Z;if(c&&C){for(o=x;o<E;o+=c){for(O=y;O<e;O+=C){Z=0;if(!i.cache[I]){i.cache[I]=document.createElement('div');Z=1}
var S=(o+c>X?X-o:c),s=(O+C>V?V-O:C);R=i.cache[I];r=R.style;r.behavior='none';r.left=o+'px';r.top=O+'px';r.width=S+'px';r.height=s+'px';r.clip='rect('+(O<0?0-O:0)+'px,'+S+'px,'+s+'px,'+(o<0?0-o:0)+'px)';r.display='block';if(Z){r.position='absolute';r.zIndex=-999;if(l.firstChild){l.insertBefore(R,l.firstChild)}else{l.appendChild(R)}}
t.fix(R,v,0);I++}}}
while(I<i.cache.length){t.fix(i.cache[I],'',0);i.cache[I++].style.display='none'}
t.hook.enabled=1;i.old={w:X,h:V,x:K,y:k,r:q}};IEPNGFix.update=function(){for(var i in IEPNGFix.data){var I=IEPNGFix.data[i].tiles;if(I&&I.elm&&I.src){IEPNGFix.tileBG(I.elm,I.src)}}};IEPNGFix.update.timer=0;if(window.attachEvent&&!window.opera){window.attachEvent('onresize',function(){clearTimeout(IEPNGFix.update.timer);IEPNGFix.update.timer=setTimeout(IEPNGFix.update,100)})}

/* jQuery functions */
$(document).ready(function(){
    $('a:has(img)').addClass('bnone');
	//$('#video-gallery > li:even').addClass('even');
    $('#signin .fld, #searchform .fld').focus(function(){
        if(this.value==this.defaultValue)this.value=''; $(this).parent().addClass('focus');
    }).bind('blur',function(){
        if(this.value=='')this.value=this.defaultValue; $(this).parent().removeClass('focus');
    });
});

