/*
 * Public profile, theme (2) by Mike Kus.
 * http://zerply.com/
 * Copyright (c) 2010 Zerply Inc.
 */

$(document).ready(function() {

	/* Hover effect for "Other services" box*/
	$("div.service-box").mouseover(function(){
		base_link_color = $(this).children("a.service").css('color');
        $(this).addClass("active");
		$(this).children("a.service").css('color', '#fcfbf4');
	});
	$("div.service-box").mouseout(function(){
        $(this).removeClass("active");
		$(this).children("a.service").css('color', base_link_color);
	});
	
	/* Hover effect for "Short url" box*/	
	$("div#shorturl_pos").mouseover(function(){
		base_color = $(this).css('color');
		base_link_color = $(this).children("a").css('color');
        $(this).css({ 'background-color':'#303030' , 'color':'#fcfbf4' });
		$(this).children("a").css('color', '#fcfbf4');
	});
	$("div#shorturl_pos").mouseout(function(){
        $(this).css('background-color', '#fcfbf4');
		$(this).css('color', base_color);
		$(this).children("a").css('color', base_link_color);
	});
	
	/* Hover effect for "Contact" box*/
	$("#contact .spacer").not(".non").mouseover(function(){
        $(this).addClass('active');
		$(this).children("a").css('color', '#fcfbf4');
		$(this).find(".icon-off").css('display', 'none');
		$(this).find(".icon-on").css('display', 'inline');
	});
	$("#contact .spacer").not(".non").mouseout(function(){
        $(this).removeClass('active');
		$(this).children("a").css('color', '#fc3030');
		$(this).find(".icon-off").css('display', 'inline');
		$(this).find(".icon-on").css('display', 'none');
	});
	
	$(".btn-contact").click(function(){	
		$.scrollTo($('#contact'), { duration: 1100, axis: 'y' });
		return false;
	});
	
	$(".more-arrow").toggle(function(){	
			$(this).addClass("active");
			$(this).parent().parent().find(".max-content").animate({ "height": "toggle", "opacity": "toggle" }, 500);
			$.scrollTo((this), { duration: 500, offset: -300, axis: 'y' });
		},function(){	
			$(this).removeClass("active")
			$(this).parent().parent().find(".max-content").animate({ "height": "toggle", "opacity": "toggle" }, 500);
	});

	/* Load even more: exp and edu */
	$('.more-content.even-more').hide();	
	$(".btn-even-more").click(function(){	
		$.scrollTo((this), { duration: 500, offset: -300, axis: 'y' });
		$(this).parent('.more-content.even-more-box').css('display','none');
		$(this).parent().siblings('.more-content.even-more').animate({ "height": "toggle", "opacity": "toggle" }, 500);
	});

	/* Load even more: other servics */
	$(".btn-more-services").click(function(){
		$(this).css('display','none');
		$(this).siblings('#more-services').animate({ "opacity": "toggle" }, 500);
	});
	
	/* Upload a profile picture */
	$("#edit-profile-image").click(function(){	
		window.location = "/welcome/details/";
	});
	
});
