window.onload = function() {
	setHoverMenus();
	endLoading();	
	setPhotoInfo();
}

// Background Photo Ingo
function setPhotoInfo(){
	$('#divPhotoInfo a').hover(function(){
		$('#divPhotoInfo span').fadeIn('fast');
		},
		function(){
		$('#divPhotoInfo span').fadeOut('fast');
	});
	
	$('#divPhotoInfo a.aShowBG').hover(function(){
		$('#divContent').fadeOut('fast');
		},
		function(){
		$('#divContent').fadeIn('fast');
	});
}

//Menu Hover Effect
function setHoverMenus(){
    
	$("#divHeader ul li").hover(function(){  
		$(this).children("ul").show();  
		$(this).addClass("hover");
    }, function(){    
        $(this).children("ul").hide();
		$(this).removeClass("hover");
    });

}

// Page loader hide function
function endLoading(){
	$('#divLoader div').hide();
	$('#divLoader span').html('loading done...');
	setTimeout(function(){$('#divLoader span').fadeOut('fast');},1500);
}

function getTwitterFeed(){
	var twurl = 'http://search.twitter.com/search.json';  
	var twuser = 'dorukeker'; // replace this with your Twitter username  
	$.ajaxSetup({ cache: true });  
	$.getJSON(twurl + '?callback=?&rpp=1&q=from:' + twuser,  
		function(data) {  
			$.each(data.results, function(i, tweet) {  
				if (tweet.text !== undefined) {
					var tweet = tweet.text;
					tweet = tweet.replace(/(^|\s)@(\w+)/g, '$1@<a href="http://www.twitter.com/$2">$2</a>');
				   	tweet = tweet.replace(/(^|\s)#(\w+)/g, '$1#<a href="http://search.twitter.com/search?q=%23$2">$2</a>');
					tweet = tweet.replace(/(http:\/\/[^ ]+)/g, '<a href=\"$1\">[here is the link]</a>');
					$('#divTweet span').html(tweet);  
				}  
			});  
		});  
}


