﻿var tvEls,j,i,clip;
tvEls = getElementsByClass("copySeason");
j=0;
ZeroClipboard.setMoviePath( 'http://www.sinlesslinks.com/zeroclipboard/ZeroClipboard.swf' );
if(!(window.clipboardData && clipboardData.setData))
{
	clip = new ZeroClipboard.Client();
	clip.setHandCursor( true );
	clip.setCSSEffects( true );
}
for(i in tvEls)
{
	if( window.clipboardData && clipboardData.setData )
	{
		tvEls[i].onclick = function() { 
		clipboardData.setData("Text", document.getElementById("hiddenLinks"+this.id).innerHTML.replace(/<a[^>]*>/gi,'').replace(/<\/a[^>]*>/gi,'').replace(/<br[^>]*>/gi, '\r\n'));
		};
	}
	else
	{
		tvEls[i].onmouseover = function() { 
			clip.setText( document.getElementById("hiddenLinks"+this.id).innerHTML.replace(/<a[^>]*>/gi,'').replace(/<\/a[^>]*>/gi,'').replace(/<br[^>]*>/gi, '\r\n') );
			if (clip.div) {
				clip.receiveEvent('mouseout', null);
				clip.reposition(this);
			}
			else clip.glue(this);
			
			
			// gotta force these events due to the Flash movie
			// moving all around.  This insures the CSS effects
			// are properly updated.
			clip.receiveEvent('mouseover', null);
		};
	}
	j++;
}
j=0;
tvEls = getElementsByClass("episodeNum");
for(i in tvEls)
{
	if( window.clipboardData && clipboardData.setData )
	{
		tvEls[i].onclick = function() { 
		clipboardData.setData("Text", document.getElementById("hiddenLinks"+this.id).innerHTML.replace(/<a[^>]*>/gi,'').replace(/<\/a[^>]*>/gi,'').replace(/<br[^>]*>/gi, '\r\n'));
		};
	}
	else
	{
		tvEls[i].onmouseover = function() { 
			clip.setText( document.getElementById("hiddenLinks"+this.id).innerHTML.replace(/<a[^>]*>/gi,'').replace(/<\/a[^>]*>/gi,'').replace(/<br[^>]*>/gi, '\r\n') );
			if (clip.div) {
				clip.receiveEvent('mouseout', null);
				clip.reposition(this);
			}
			else clip.glue(this);
			
			
			// gotta force these events due to the Flash movie
			// moving all around.  This insures the CSS effects
			// are properly updated.
			clip.receiveEvent('mouseover', null);
		};
	}
	j++;
}