// JavaScript Document
function reflection(id,show){
	if($(id)){
		$(id).style.visibility = show;
	}
}

function ie7glitch(show){
	if($('third_nav')){
		$('third_nav').style.display = show;
	}
}

var languages = Array(
		"Change Language", // english
		"Cambie La Lengua", // spanish
		"Changez La Langue", // french
		"&Auml;ndern Sie Sprache", // german
		"Cambi La Lingua", // italian
		"Mude A L&iacute;ngua", // portugese
		"&#22793;&#26356;&#12398;&#35328;&#35486;" // japanese
	);
var num = 1;
var wait = 5000;

function changeLangs(){
	setTimeout("renameLang(languages[num],num)",wait);
}

function renameLang(str){
	for(i=0; i< languages.length; i++){
		if($('change_lang').innerHTML != str && i == num){
			new Effect.Opacity('change_lang', {to:0.0, duration: .5, queue: {position:'front', scope: 'lang'+i}, afterFinish: function(){
					Element.update('change_lang', str);
					new Effect.Opacity('change_lang', {to:1.0, duration: .5, queue:{position:'end', scope: 'lang'+i} });
				} });
		}
	}
	num = ((num + 1) < languages.length) ? (num + 1) : 0;
	setTimeout("renameLang(languages[num],num)",wait);
}

Event.observe(window, 'load', function(){
		changeLangs();
		if($("demo_video")){
			flashembed("demo_video", 
				/* 
					first argument supplies standard Flash parameters. See full list:
					http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
				*/
				{
					src:'/flash/flowplayer/FlowPlayerDark.swf',
					width: 400, 
					height: 290,					
					wmode: 'transparent',
					menu: 'false'
				},
				
				/*
					second argument is Flowplayer specific configuration. See full list:
					http://flowplayer.org/player/configuration.html
				*/
				{
					config: {   
						autoPlay:true,
						showMenu:false,
						watermarkUrl:'',
						controlBarGloss:'high',
						controlBarBackgroundColor:'0xE6242C',
						protected:true,
						loop:false,
						type:'swf',
						embedCode:'',
						initialScale: 'scale',
						maxPlayCount:1,
						videoFile: '/demo_file/view/?force=false'
					}
				}
			);
		}
		
		
		
		if($("crowding_video")){
			flashembed("crowding_video", 
				/* 
					first argument supplies standard Flash parameters. See full list:
					http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
				*/
				{
					src:'/flash/flowplayer/FlowPlayerDark.swf',
					width: 660, 
					height: 350,					
					wmode: 'transparent',
					menu: 'false'
				},
				
				/*
					second argument is Flowplayer specific configuration. See full list:
					http://flowplayer.org/player/configuration.html
				*/
				{
					config: {   
						autoPlay:false,
						showMenu:false,
						watermarkUrl:'',
						controlBarGloss:'high',
						controlBarBackgroundColor:'0xE6242C',
						protected:true,
						loop:false,
						type:'swf',
						embedCode:'',
						initialScale: 'scale',
						//videoFile: '/3dpreview/crowding/?force=false'
						videoFile: '/flash/3dpreview/Crowding1.flv'
					}
				}
			);
		}
		
		
		if($("braces_video")){
			flashembed("braces_video", 
				/* 
					first argument supplies standard Flash parameters. See full list:
					http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
				*/
				{
					src:'/flash/flowplayer/FlowPlayerDark.swf',
					width: 660, 
					height: 350,					
					wmode: 'transparent',
					menu: 'false'
				},
				
				/*
					second argument is Flowplayer specific configuration. See full list:
					http://flowplayer.org/player/configuration.html
				*/
				{
					config: {   
						autoPlay:false,
						showMenu:false,
						watermarkUrl:'',
						controlBarGloss:'high',
						controlBarBackgroundColor:'0xE6242C',
						protected:true,
						loop:false,
						type:'swf',
						embedCode:'',
						initialScale: 'scale',
						//videoFile: '/3dpreview/braces/?force=false'
						videoFile: '/flash/3dpreview/Braces1.flv'
					}
				}
			);
		}
		
		
	}
);

