$(document).ready(function(){	
	$("a[rel=lightbox]").lightBox({
		imageLoading:images.loading,
		imageBtnPrev:images.prev,
		imageBtnNext:images.next,
		imageBtnClose:images.close,
		imageBlank:images.blank,
		txtImage: '',
		txtOf: ''
	});
	

	function rgb2hex(rgb) 
	{
		
		if(rgb.substr(0,1) == '#')
			return '0x'+rgb.substr(1);
		
		 rgb = rgb.replace(/[rgb\)\(]/g,'').split(',');
		 function hex(x) {
		  hexDigits = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
		  return isNaN(x) ? "00" : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];
		 }
		return  '0x'+hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
	}
	
	$("#player").flash({  
		swf: 'resources/player/player-licensed.swf',
		width:375,
		height:300,
		flashvars: {
			file: "http://www.immoserver.ch/data/websites2/174/resources/player/video.flv",
			image: "images/player.jpg",
			autostart:"false"
			},
		params:{
				wmode: 				'opaque',
				allowfullscreen: 	'true',
				allowscriptaccess: 	'always'

			}
	});	
	
	
	$("h1").each(function(e){

		$(this).flash({  
			swf: 'resources/title.swf',
			width:555,
			height:45,
			flashvars: {
				text01: $(this).text()
				},
			params:{
					wmode: 'transparent'
				}
		});		
	});		
	
	

	$("ul.navigation a").each(function(e){

		$(this).flash({  
			swf: 'resources/navi.swf',
			width:197,
			height:28,
			flashvars: {
				text01: $(this).text(),
				link: $(this).attr('href'),
				color: rgb2hex($(this).css('color'))
				},
			params:{
					wmode: 'transparent'
				}
		});		
	});	

	$("ul.childs li.morelines a").each(function(e){

		$(this).flash({  
			swf: 'resources/subnavi.swf',
			width:175,
			height:40,
			flashvars: {
				text01: $(this).text(),
				link: $(this).attr('href'),
				color: rgb2hex($(this).css('color'))
				},
			params:{
					wmode: 'transparent'
				}
		});		
	});		

	$("ul.childs li:not(.morelines) a").each(function(e){

		$(this).flash({  
			swf: 'resources/subnavi_small.swf',
			width:175,
			height:20,
			flashvars: {
				text01: $(this).text(),
				link: $(this).attr('href'),
				color: rgb2hex($(this).css('color'))
				},
			params:{
					wmode: 'transparent'
				}
		});		
	});		
	
	
});