window.addEvent('domready', function() {

	// Tweening Color

	var colorwhite = $(document.body);	
	var myEffect = new Fx.Tween(colorwhite);
	$('white').addEvent('click', function(e) {
		e.stop();
		myEffect.start('background-color', '#fff');
        $('headerm').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/headermwhite.png) no-repeat bottom center')
	    $('header').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/headerbgwhite.png) repeat-x bottom')
	    $$('.but').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/buttonwhite.png) no-repeat bottom center')
	    $$('.buta').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/buttonwhitea.png) no-repeat bottom center')
	    $$('.butc').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/colorbuttonwhite.png) no-repeat bottom center')
	    $$('.white') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitchactive.gif) no-repeat top center')
	    $$('.grey') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitch.gif)')   
	    $$('.black') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitch.gif)')
	    $$('.dark') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitch.gif)')          
	    $('mycustomscroll').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/commentbgwhite.png)')
		$('comments').setStyle('color' , '#444')
		$('info').setStyles({background: '#fff', color: '#333'})
		$('infotitle').setStyles({background: '#ccc', color: '#333'})
		$('infocomment').setStyle('background' , '#ccc')
		$('sideright').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/siderightwhite.png) repeat-y left')
		$('topshadow') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/topshadowwhite.png) repeat-x')
		$('sideshadow') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/sideshadowwhite.png) repeat-y')
		$$('.vscrollerbar').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/vscrollerbgwhite.png) no-repeat center center')
		$('closeside').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/closesidewhite.png) no-repeat ')
		$('copyrightcon').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/copyrightbgwhite.png) top left no-repeat ')
	});
	
	var colorgrey = $(document.body);	
	var myEffect = new Fx.Tween(colorgrey);
	$('grey').addEvent('click', function(e) {
		e.stop();
        myEffect.start('background-color', '#b5b5b5');
 		$('headerm').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/headermwhite.png) no-repeat bottom center')
	    $('header').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/headerbgwhite.png) repeat-x bottom')
	    $$('.but').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/buttonwhite.png) no-repeat bottom center')
	    $$('.buta').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/buttonwhitea.png) no-repeat bottom center')
	    $$('.butc').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/colorbuttonwhite.png) no-repeat bottom center')
	    $$('.white') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitch.gif)')
	    $$('.grey') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitchactive.gif) no-repeat top center')   
	    $$('.black') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitch.gif)')
	    $$('.dark') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitch.gif)')
	    $('mycustomscroll').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/commentbgwhite.png)')
		$('comments').setStyle('color' , '#444')
		$('info').setStyles({background: '#fff', color: '#333'})
		$('infotitle').setStyles({background: '#ccc', color: '#333'})
		$('infocomment').setStyle('background' , '#ccc')
		$('sideright').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/siderightwhite.png) repeat-y left')
		$('topshadow') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/topshadowwhite.png) repeat-x')
		$('sideshadow') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/sideshadowwhite.png) repeat-y')
		$$('.vscrollerbar').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/vscrollerbgwhite.png) no-repeat center center')
		$('closeside').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/closesidewhite.png) no-repeat ')
		$('copyrightcon').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/copyrightbgwhite.png) top left no-repeat ')
    });

    var colorblack = $(document.body);	
	var myEffect = new Fx.Tween(colorblack);
	$('black').addEvent('click', function(e) {
		e.stop();
        myEffect.start('background-color', '#333');
        $('headerm').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/headerm.png) no-repeat bottom center')
        $('header').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/headerbgblack.png) repeat-x bottom')
		$$('.but').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/buttondark.png) no-repeat bottom center')
	    $$('.buta').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/buttonblacka.png) no-repeat bottom center')
	    $$('.butc').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/colorbuttondark.png) no-repeat bottom center')
	    $$('.white') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitch.gif)')
	    $$('.grey') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitch.gif)')   
	    $$('.black') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitchactive.gif) no-repeat top center')
	    $$('.dark') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitch.gif)')
	    $('mycustomscroll').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/commentbgdark.png)')
	    $('comments').setStyle('color' , '#888')
	    $('info').setStyles({background: '#000', color: '#ccc'})
	    $('infotitle').setStyles({background: '#333', color: '#fff'})
		$('infocomment').setStyle('background' , '#333')
		$('sideright').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/siderightblack.png) repeat-y left')
		$('topshadow') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/topshadowblack.png) repeat-x')
		$('sideshadow') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/sideshadowblack.png) repeat-y')
		$$('.vscrollerbar').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/vscrollerbgblack.png) no-repeat center center')		
		$('closeside').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/closesideblack.png) no-repeat ')
		$('copyrightcon').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/copyrightbgblack.png) top left no-repeat ')
    });

	var colordark = $(document.body);	
	var myEffect = new Fx.Tween(colordark);
	$('dark').addEvent('click', function(e) {
		e.stop();
		myEffect.start('background-color', '#111');
 		$('headerm').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/headerm.png) no-repeat bottom center')
        $('header').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/headerbgblack.png) repeat-x bottom')
		$$('.but').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/buttondark.png) no-repeat bottom center')
	    $$('.buta').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/buttonblacka.png) no-repeat bottom center')
	    $$('.butc').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/colorbuttondark.png) no-repeat bottom center')
	    $$('.white') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitch.gif)')
	    $$('.grey') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitch.gif)')   
	    $$('.black') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitch.gif)') 
	    $$('.dark') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/cswitchactive.gif) no-repeat top center')
	    $('mycustomscroll').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/commentbgdark.png)')
	    $('comments').setStyle('color' , '#888')
	    $('info').setStyles({background: '#000', color: '#ccc'})
	    $('infotitle').setStyles({background: '#333', color: '#fff'})
		$('infocomment').setStyle('background' , '#333')
		$('sideright').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/siderightblack.png) repeat-y left')
		$('topshadow') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/topshadowdark.png) repeat-x')
		$('sideshadow') . setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/sideshadowdark.png) repeat-y')
		$$('.vscrollerbar').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/vscrollerbgblack.png) no-repeat center center')
		$('closeside').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/closesideblack.png) no-repeat ')
		$('copyrightcon').setStyle('background' , 'url(http://mynicki.net/wp-content/themes/Nicki_V1/styles/images/copyrightbgblack.png) top left no-repeat ')	
    });

	
	// Morphing Colorbuttons	
	
	$$('.butc').each(function(el) {    
	    var fx = new Fx.Morph(el,{ duration:250, link:'cancel' });  
	    el.addEvents({  
	        'mouseenter': function() { fx.start({ 'margin-top': 6 }); },  
	        'mouseleave': function() { fx.start({ 'margin-top': 4 }); }  
	    });  
	});


