
function init()
{
	
		//menu
		if($('menu1')) new EMenu('menu1');
	
	
		//scroller
		var pom = $("scroller1");
		if(pom)
		{
	
			var scr2 = new ScrollBar('scroller1', 'scroller1b', {
												'arrows': false,
												'hScroll': false
											});
		}
		
		/*// overlay
		overlay = new Element("div", {id: "overlay"} ).inject($(document.body)).setStyle("display", "block");
		overlay.setStyles({top: window.getScrollTop(), height: window.getHeight()});
		fx = {
			overlay: new Fx.Tween(overlay, {property: "opacity", duration: 500}).set(0)
		};
		fx.overlay.start(0.8).chain(function() {
											 overlay.set( 'styles', {'clip':' rect(200px 600px 600px 200px)'} );
											 }
											 
											 );*/
		
		

		
		
		// gall
if($("thumbsPanel"))
{
	

	
	
		
		var handles8_more = $$('#handles8_more span');
		var nS8 = new noobSlide({
			box: $('box8'),
			items: $$('#box8 h3'),
			size: 1016,
			handles: $$('#handles8 span'),
			addButtons: {previous: $('prev8'), next: $('next8') },
			onWalk: function(currentItem,currentHandle){
				//style for handles
				$$(this.handles).removeClass('active');
				$$(currentHandle).addClass('active');
				
			}
		});
		
		//nS8.addActionButtons('previous',$$('#box8 .prev'));
		//nS8.addActionButtons('next',$$('#box8 .next'));



		// img tween
		var container = $('galleryImgHolder');			// large image container					 
		var loadingCont = new Element('div', { 
									  	'styles' : {'position':'absolute','left':'0px','top':'0px','z-index':'1000','padding-top':'320px','width':'100%', 'font-size':'16px', 'font-family':'Arial', 'display':'none'},
										'html' : '<b>LOADING</b>'
											}).inject(container);
		

		var currentImage;
		var indexnew = 1;
		
		
		$$('.galleryThumbnail').each(function(el){
											  el.addEvent('mouseover', function(){
																				var fxOver = new Fx.Tween(el, { 'duration':290} );
																				fxOver.start('opacity',0.9).chain(  function() { fxOver.start('opacity', 1);  }  );
																		});
											  } );
		
		
		$$('.galleryThumbnailLink').each(function(item){ 
												  
  
	  	var bgW = new Element('div', { 'html' : '&nbsp;', 'styles': { 'position':'absolute', 'left':'7px', 'top':'0px', 'width':'112px', 'height':'70px', 'background-color':'#ffffff', 'z-index':'-2'  }  }).inject(item);
  
			item.addEvent('click', function(e) { 
				e = new Event(e).stop();
				
					loadingCont.set('styles', {'display':'block'} );
					
					//var newImage = new Element('img', {  'src': item.href, 'styles':{ 'position':'absolute', 'left':'0px', 'top':'0px', 'z-index':indexnew++ }   }); // create large image
					var newImage = Asset.image(item.href, {  /*styles:{ 'position':'absolute', 'left':'0px', 'top':'0px', 'z-index':indexnew++ },*/ onload: function(e){
																																								 
															//e.setStyles({ 'position':'absolute', 'left':'0px', 'top':'0px', 'z-index':indexnew++ });
															
															
															var fxLrg = new Fx.Morph(e, {duration: 300, transition: Fx.Transitions.Sine.easeOut});		
															
															fxLrg.start({ 
																'opacity' : 0													
															}).chain(function(){
																							
																loadingCont.set('styles', {'display':'none'} ); // hide "loading"
																
																																
															   var pomDiv2 = new Element('div', { 'html' : '', 'styles': { 'position':'absolute', 'left':'0px', 'top':'0px', 'width':'100%', 'height':'100%', 'z-index':indexnew++   }  });
															   
															  // pomDiv2.set( 'html', '<table width="100%"  border="0" cellspacing="0" cellpadding="0" height="100%"><tr><td align="center" valign="middle">'+e.inject()+'</td></tr><table>' );
															   
															   
															   e.inject(pomDiv2);
															   pomDiv2.inject(container);
																//e.inject(container); // insert new image
																
																fxLrg.start({'opacity': 1}).chain(function(){
																										   currentImage = e.clone(false, false);
																										   //currentImage.inject(container);
																										  // e.destroy();
																										   
																										   
																										   var pomDiv = new Element('div', { 'html' : '', 'styles': { 'position':'absolute', 'left':'0px', 'top':'0px', 'width':'100%', 'height':'100%', 'z-index':indexnew++   }  });
																										   currentImage.inject(pomDiv);
																										   pomDiv.inject(container);
																										   
																										   
																										   
																										   // add flash player
																											if(item.getProperty("videoFile") != "no")
																											{
																													
																													/*var flashvars = {};
																													flashvars.file = item.getProperty("videoFile");
																													flashvars.width = "340";
																													flashvars.height = "260";
																													
																													
																													swfobject.embedSWF("flvplayer.swf", "flvPlayer", "340", "260", "8.0.0", "expressInstall.swf", flashvars);
																													*/
																													
																													var flvStr = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="586" height="440"><param name="movie" value="flvplayer.swf" /><param name="FlashVars" value="file=' + item.getProperty("videoFile") + '&width=586&height=440&autostart=true" /><param name="quality" value="high" /><embed src="flvplayer.swf" FlashVars="file=' + item.getProperty("videoFile") + '&width=586&height=440&autostart=true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="586" height="440"></embed></object>';
																													var flvDiv = new Element("div", {'html' : flvStr});
																													$("flvPlayer").set("html", flvStr);
																											}
																										   
																										   
																										   
																										   
																										   
																										   });
															});
																																								 
																																								 
																																								 	}  });
					
					
					
					
					/*var fxLrg = new Fx.Morph(newImage, {duration: 300, transition: Fx.Transitions.Sine.easeOut});
					
					newImage.onload = function(){ 
						fxLrg.start({ 
							'opacity' : 0													
						}).chain(function(){
														
							loadingCont.set('styles', {'display':'none'} ); // hide "loading"
							
							newImage.inject(container); // insert new image
							
							fxLrg.start({'opacity': 1}).chain(function(){
																	   currentImage = newImage.clone(false, false);
																	   currentImage.inject(container);
																	   newImage.destroy();
																	   
																	   });
						});
					};*/
					
				
				
			});
		});



	
	

} // --
		
		
}




window.addEvent('domready', function(){init()});  // domready, load








