/* ----------------------------------------------------------------
 * FILE: jquery.plugins.js
 * ----------------------------------------------------------------
 * Created: 07-09-08 (dd-mm-yy)
 * Template: NightMedia
 * ----------------------------------------------------------------
 * DESCRIPTION:
 * Paste any javascript for jquery plugins that you use into
 * this file. By keeping everything in one file, it saves 
 * additional HTTP requests making your website that little 
 * bit quicker!
 * ---------------------------------------------------------------- 
*/

/**
 * reflection.js v1.9
 * http://cow.neondragon.net/stuff/reflection/
 * Freely distributable under MIT-style license.
 */
if(!document.myGetElementsByClassName){document.myGetElementsByClassName=function(d){var c=document.getElementsByTagName("*")||document.all;var e=new Array();for(var b=0;b<c.length;b++){var g=c[b];var f=g.className.split(" ");for(var a=0;a<f.length;a++){if(f[a]==d){e.push(g);break;}}}return e;};}var Reflection={defaultHeight:0.20,defaultOpacity:0.40,add:function(f,t){Reflection.remove(f);doptions={height:Reflection.defaultHeight,opacity:Reflection.defaultOpacity};if(t){for(var m in doptions){if(!t[m]){t[m]=doptions[m];}}}else{t=doptions;}try{var q=document.createElement("div");var b=f;var g=b.className.split(" ");var l="";for(j=0;j<g.length;j++){if(g[j]!="reflect"){if(l){l+=" ";}l+=g[j];}}var n=Math.floor(b.height*t.height);var k=Math.floor(b.height*(1+t.height));var s=b.width;if(document.all&&!window.opera){if(b.parentElement.tagName=="A"){var q=document.createElement("a");q.href=b.parentElement.href;}q.className=l;b.className="reflected";q.style.cssText=b.style.cssText;b.style.cssText="vertical-align: bottom";var h=document.createElement("img");h.src=b.src;h.style.width=s+"px";h.style.display="block";h.style.height=b.height+"px";h.style.marginBottom="-"+(b.height-n)+"px";h.style.filter="flipv progid:DXImageTransform.Microsoft.Alpha(opacity="+(t.opacity*100)+", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy="+(t.height*100)+")";q.style.width=s+"px";q.style.height=k+"px";b.parentNode.replaceChild(q,b);q.appendChild(b);q.appendChild(h);}else{var c=document.createElement("canvas");if(c.getContext){q.className=l;b.className="reflected";q.style.cssText=b.style.cssText;b.style.cssText="vertical-align: bottom";var a=c.getContext("2d");c.style.height=n+"px";c.style.width=s+"px";c.height=n;c.width=s;q.style.width=s+"px";q.style.height=k+"px";b.parentNode.replaceChild(q,b);q.appendChild(b);q.appendChild(c);a.save();a.translate(0,f.height-1);a.scale(1,-1);a.drawImage(f,0,0,s,f.height);a.restore();a.globalCompositeOperation="destination-out";var r=a.createLinearGradient(0,0,0,n);r.addColorStop(1,"rgba(255, 255, 255, 1.0)");r.addColorStop(0,"rgba(255, 255, 255, "+(1-t.opacity)+")");a.fillStyle=r;a.rect(0,0,s,n*2);a.fill();}}}catch(o){}},remove:function(a){if(a.className=="reflected"){a.className=a.parentNode.className;a.parentNode.parentNode.replaceChild(a,a.parentNode);}}};function addReflections(){var c=document.myGetElementsByClassName("reflect");for(i=0;i<c.length;i++){var b=null;var a=null;var d=c[i].className.split(" ");for(j=0;j<d.length;j++){if(d[j].indexOf("rheight")==0){var b=d[j].substring(7)/100;}else{if(d[j].indexOf("ropacity")==0){var a=d[j].substring(8)/100;}}}Reflection.add(c[i],{height:b,opacity:a});}}var previousOnload=window.onload;window.onload=function(){if(previousOnload){previousOnload();}addReflections();};