$(document).ready(function() {
	$('.iphone_next').click(function(){
		current_slide++;
		if(current_slide == slide_count) {
			current_slide = 0;
		}
		$(".iphone_slideshow_items").stop();
		$(".iphone_slideshow_items").animate({ 
	        marginLeft: '-'+current_slide*slide_width+"px",
	    }, 500);
	    return false;
	});
	$('.iphone_prev').click(function(){
		current_slide--;
		if(current_slide < 0) {
			current_slide = slide_count - 1;
		}
		$(".iphone_slideshow_items").stop();
		$(".iphone_slideshow_items").animate({ 
	        marginLeft: '-'+current_slide*slide_width+"px",
	    }, 500);
	    return false;
	});
	$('.iphone_next').mouseover(function(){
		$(this).css('paddingLeft','5px');
	});
	$('.iphone_next').mouseout(function(){
		$(this).css('paddingLeft','0px');
	});
	$('.iphone_prev').mouseover(function(){
		$(this).css('marginLeft','10px');
	});
	$('.iphone_prev').mouseout(function(){
		$(this).css('marginLeft','15px');
	});
	
	var slide_width = 210;
	var current_slide = 0;
	var slide_count = $('.iphone_slideshow_items li').size();
	if(slide_count != 0 || slide_count != undefined) {
		$('.iphone_slideshow_items').css('width',slide_width*slide_count+'px');
	}
	
	/*
	IPHONE APP NAV
	-------------------------------------------
	*/
	
	var tab_section_count = $('.tab_section').size();
	if(tab_section_count != 0) {
		$('.tab_section').each(function(){
			$(this).css('display','none');
		})
	}
	$($('.iphone_app_nav a:first').attr('href')).css('display','block');
	$('.iphone_app_nav a:first').addClass('active');
	
	$('.tabnav').click(function(){
		$('.tab_section').each(function(){
			$(this).css('display','none');
		})
		$('.tabnav').removeClass('active');
		$(this).addClass('active');
		$($(this).attr('href')).css('display','block');
		return false;
	});
	
	/*
	WORLD CLOCK
	------------------------------------------
	*/
	var oUTC   = { format: '%H:%M', utc: true, utc_offset: 0 }
	var oAthens = { format: '%H:%M', utc: true, utc_offset: +2 }
    jQuery('#jclock1').jclock(oUTC);
    jQuery('#jclock2').jclock(oAthens);
    
    
    $('.clicktoclose').click(function() {
        $(this).slideUp('slow');
    });
    
    /* SYNTAX HIGHLIGHTING */
    /*
    if(SyntaxHighlighter) {
        SyntaxHighlighter.config.clipboardSwf = 'http://inruntime.com/media/syntax/scripts/clipboard.swf';
		SyntaxHighlighter.all();
    }*/
});