function playmovie(movie_file, blackboxpos)
{
	
	
	var BlackBoxScrollTop = document.body.scrollTop;

	if (BlackBoxScrollTop == 0)
	{
   	if (window.pageYOffset)
	      BlackBoxScrollTop = window.pageYOffset;
	   else
	   	BlackBoxScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
	}
	BlackBoxScrollTop = BlackBoxScrollTop + 15;	
	var screenwidth = document.documentElement.clientWidth;		
	var screenheight = document.documentElement.clientHeight;
	var whiteboxpos = (screenwidth / 2) - 385;
	
	$('white_content').set('html', '<table width="620"><tr><td colspan="2" align="center"><embed src="http://www.videodesk.net/embed/player.swf" allowscriptaccess="always" allowfullscreen="true" flashvars="height=390&amp;width=510&amp;file=http://www.videodesk.net/flv/45137/1105.flv&amp;searchbar=false&amp;repeat=list&amp;image=http://www.videodesk.net/flv/45137/1105.jpg&amp;volume=50&amp;autostart=true" width="520" height="390"><br><br><div id="productvideotextid" class="productvideotext">AB1100 Bill Counters</div></td></tr><tr><td align="left"><a href="#" onclick="javascript:morevideos();">More Videos</a></td><td align="right"><a href="#" onclick="javascript:closevideobox();">Close</a></td></tr></table>');
			
	$('shadow_content').setStyle('width', screenwidth);
	$('shadow_content').setStyle('height', blackboxpos);
	$('white_content').setStyle('left', whiteboxpos);
	$('white_content').setStyle('top', BlackBoxScrollTop);
		
	var myRequest = new Request({
		url: '/movies/movie.phtml',
		method: 'get',
		onSuccess: function(responseText, responseXML) {
			//alert(responseXML);
			$('white_content').set('html', responseText);
			
			// Allows time for page to load stops werid ani problems
			var myTimer = pageSucc.delay(500);
			
		}
	});
		
	myRequest.get({movie: movie_file});
		
	$('shadow_content').setStyle('display', 'block');
	$('white_content').setStyle('display', 'block');
	
	$('productvideotextid').morph({
		'opacity': 0.5
	});
	
	function pageSucc()
	{
		var scroll = new Fx.Scroll('videopopupbanner-wrapper', {
				wait: false,
				duration: 1500,
				transition: Fx.Transitions.Bounce.easeOut,
				wheelStops: false,
				parentDivElement: 'videopopupbanner'				
			});	
			$('videoarrowleft').addEvent('click', function(event) {
				scroll.toElement('videoproduct1');
			});
			$('videoarrowright').addEvent('click', function(event) {
				scroll.toElement('videoproduct3');
			});
			
			
			productimageshadow1 = $('productvideo1');
			productimageshadow2 = $('productvideo2');
			productimageshadow3 = $('productvideo3');
			//productimageshadow4 = $('productvideo4');
			productimageshadow5 = $('productvideo5');
			productimageshadow6 = $('productvideo6');
			productimageshadow7 = $('productvideo7');
			
			productimageshadow1sel = 'off';
			productimageshadow2sel = 'off';
			productimageshadow3sel = 'off';
			//productimageshadow4sel = 'off';
			productimageshadow5sel = 'off';
			productimageshadow6sel = 'off';
			productimageshadow7sel = 'off';
			
			currentvideoplaying = movie_file;									
			switch(movie_file){
				case 1105:
					productimageshadow1sel = 'on';
					$('videoproducttitle').set('html', 'AB1100' );
					scroll.toElement('videoproduct1');
					break
				case 1108:
					productimageshadow2sel = 'on';
					$('videoproducttitle').set('html', 'AB4000' );
					scroll.toElement('videoproduct1');
					break
				case 1106:
					productimageshadow3sel = 'on';
					$('videoproducttitle').set('html', 'AB5000PLUS' );
					scroll.toElement('videoproduct1');
					break
				case 1104:
					productimageshadow4sel = 'on';
					$('videoproducttitle').set('html', 'AB6000' );
					scroll.toElement('videoproduct1');
					break
				case 1107:
					productimageshadow5sel = 'on';
					$('videoproducttitle').set('html', 'D400' );
					scroll.toElement('videoproduct1');
					break
				case 1103:
					productimageshadow6sel = 'on';
					$('videoproducttitle').set('html', 'D500' );
					scroll.toElement('videoproduct3');
					break
				case 1101:
					productimageshadow7sel = 'on';
					$('videoproducttitle').set('html', 'D550' );
					scroll.toElement('videoproduct3');
					break
				default:
					productimageshadow1sel = 'on';
					$('videoproducttitle').set('html', 'AB1100' );
					scroll.toElement('videoproduct1');
					currentvideoplaying = 1105;
					break
			}
				
			if (productimageshadow1sel == 'off') productimageshadow1.fade(0.5);
			if (productimageshadow2sel == 'off') productimageshadow2.fade(0.5);
			if (productimageshadow3sel == 'off') productimageshadow3.fade(0.5);
			//if (productimageshadow4sel == 'off') productimageshadow4.fade(0.5);
			//if (productimageshadow5sel == 'off') productimageshadow5.fade(0.5);
			if (productimageshadow6sel == 'off') productimageshadow6.fade(0.5);
			//if (productimageshadow7sel == 'off') productimageshadow7.fade(0.5);
			
			startcontent = '<embed src="http://www.videodesk.net/embed/player.swf" allowscriptaccess="always" allowfullscreen="true" flashvars="height=390&amp;width=510&amp;file=http://www.videodesk.net/flv/45137/';
			endcontent = '&amp;searchbar=false&amp;repeat=list&amp;image=http://www.videodesk.net/flv/45137/1105.jpg&amp;volume=50&amp;autostart=true" width="520" height="390">';
			
			productimageshadow1.addEvents({
				'mouseenter': function() { this.fade(1); },
				'mouseleave': function() { if (productimageshadow1sel != 'on') this.fade(0.5); },
				'click': function() { 
					$('currentvideo').set('html', startcontent + '1105.flv' + endcontent );
					assign_video(1105); 
				}
			});
			
			productimageshadow2.addEvents({
				'mouseenter': function() { this.fade(1); },
				'mouseleave': function() { if (productimageshadow2sel	!= 'on') this.fade(0.5); },
				'click': function() { 
					$('currentvideo').set('html', startcontent + '1108.flv' + endcontent );
					assign_video(1108); 
				}
			});
			
			productimageshadow3.addEvents({
				'mouseenter': function() { this.fade(1); },
				'mouseleave': function() { if (productimageshadow3sel != 'on') this.fade(0.5); },
				'click': function() { 
					$('currentvideo').set('html', startcontent + '1106.flv' + endcontent ); 
					assign_video(1106);
				}
			});
			
			//productimageshadow4.addEvents({
			//	'mouseenter': function() { this.fade(1); },
			//	'mouseleave': function() { if (productimageshadow4sel != 'on') this.fade(0.5); },
			//	'click': function() { 
			//		$('currentvideo').set('html', startcontent + '1104.flv' + endcontent ); 
			//		assign_video(1104);
			//	}
			//});
			
			//productimageshadow5.addEvents({
			//	'mouseenter': function() { this.fade(1); },
			//	'mouseleave': function() { if (productimageshadow5sel != 'on') this.fade(0.5); },
			//	'click': function() { 
			//		$('currentvideo').set('html', startcontent + '1107.flv' + endcontent ); 
			//		assign_video(1107);
			//	}
			//});
			
			productimageshadow6.addEvents({
				'mouseenter': function() { this.fade(1); },
				'mouseleave': function() { if (productimageshadow6sel != 'on') this.fade(0.5); },
				'click': function() { 
					$('currentvideo').set('html', startcontent + '1103.flv' + endcontent ); 
					assign_video(1103);
				}
			});
			
			//productimageshadow7.addEvents({
			//	'mouseenter': function() { this.fade(1); },
			//	'mouseleave': function() { if (productimageshadow7sel != 'on') this.fade(0.5); },
			//	'click': function() { 
			//		$('currentvideo').set('html', startcontent + '1101.flv' + endcontent );
			//		assign_video(1101); 
			//	}
			//});
	}
	
	function assign_video(video_pressed)
		{
			if (video_pressed != currentvideoplaying)
			{
				switch(currentvideoplaying){
					case 1105:
						productimageshadow1.fade(0.5);
						productimageshadow1sel = 'off';
						break
					case 1108:
						productimageshadow2.fade(0.5);
						productimageshadow2sel = 'off';
						break
					case 1106:
						productimageshadow3.fade(0.5);
						productimageshadow3sel = 'off';
						break
					case 1104:
						productimageshadow4.fade(0.5);
						productimageshadow4sel = 'off';
						break
					case 1107:
						productimageshadow5.fade(0.5);
						productimageshadow5sel = 'off';
						break
					case 1103:
						productimageshadow6.fade(0.5);
						productimageshadow6sel = 'off';
						break
					case 1101:
						productimageshadow7.fade(0.5);
						productimageshadow7sel = 'off';
						break
				}
				
				switch(video_pressed){
					case 1105:
						productimageshadow1sel = 'on';
						$('videoproducttitle').set('html', 'AB1100' );
						break
					case 1108:
						productimageshadow2sel = 'on';
						$('videoproducttitle').set('html', 'AB4000' );
						break
					case 1106:
						productimageshadow3sel = 'on';
						$('videoproducttitle').set('html', 'AB5000PLUS' );
						break
					case 1104:
						productimageshadow4sel = 'on';
						$('videoproducttitle').set('html', 'AB6000' );
						break
					case 1107:
						productimageshadow5sel = 'on';
						$('videoproducttitle').set('html', 'D400' );
						break
					case 1103:
						productimageshadow6sel = 'on';
						$('videoproducttitle').set('html', 'D500' );
						break
					case 1101:
						productimageshadow7sel = 'on';
						$('videoproducttitle').set('html', 'D550' );
						break
				}
				
				currentvideoplaying = video_pressed;								
			}
		}
	
}

