////.hide("explode", 5000,'easeOutBounce','easeInOutCirc');

// start slider
    $(window).load(function() {
        $('#slider').nivoSlider();
		
    });		
	
			//// onlyps video 
			$(function(){
			var onlyps_video = "<iframe id='remove_vid' src='http://player.vimeo.com/video/22315266?title=0&amp;byline=0&amp;portrait=0&amp;color=420909&amp;autoplay=1' width='865' height='382' frameborder='0'></iframe>";
			$(".onlyps_play").click(function(){
			$("#onlyps_slider").hide();
			$("#onlyps_video").show('slow','easeOutBounce','easeInOutCirc');
			$("#the_vid").append(onlyps_video);
			});
			return false;
			});

			
			$(function(){
			$(".close_only_video").click(function(){
			$("#remove_vid").remove();
			$("#onlyps_slider").slideDown();
			$("#onlyps_video").fadeOut(1000,'easeOutBounce','easeInOutCirc').slideUp();
			});
			});
			// tooltip by luay salah

			function luay_salah_tooltip(target_items, name){
			 $(target_items).each(function(i){



					
	 if($(this).attr("title") != ""){ // checks if there is a title
	 
	 				$("body").append("<div class='"+name+"' id='"+name+i+"'><p>"+$(this).attr('title')+"</p></div>");
					var my_tooltip = $("#"+name+i);
	 
					$(this).removeAttr("title").mouseover(function(){
							my_tooltip.css({opacity:0.8, display:"none"}).fadeIn('slow');
					}).mousemove(function(kmouse){
							my_tooltip.css({left:kmouse.pageX+15, top:kmouse.pageY+15});
					}).mouseout(function(){
							my_tooltip.hide(400);
					});

					}
				});
			}

			$(document).ready(function(){
				 luay_salah_tooltip(".onlyps_tooltip","tooltip");
			});
			
			
			

			
			//// images effects
$(function(){
		  $("#only_ps_portfolio img, .serv_box img").hover(function() {
				$(this).stop().animate({ opacity: "none" , marginTop: "-10px" , marginBottom: "15px" }, 400);
			
			},function(){
				$(this).stop().animate({ opacity: "none" ,marginTop: "0" , marginBottom: "0" }, 200);
			
			});
				});
				
		

// onlyps menu

$(function(){
		  $("#main_menu a, #footer_menu a").hover(function() {
				$(this).stop().animate({ opacity: "0.5" , marginTop: "-5px" , marginBottom: "15px" }, 400);
			},function(){
				$(this).stop().animate({ opacity: "1" ,marginTop: "0" , marginBottom: "0" }, 200);
			return false
			});
				});
// onlyps sub menu	
  $(function() {
			$("#main_menu li").hover(function() {
			  $(this).find("ul").stop(true, true).slideDown('slow');
			}, function() {
			  $(this).find("ul").stop(true, true).slideUp('1000');
			});
			});

				
// when onlyps menu clicked 
$(function(){
		  $("#main_menu, #footer_menu").click(function() {
	$(this).hide("explode", 500);
		  });
		    });
			


			////////// get latest tweets
			
			var username='luay_salah'; // set user name
		var format='json'; // set format, you really don't have an option on this one
		var url='http://api.twitter.com/1/statuses/user_timeline/'+username+'.'+format+'?callback=?'; // make the url
$(function(){
			$.getJSON(url,function(tweet){ // get the tweets
				$("#latest-twittes").html(tweet[0].text); // get the first tweet in the response and place it inside the div
			});			
			});		
			
			
			// lets got top 
$(document).ready(function() {
 $('#go_top_only').click(function(){
 $('html, body').animate({scrollTop:0}, 5000,'easeOutBounce','easeInOutCirc');
 return false;
 });
});


