			
			
			
			function next() {
			// make the imagerotator jump to the next image.
			document.getElementById('rotator').sendEvent('next');
			};
			function prev() {
			// make the imagerotator jump to the next image.
			document.getElementById('rotator').sendEvent('prev');
			};
			/*function getlink() {
			document.getElementById('rotator').sendEvent('getlink');
			};*/
			
			
			$(document).ready(function() { 
			// on click event - creation of games pop ups and loading xml files.	
				bodyWidth = $("body").width();
				bodyHeight = $("body").height();
				position = {}
				
				position.left = bodyWidth/2 - 160;
				
				$('.gameBut').click(function() { 
				$.blockUI ({
				 message: $('#rotatorContainer'), css : {  border: '0px', width: '400px', left: position.left+"px", cursor: 'pointer'}, 
				 overlayCSS: { opacity:   0.7 },  fadeIn:  500, fadeOut:  500 } ); 
				 
				 file = $(this).attr("file");
				 createRotator(file);
				$("#browserTop > h2").text($(this).attr("title"));
				}); 
				
				$('#closeUI').click(function() { 
					$.unblockUI(); 
					return false; 
				});
				
			});
			
			
			function createRotator(file){
			var flashvars = {
			  'file':               file,
			  'transition':			'fade',
			  'shownavigation':		'false',
			  'shuffle':			'false',
			  'controlbar' : 'none',
			  'rotatetime' : '999',
			  'enablejs' : 'true',
			  'rotatetime': '1',
			  'repeat':   'false',
			  'showicons':   'false',
			  'logo':  undefined,
			  'width':  '400',
			  'height':  '320'
		   };

		   var params = {
			  'allowfullscreen':    'true',
			  'allowscriptaccess':  'always',
			  'bgcolor':            '#000000'
		   };

		   var attributes = {
			  'id':                 'rotator',
			  'name':               'rotator'
		   };
			
		   swfobject.embedSWF('/flash/imagerotator.swf', 'rotator', '400', '320', '9.0.124', 'false', flashvars, params, attributes);
		}
		
		
		