function closevideobox ()
{
	
	$('white_content').set('html', '');
	$('white_content').setStyle('display', 'none');	
	$('shadow_content').setStyle('display', 'none');
}	

function morevideos ()
{
	startcontent = '<table width="620"><tr><td colspan="2" align="center"><embed src="http://www.videodesk.net/embed/player.swf" allowscriptaccess="always" allowfullscreen="true" flashvars="height=390&amp;width=510&amp;file=http://www.videodesk.net/flv/45137/';
	endcontent = '&amp;searchbar=false&amp;repeat=list&amp;image=http://www.videodesk.net/flv/45137/1105.jpg&amp;volume=50&amp;autostart=true" width="520" height="390"><br><br><div id="productvideotextid" class="productvideotext">AB1100 Bill Counters</div></td></tr><tr><td align="left"><a href="#" onclick="javascript:morevideos();">More Videos</a></td><td align="right"><a href="#" onclick="javascript:closevideobox();">Close</a></td></tr></table>'; 
	$('white_content').set('html', '<table width="620"><tr><td colspan="3"><span class="cattext">&nbsp;Money Counters</span></td></tr><tr><td><img class="productimageshadow" id="productimageshadow1" src="/images/AB1100.jpg"></td><td><img  class="productimageshadow" id="productimageshadow2" src="/images/AB5000PLUS.jpg"></td><td><img class="productimageshadow" id="productimageshadow3" src="/images/AB4000.jpg"></td></tr><tr><td colspan="3"><img class="productimageshadow" id="productimageshadow4" src="/images/AB6000.jpg"></td></td></tr><tr><td colspan="3"><span class="cattext">&nbsp;Counterfeit Detectors</span></td></tr><tr><td><img class="productimageshadow" id="productimageshadow5" src="/images/D400.jpg"></td><td><img class="productimageshadow" id="productimageshadow6" src="/images/D500.jpg"></td><td><img class="productimageshadow" id="productimageshadow7" src="/images/D550.jpg"></td></tr><tr><tr><td colspan="3"><span class="cattext">&nbsp;Coin Counters</span></td></tr><tr><td><img class="productimageshadow" id="productimageshadow8" src="/images/AB410.jpg"></td></tr><td colspan="3" align="right" valign="bottom"><a href="#" onclick="javascript:closevideobox();">Close</a></td></tr></table>');
	
	var productimageshadow1 = $('productimageshadow1');
	var productimageshadow2 = $('productimageshadow2');
	var productimageshadow3 = $('productimageshadow3');
	var productimageshadow4 = $('productimageshadow4');
	var productimageshadow5 = $('productimageshadow5');
	var productimageshadow6 = $('productimageshadow6');
	var productimageshadow7 = $('productimageshadow7');
	var productimageshadow8 = $('productimageshadow8');
	
	productimageshadow1.fade(0.5);
	productimageshadow2.fade(0.5);
	productimageshadow3.fade(0.5);
	productimageshadow4.fade(0.5);
	productimageshadow5.fade(0.5);
	productimageshadow6.fade(0.5);
	productimageshadow7.fade(0.5);
	productimageshadow8.fade(0.5);
	
	productimageshadow1.addEvents({
		'mouseenter': function() { this.fade(1); },
		'mouseleave': function() { this.fade(0.5); },
		'click': function() { $('white_content').set('html', startcontent + '1105.flv' + endcontent ); }
	});
	productimageshadow2.addEvents({
		'mouseenter': function() { this.fade(1); },
		'mouseleave': function() { this.fade(0.5); },
		'click': function() { $('white_content').set('html', startcontent + '1106.flv' + endcontent ); }
	});
	productimageshadow3.addEvents({
		'mouseenter': function() { this.fade(1); },
		'mouseleave': function() { this.fade(0.5); },
		'click': function() { $('white_content').set('html', startcontent + '1108.flv' + endcontent ); }
	});
	productimageshadow4.addEvents({
		'mouseenter': function() { this.fade(1); },
		'mouseleave': function() { this.fade(0.5); },
		'click': function() { $('white_content').set('html', startcontent + '1104.flv' + endcontent ); }
	});
	productimageshadow5.addEvents({
		'mouseenter': function() { this.fade(1); },
		'mouseleave': function() { this.fade(0.5); },
		'click': function() { $('white_content').set('html', startcontent + '1107.flv' + endcontent ); }
	});
	productimageshadow6.addEvents({
		'mouseenter': function() { this.fade(1); },
		'mouseleave': function() { this.fade(0.5); },
		'click': function() { $('white_content').set('html', startcontent + '1103.flv' + endcontent ); }
	});
	productimageshadow7.addEvents({
		'mouseenter': function() { this.fade(1); },
		'mouseleave': function() { this.fade(0.5); },
		'click': function() { $('white_content').set('html', startcontent + '1101.flv' + endcontent ); }
	});
	productimageshadow8.addEvents({
		'mouseenter': function() { this.fade(1); },
		'mouseleave': function() { this.fade(0.5); },
		'click': function() { $('white_content').set('html', startcontent + '1109.flv' + endcontent ); }
	});

	// 'mouseenter': function() { this.tween('opacity', '1'); },
	// 'mouseleave': function() { this.tween('opacity', '0.5'); }
}
	
