			
$(document).ready(function(){

	$('#nojs').remove();
	$('#menu-main>li>a').prepend('<span>ogk</span>');
	$('.blank').click(function(){ window.open(this.href);return false });	

	$('#menu-main>li>a').hover(
		function(){$(this).find('span').stop().fadeTo(100, 1);}, 
		function(){$(this).find('span').stop().fadeTo(500, 0);} 
	);
	 	
	$('#nav2 a').hover(
		function(){$(this).stop().animate({'color' : '#fff'}, 50);}, 
		function(){$(this).stop().animate({'color' : '#666'}, 300);	
	});		

	$('.tstmdiv').click(function(e){ e.preventDefault(); });
	if($(".btn-gal").length)
	{	
		$("a[rel=lbx]").fancybox({
				'transitionIn'		: 'fade',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
						return '<span id="fancybox-title-over">' +  (currentIndex + 1) + ' / ' + currentArray.length + '<\/span>';
			}			
		});
		$("a.iframe").fancybox({
			'width'				: 790,
			'height'			: '90%',
			'autoScale'			: false,
			'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'type'				: 'iframe',
			'scrolling'			: 'auto'	
		});		
	}
	if($("#dock").length)
	{
		$('#dock').cycle({
				fx: 'fade',
				timeout: 5000,
				next: '#next',
				speed: 2400,
				delay: 0
		});
	}
	if($("#form").length)
	{		
	 	$("#form").validate();		
	}
	
	screenshotPreview();
	
	$('a.screenshot').click(function() { return false; } );
});

var is = document.getElementsByTagName('input'), dv = [], dvt = [];

for (var i=0,len=is.length;i<len;i++) {
	dv.push(is[i].value);
	is[i].i = i;
	is[i].onclick = function () { if (this.value==dv[this.i]) this.value=''; };
	is[i].onblur = function() { if (!this.value) this.value = dv[this.i]; };
}

for (var i=0,tx=document.getElementsByTagName("textarea"),len=tx.length;i<len;i++) {
	dvt.push(tx[i].value);
	tx[i].i = i;
	tx[i].onclick = function () { if (this.value==dvt[this.i]) this.value=''; };
	tx[i].onblur = function() { if (!this.value) this.value = dvt[this.i]; };
}

