String.prototype.endsWith=function(a){return this.substring(this.length-a.length)==a?true:false};String.prototype.getExtension=function(){return this.substring(this.lastIndexOf(".",this.length-1)+1)};var supportedVideoFormats=["flv","wmv","avi","mpg","mpeg","asf"];var formatTester=new RegExp("^("+supportedVideoFormats.join("|")+")$","i");var allowedParentTags=["p","li"];var parentTagTester=new RegExp("^("+allowedParentTags.join("|")+")$","i");convertVideoAnchors=function(){var c=document.getElementsByTagName("a");var e=0;for(i=0;i<c.length;i++){var b=c[i].href;var f=b.getExtension();var d=c[i].target;if(formatTester.test(f)){if(d=="_self"){var a=c[i].parentNode;if(!parentTagTester.test(a.tagName)){continue}a.innerHTML="";a.id="playerContainer_"+(e++);i--;embedVideoPlayer(a.id,b)}else{if(d=="_blank"){c[i].href="javascript:playVideo('"+b+"')";c[i].target="_self"}}}}};embedVideoPlayer=function(d,b){var c=typeof(__WIDTH__)=="undefined"?400:__WIDTH__;var a=typeof(__HEIGHT__)=="undefined"?300:__HEIGHT__;if(b.endsWith(".flv")){AC_FL_RunContent("containerelementid",d,"codebase","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0","width",""+c,"height",""+a,"src","/eot/flash/flvplayer","quality","high","pluginspage","http://www.macromedia.com/go/getflashplayer","align","middle","play","true","loop","false","scale","showall","wmode","window","devicefont","false","id","flvplayer","bgcolor","#ffffff","name","flvplayer","menu","true","allowFullScreen","false","allowScriptAccess","sameDomain","flashVars","movie="+b,"movie","/eot/flash/flvplayer","salign","")}else{document.getElementById(d).innerHTML='<object id="playerobject" width="+width+" height="+height+" type="application/x-oleobject" standby="Loading Windows Media Player components..." classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"> <param name="AnimationatStart" value="false" /> <param name="TransparentatStart" value="true" /> <param name="ShowControls" value="true" /> <param name="ShowDisplay" value="true" /> <param name="ShowStatusBar" value="true" /> <param name="autoStart" value="true" /> <param name="stretchToFit" value="false" /> <param name="uiMode" value="none" /> <param name="filename" value="'+b+'" /> <param name="url" value="'+b+'" /> <param name="enableContextMenu" value="true"> <embed type="application/x-ms-wmp" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" filename="'+b+'" src="'+b+'" showcontrols="1" showdisplay="0" showstatusbar="1" enableContextMenu="1" width="+width+" height="+height+"></embed> </object> '}};playVideo=function(a){var b=window.open("","","width=700,height=500,scrollbars=yes,resizable=yes");b.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Video Player</title><script type="text/javascript" src="/eot/scripts/jquery-1.4.2.min.js"><\/script><script type="text/javascript" src="/eot/scripts/AC_RunActiveContent.js"><\/script><script type="text/javascript">__WIDTH__ = 640; __HEIGHT__= 385;<\/script><script type="text/javascript" src="/eot/scripts/gg.utils.video.js"><\/script></head><body><center><p id="playerContainer"><a href="'+a+'" target="_self"></a></p></center></body></html>');b.document.close()};embedYoutube=function(b,d,a){var c=window.open("","","width="+(100+d)+",height="+(60+a)+",scrollbars=yes,resizable=yes");c.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Video Player</title></head><body><center><p><object width="'+d+'" height="'+a+'"><param name="movie" value="'+b+'"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="'+b+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+d+'" height="'+a+'"></embed></object></body></html>');c.document.close()};jQuery(document).ready(function(){convertVideoAnchors()});