window.addEvent('domready', function(){		

	//var vert = new Fx.Sort($$('ul'), {
//		transition: Fx.Transitions.Back.easeInOut, 
		//duration: 1000
	//});
	//vert.sort([27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]); //specify a specific order
	//vert.forward(); //0,1,2,3,etc.
	
	
	
			
	
	document.addEvent('keydown', function(event) {
		event = new Event(event);
		if (event.key == 'esc')
		{
			closevideobox();
		}
	});
	 
	if ($('menucatsel1') != null)
	{		
		$('menucatsel1').addEvent('mouseenter', function(event) {
			$('menucatsel1').setStyle('background-color', '#CCCCCC');
			$('menucatseltext1').setStyle('color', '#FFFFFF');	
		});
		$('menucatsel1').addEvent('mouseleave', function(event) {
			$('menucatsel1').setStyle('background-color', '#FFFFFF');
			$('menucatseltext1').setStyle('color', '#999999');		
		});
	}
	
	if ($('menucatsel2') != null)
	{
		$('menucatsel2').addEvent('mouseenter', function(event) {
			$('menucatsel2').setStyle('background-color', '#CCCCCC');
			$('menucatseltext2').setStyle('color', '#FFFFFF');	
		});
		$('menucatsel2').addEvent('mouseleave', function(event) {
			$('menucatsel2').setStyle('background-color', '#FFFFFF');
			$('menucatseltext2').setStyle('color', '#999999');		
		});
	}
	
	if ($('menucatsel3') != null)
	{
		$('menucatsel3').addEvent('mouseenter', function(event) {
			$('menucatsel3').setStyle('background-color', '#CCCCCC');
			$('menucatseltext3').setStyle('color', '#FFFFFF');		
		});
		$('menucatsel3').addEvent('mouseleave', function(event) {
			$('menucatsel3').setStyle('background-color', '#FFFFFF');
			$('menucatseltext3').setStyle('color', '#999999');	
		});
	}
	
	if ($('menucatsel4') != null)
	{
		$('menucatsel4').addEvent('mouseenter', function(event) {
			$('menucatsel4').setStyle('background-color', '#CCCCCC');
			$('menucatseltext4').setStyle('color', '#FFFFFF');	
		});
		$('menucatsel4').addEvent('mouseleave', function(event) {
			$('menucatsel4').setStyle('background-color', '#FFFFFF');
			$('menucatseltext4').setStyle('color', '#999999');		
		});
	}
	
	if ($('menucatsel5') != null)
	{
		$('menucatsel5').addEvent('mouseenter', function(event) {
			$('menucatsel5').setStyle('background-color', '#CCCCCC');
			$('menucatseltext5').setStyle('color', '#FFFFFF');	
		});
		$('menucatsel5').addEvent('mouseleave', function(event) {
			$('menucatsel5').setStyle('background-color', '#FFFFFF');
			$('menucatseltext5').setStyle('color', '#999999');		
		});
	}
	
	if ($('menucatsel6') != null)
	{
		$('menucatsel6').addEvent('mouseenter', function(event) {
			$('menucatsel6').setStyle('background-color', '#CCCCCC');
			$('menucatseltext6').setStyle('color', '#FFFFFF');	
		});
		$('menucatsel6').addEvent('mouseleave', function(event) {
			$('menucatsel6').setStyle('background-color', '#FFFFFF');
			$('menucatseltext6').setStyle('color', '#999999');		
		});
	}
	
	if ($('menucatsel7') != null)
	{
		$('menucatsel7').addEvent('mouseenter', function(event) {
			$('menucatsel7').setStyle('background-color', '#CCCCCC');
			$('menucatseltext7').setStyle('color', '#FFFFFF');	
		});
		$('menucatsel7').addEvent('mouseleave', function(event) {
			$('menucatsel7').setStyle('background-color', '#FFFFFF');
			$('menucatseltext7').setStyle('color', '#999999');	
		});
	}
	
	if ($('menucatsel8') != null)
	{
		$('menucatsel8').addEvent('mouseenter', function(event) {
			$('menucatsel8').setStyle('background-color', '#CCCCCC');
			$('menucatseltext8').setStyle('color', '#FFFFFF');	
		});
		$('menucatsel8').addEvent('mouseleave', function(event) {
			$('menucatsel8').setStyle('background-color', '#FFFFFF');
			$('menucatseltext8').setStyle('color', '#999999');	
		});
	}
	
	if ($('menucatsel9') != null)
	{
		$('menucatsel9').addEvent('mouseenter', function(event) {
			$('menucatsel9').setStyle('background-color', '#CCCCCC');
			$('menucatseltext9').setStyle('color', '#FFFFFF');	
		});
		$('menucatsel9').addEvent('mouseleave', function(event) {
			$('menucatsel9').setStyle('background-color', '#FFFFFF');
			$('menucatseltext9').setStyle('color', '#999999');	
		});
	}
	
	if ($('menucatsel10') != null)
	{
		$('menucatsel10').addEvent('mouseenter', function(event) {
			$('menucatsel10').setStyle('background-color', '#CCCCCC');
			$('menucatseltext10').setStyle('color', '#FFFFFF');	
		});
		$('menucatsel10').addEvent('mouseleave', function(event) {
			$('menucatsel10').setStyle('background-color', '#FFFFFF');
			$('menucatseltext10').setStyle('color', '#999999');	
		});
	}
	
	if ($('menucatsel11') != null)
	{
		$('menucatsel11').addEvent('mouseenter', function(event) {
			$('menucatsel11').setStyle('background-color', '#CCCCCC');
			$('menucatseltext11').setStyle('color', '#FFFFFF');	
		});
		$('menucatsel11').addEvent('mouseleave', function(event) {
			$('menucatsel11').setStyle('background-color', '#FFFFFF');
			$('menucatseltext11').setStyle('color', '#999999');	
		});
	}
		
	
				
}); 

function lowtohigh()
{
		var vert = new Fx.Sort($$('h1'), {
			transition: Fx.Transitions.Circ.easeInOut, 
			duration: 1500
		});
		//vert.sort([3,2,1,0]); //specify a specific order
		vert.reverse();		
		//vert.sort([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]); //specify a specific order
}

function hightolow()
{
		var vert = new Fx.Sort($$('h1'), {
			transition: Fx.Transitions.Circ.easeInOut, 
			duration: 1500
		});
		vert.forward;		
		//vert.sort([3,2,1,0]); //specify a specific order
		//vert.sort([27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]); //specify a specific order

}

