
var vuid=0;
var uid = function(){
	return vuid++ ;
}
/*
//menu highlght animation
var doBarAnimation = function(obj){
	var c = obj.parents('.bar').width() - 1;
	if(obj.length){
		c = (((obj.position().left - obj.parents('ul').position().left) + (obj.width() / 2)) - (204 / 2)) + 200;
		obj.addClass('mypos_' + c);
	}
	obj.parents('.bar').find('.high').removeClass('high');
	obj.parents('.bar').clearQueue().animate({backgroundPosition:c},800,'easeOutBounce',function(){
		obj.parents('.bar').find('.high').removeClass('high');
		obj.addClass('high');
	});
}
*/

//emulate popup function...
var popWindow = function(u,w,h,popEl){
	if(!popEl){
		e = u.substring(u.lastIndexOf('.')+1).toLowerCase();
		if(e == 'png' || e == 'gif' || e == 'jpg')
			popEl = $("<div class=\"popWindowDiv\" style=\"display:block;\"><img src=\""+ u +"\" width=\"" + w + "\" height=\"" + h + "\" border=\"0\" /></div>",{overlay:20});
		else
			popEl = $("<div class=\"popWindowDiv\" style=\"display:block;\"><iframe src=\""+ u +"\"  width=\"" + w + "\" height=\"" + h + "\" border=\"0\" frameborder=\"0\"></iframe></div>",{overlay:20});
	}
	popEl.modal({
			onOpen: function (dialog) {
						dialog.data.show();
						//dialog.data.addClass('alert');
						dialog.container.css('height','auto');
						dialog.overlay.fadeIn('normal', function () {
							dialog.container.show('normal', function () {
								//dialog.data.slideDown('normal'); // See Other Notes below regarding
														   // data display property and
														   // iframe details
							});
						});
					},
			onClose: function (dialog) {
						//dialog.data.slideUp('normal', function () {
						  dialog.container.hide('normal', function () {
							dialog.overlay.fadeOut('normal', function () {
							  $.modal.close(); // must call this to have SimpleModal
											   // re-insert the data correctly and
											   // clean up the dialog elements
							$('#alert').remove();
							});
						  });
						//});
					}
	});
	$("#modalContainer").css('width',w).css('margin-left',(w / 2) * -1).css('height',h).css('margin-top',(h / 2) * -1); 
}

	
$(document).ready(function(){
	
	$('#logo a').append('<img src="/domains/onkt.nl/images/onkt_logo.png" class="small" border="0" />');
	$('#logo').show('slow');
			
	//show content
	$('#container').animate({width:$('#bg_container').width()  - 250},'slow');
	
	//show player
	$('#bandcamp').fadeTo(2000,1,function(){$(this).animate({left:0},'slow')});

	//animate the background	
	$(document).mousemove(function(e){
		x = e.pageX /2;
		y = e.pageY /2;
		$('#bg_container').css('background-position',(x / 12) + 'px ' + (y / 12) + 'px');
		$('body').css('background-position',(x / 3) + 'px ' + (y / 3) + 'px');
	});

});

