   
/*** DOM READY ***/
	
window.addEvent('domready', function(){



		var initialLoad=1;
		var flashvars = {
				allowscriptaccess: "always",
				slogan: "LED technology",
				forside: "Home",
				omos: "About us",
				produkter: "Products",
				nyheder: "News",
				kontakt: "Contact",
				presse:"Press"};
		var params = {wmode:"opaque"};
		var attributes = {style: "background-color: transparent;z-index: 0;"};

		$('float-content').setOpacity(0);
		var iframe = $('content').effects({duration:500});
		var flashContainer = $('flash-container').effects({duration:500});		
		var footer = $('footer').effects({duration:500});
		var topMenu = $('top-menu').effects({duration:500});
		

             	iframe.set({'opacity':0});
      		flashContainer.set({'top': 220});
      		footer.set({'top': -170,'opacity':0});
      		topMenu.set({'opacity':0});
//dev_main_v0.9_dyn_slogan.swf

		swfobject.embedSWF("fileadmin/templates/movies/main_v1.1_nosound_noblur_blue_en.swf", "flashMovie", "766", "225", "8.0.0", "",flashvars,params,attributes);		
		
			//Morph Definition
			Fx.Morph = Fx.Styles.extend({
				 
					start: function(className){
				 
						var to = {};
				 
						$each(document.styleSheets, function(style){
							var rules = style.rules || style.cssRules;
							$each(rules, function(rule){
								if (!rule.selectorText.test('\.' + className + '$')) return;
								Fx.CSS.Styles.each(function(style){
									if (!rule.style || !rule.style[style]) return;
									var ruleStyle = rule.style[style];
									to[style] = (style.test(/color/i) && ruleStyle.test(/^rgb/)) ? ruleStyle.rgbToHex() : ruleStyle;
								});
							});
						});
						return this.parent(to);
					}
				 
				});
				 
				Fx.CSS.Styles = ["backgroundColor", "backgroundPosition", "color", "width", "height", "left", "top", "bottom", "right", "fontSize", "letterSpacing", "lineHeight", "textIndent", "opacity"];
				 
				Fx.CSS.Styles.extend(Element.Styles.padding);
				Fx.CSS.Styles.extend(Element.Styles.margin);
				 
				Element.Styles.border.each(function(border){
					['Width', 'Color'].each(function(property){
						Fx.CSS.Styles.push(border + property);
					});
				});

		
		
     	var myMorph = new Fx.Morph('float-content', {duration: 700,wait: true});	
  	
     	
      window.addEvent('loadContent',function(text,pageID){
              $('flashMovie').blur();
      	if (initialLoad==1) {
	iframe.set({'opacity':1});
        	flashContainer.start({'top': 0});
		footer.start({'top': -95});
		initialLoad = 0;
		
		//IE fix couldn't be missing:  Force a redraw to properly place elements.
      		setTimeout("window.focus();",200);
      	}
      
	$('content').src='index.php?id='+ pageID + '&L=2';
	// $('content').src='subpages-template.html';
	$('float-content').innerHTML=text;
	//$('content').style.display='block';

	myMorph.start('morph1').chain(function(){ 
		                   myMorph.start('morph2').chain(function(){ 
					                      $('spinner').style.display='block';
	                   					myMorph.start('morph3');
	                   				});
	                        });
       
      });	
	
/*** DOCUMENT LOAD ***/
	window.addEvent('load', function(){

	
      // Rounded borders      
 //	   roundFooter.render('footer');

      //iframe.set({'display':'none'});
      flashContainer.set({'top': 220});
      //footer.set({'top': -170,'opacity':0});
      //topMenu.set({'opacity':0});

      //(function(){ topMenu.slideIn();}).delay(5000); 

		});		
		}); 
		
function showContent(selector) {

       if (!window.frames['content'].src==''){
        $('content').contentWindow.document.burn(); 		
        }
        
        if(selector=='page0') {
		 window.fireEvent('loadContent',['Home','forside']);
          } 
          else if (selector=='page1') {
                 window.fireEvent('loadContent',['About us','omos']);      
          }	
             else if (selector=='page2') {
                 window.fireEvent('loadContent',['Products','produkter']);      
          }	
             else if (selector=='page3') {
                 window.fireEvent('loadContent',['News','nyheder']);      
          }	
             else if (selector=='page4') {
                 window.fireEvent('loadContent',['Contact','kontakt']);      
          }	
             else if (selector=='page5') {
                 window.fireEvent('loadContent',['Press','presse']);      
          }   else  {
                 
          }
      						
}

// Footer div rounded borders
var roundFooter = RUZEE.ShadedBorder.create({ corner:14, edges:"tbr",border:0});  