// Morphing Info Panel	
	
$('info').set('morph', {
	duration: 680,
	transition: Fx.Transitions.Sine.easeInOut
	});
	
$('copyright').set('morph', {
	duration: 680,
	transition: Fx.Transitions.Sine.easeInOut
    });	

var el = $('info'),
color = el.getStyle('backgroundColor');
$('info').set('opacity', 0);
$('copyright').set('opacity', 0);
$$('.border').addEvents({
'mouseenter': function(){
			$('info').morph({
				'opacity': 0.85				
			});
			$('copyright').morph({
			'opacity': 0.85
			});
						
		},		
'mouseleave': function(){
			$('info').morph({
				'opacity': 0						
			});
			$('copyright').morph({
			'opacity': 0
			});
		}
	});

var myurl = document.URL;
var mysearch = myurl.search(/#comment/);
if(mysearch == -1) {      
   
	  
	} else {
		$('side').setStyle('margin-left', '0px');
		  $('closearrow').setStyle('display', 'block');  
		  $('sideclose').setStyle('display', 'block');
		  $('openarrow').setStyle('display', 'none');
		  $('sideopen').setStyle('display', 'none');  
	};


$('side').set('morph', {
	duration: 1300,
	transition: Fx.Transitions.Pow.easeOut,
	link: 'chain'
	});

$('sideopen').addEvents({
		'click': function(){
			$('side').morph({
			'margin-left': '0'
			});
			$('openarrow').morph({
			'display': 'none'
			});
			$('closearrow').morph({
			'display': 'block'
			});
			$('sideopen').morph({
			'display': 'none'
			});
			$('sideclose').morph({
			'display': 'block'
			});
		}
	});

$('sideclose').addEvents({
		'click': function(){
			$('side').morph({
			'margin-left': '-382px'
			});
			$('openarrow').morph({
			'display': 'block'
			});
			$('closearrow').morph({
			'display': 'none'
			});
			$('sideopen').morph({
			'display': 'block'
			});
			$('sideclose').morph({
			'display': 'none'
			});
			}
		});

$('noteit').addEvents({		
		'click': function(){	
			$('side').morph({
				'margin-left': '0px'
			});
			$('openarrow').morph({
			'display': 'none'
			});
			$('closearrow').morph({
			'display': 'block'
			});
			$('sideopen').morph({
			'display': 'none'
			});
			$('sideclose').morph({
			'display': 'block'
			});
			$('info').morph({
				'opacity': 0				
			});
		}
	});
});


document.write("<style type='text/css'>#photo {visibility:hidden;}</style>"); 
function initImage() {
	imageId = 'photo';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function fadeIn(objId,opacity) {
	if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity <= 100) {
			setOpacity(obj, opacity);
			opacity += 4;
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 25);
		}
	}
}
function setOpacity(obj, opacity) {
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}
window.onload = function() {initImage()}