$(function() {
	
	
	$('.print-page').click(function(ev){
		ev.preventDefault();
		var docprint=window.open("",""); 
		docprint.document.write('<html><head><link href="/devlink/shared/css/print.css?v=1212" type="text/css" rel="stylesheet" /></head>');
		docprint.document.write('<body>' + $('.page-content').html() + '</body></html>');
		docprint.document.close(); 
	});

		$('#registration-link').click(function(ev){
		$('#modal-overlay').fadeIn();
		$('#register-box').fadeIn();
		
	})
	
	$('#register-box a').click(function(ev){
		$('#modal-overlay').fadeOut();
		$('#register-box').fadeOut();
	})
		$('#feature_block').animatedinnerfade({ 
           
            timeout:  parseInt(DataBridge.featureSettings.changeTime), 
            type: DataBridge.featureSettings.type, 
            containerheight: DataBridge.featureSettings.height + 'px', 
            containerwidth: DataBridge.featureSettings.width + 'px', 
            animationSpeed: parseInt(DataBridge.featureSettings.scrollSpeed), 
            animationtype: DataBridge.featureSettings.animationType,
			controlBoxClass: 'controls_overlay',
			controlBox: 'show',
			speed: parseInt(DataBridge.featureSettings.fadingSpeed)
		});
		
		
		$("a.feature-next").click(function(ev){
			 ev.preventDefault();
			 ev.target.blur();
    		 $("a.next-button").trigger('click');  
		});
		
		$("a.feature-back").click(function(ev){
			 ev.preventDefault();
			 ev.target.blur();
    		 $("a.back-button").trigger('click');  
		});
		
	//$('.social-bookmarks').bookmark({sites: ['google','facebook','digg','delicious','stumbleupon','reddit','myspace','yahoo'], title:$('#contentHeadline').html()});
	
	$('.bookmark_list li').corner();
	
	
	/*$('.parent-menu').click(function(ev){
		ev.preventDefault();
		ev.target.blur();
		id = $(this).getId();
		if($(this).findParent('li').hasClass('open')){
			$(this).findParent('li').removeClass('open');
			
		}else{
			clearMenu();
			$(this).findParent('li').addClass('open');
		}
		
		$('#subMenu-' + id).slideToggle();

	});*/
	
	function clearMenu(){
	
		$('.open .submenu').slideToggle();
		$(".open").removeClass('open');
	}
	
	
	$('.image-object-selection .prev').live('click',function(){
		if($(this).hasClass('disabled')) return false;
		
		id = $(this).getId();
		current = parseInt($('#' + id + '-object-current').html());
		$('#next-select-' + id).removeClass('disabled');
		next = current - 1;
		$('#' + id + '-object-list li:nth-child(' + current + ')').hide();
		$('#' + id + '-object-list li:nth-child(' + next + ')').show();
		
		$('#' + id + '-object-current').html(next);
		if(next == 1) $(this).addClass('disabled');
		return false;
		
	})
	
	$('.image-object-selection .next').live('click',function(){
		if($(this).hasClass('disabled')) return false;
		
		id = $(this).getId();
		current = parseInt($('#' + id + '-object-current').html());
		$('#prev-select-' + id).removeClass('disabled');
		next = current + 1;
		$('#' + id + '-object-list li:nth-child(' + current + ')').hide();
		$('#' + id + '-object-list li:nth-child(' + next + ')').show();
		
		$('#' + id + '-object-current').html(next);
		max =  parseInt($('#' + id + '-object-max').html());
		if(next== max) $(this).addClass('disabled');
		return false;
	})
	
	
	
})

