
var isInEditMode = isInEditMode || false;
var undefined;

$(document).ready(function(){

	// HEADLINE REPLACEMENT
	var headline = $('#wrapper').find('.headline');
	if (headline.hasClass('img')) {
		var filename = headline.html();
		filename = filename.replace(/ /g,'-').toLowerCase();
		headline.html('<img src=" ' + imagePath + '/headlines/' + filename + '.png" alt="' + headline.html() + '" />')
	}
	
	//$('#wrapper').find('.headline').html('<img src="images/headlines/clever-websites.png" alt="Clever websites" />');
	
	// TOP MENU
	$('.top-mainmenu li a').click(function(){
		if ($(this).attr('href') == 'talk') {
			$('.bubble').fadeIn("fast");
			return false;
		}
	});
	$('.bubble-close').click(function(){
		$('.bubble').hide();
	});
	
	$('.top-mainmenu li img').parent().mouseover(function(){
		$(this).css('background', 'none');
	});
	
	// TOP SUBMENU
	$('#top .top-submenu li a:last')
		.css('border-radius-bottomleft', '7px').css('border-radius-bottomright', '7px')
		.css('-moz-border-radius-bottomleft', '7px').css('-moz-border-radius-bottomright', '7px')
		.css('-webkit-border-bottom-left-radius', '7px').css('-webkit-border-bottom-right-radius', '7px');
		
	$('.parent').click(function(){
		if ($('.top-submenu').css('display') == 'none') {
			$(this).css('background', '#4F4C45');
			$('.top-submenu').show();
		} else {
			$(this).css('background', 'none');
			$('.top-submenu').hide();
		}
		
		
		return false;
	});
	
	// START
	/*$('.front-product').mouseover(function(){
		$(this).css('cursor','pointer');
	}).click(function(){
		window.location = $(this).find('a').attr('href');
	});
	
	$('.front-play a').mouseover(function(){
		$(this).find('img').attr('src', imagePath + '/play-hover.png');
	}).mouseout(function(){
		$(this).find('img').attr('src', imagePath + '/play.png');
	});*/
	
	if (!isInEditMode) {
		$('.splash').mouseover(function(){
			$(this).css('cursor','pointer');
		}).click(function(){
			window.location = $(this).find('a').attr('href');
		});
	}
	
		
	
	// START - CASES
	/*$('.cases-white-left a').mouseover(function(){
		$(this).find('img').attr('src', imagePath + '/cases/left-hover.png');
	}).mouseout(function(){
		$(this).find('img').attr('src', imagePath + '/cases/left.png');
	});
	$('.cases-white-right a').mouseover(function(){
		$(this).find('img').attr('src', imagePath + '/cases/right-hover.png');
	}).mouseout(function(){
		$(this).find('img').attr('src', imagePath + '/cases/right.png');
	});*/
	
});