// folder, open folder, and file menu thingy
$(function() {
	$('.postcomment>a.popup').unbind('click');
	$('.postcomment>a.popup').lightBox();
	//$('#content').height($('.maincontent'[2]).height()); /** The syntax may look weird, but it works */
	reassignCSSBasedOnBrowser();
});

// Folder actions
$(function() {
	$('li:has(ul)#archiveFolder, li:has(ul)#archiveFolderTop').click(function(event){
		if (this == event.target) {
			if ($(this).children().is(':hidden')) {
				$(this).css('background', 'transparent url(http://shoutinthecrowd.com/wp-content/themes/anewshout/img/folder-open-2.png) no-repeat 4px 4px')
				.children().show();
			} else {
				$(this).css('background', 'transparent url(http://shoutinthecrowd.com/wp-content/themes/anewshout/img/folder-closed-2.png) no-repeat 4px 4px')
				.children().hide();
			}
		}
	}).css('cursor', 'pointer').click();
	$('li:not(:has(ul))#archiveFile, li:not(:has(ul))#archiveFileTop').css({
		cursor: 'default',
		'background': 'transparent'
	});
});

// Header buttons rolloverz
$(function() {
	$('.rss_class').hover(function() {
		$(this).attr('src', 'http://localhost/~rhama_arya/arya199/wp-content/themes/anewshout/img/RSS%20copy.png');
	}, function() {
		$(this).attr('src', 'http://localhost/~rhama_arya/arya199/wp-content/themes/anewshout/img/RSS.png');
	});
	$('.facebook_class').hover(function() {
		$(this).attr('src', 'http://localhost/~rhama_arya/arya199/wp-content/themes/anewshout/img/Facebook-copy.png');
	}, function() {
		$(this).attr('src', 'http://localhost/~rhama_arya/arya199/wp-content/themes/anewshout/img/Facebook.png');
	});
	$('.twitter_class').hover(function() {
		$(this).attr('src', 'http://localhost/~rhama_arya/arya199/wp-content/themes/anewshout/img/Twitter-copy.png');
	}, function() {
		$(this).attr('src', 'http://localhost/~rhama_arya/arya199/wp-content/themes/anewshout/img/Twitter.png');
	});
	$('.contact_class').hover(function() {
		$(this).attr('src', 'http://localhost/~rhama_arya/arya199/wp-content/themes/anewshout/img/Contact-copy.png');
	}, function() {
		$(this).attr('src', 'http://localhost/~rhama_arya/arya199/wp-content/themes/anewshout/img/Contact.png');
	});
});

function reassignCSSBasedOnBrowser() {
	if ($.browser.version == "7.0") {
		$('.maincontent').css({"padding-top":"40px"});
	}
	if ($.browser.version == "6.0") {
	
alert("You're using an old version of i.e. while I wish to made this website"+
"as pervasive as possible, I'm sorry but your experience would surely be ruined"+
"if you use this lame excuse of a browser and it was way way too much of hassle"+
"for me to meticulously adjusted the elements. Thus, I'm sorry i.e. users, you're"+
"left out. Anyway, this website is best viewed with Mozilla Firefox or Safari");
		$('#buttonForm').css({"background":"transparent url(img/spyglass-model-win.png) no-repeat scroll 0 0"});
		$('.maincontent').css({"padding-top":"40px"});
		/*$('#postNavLeft').removeClass("postNavleft");
		$('#postNavLeft').addClass("postNavleftIE");
		$('#postNavRight').removeClass("postNavright");
		$('#postNavRight').addClass("postNavrightIE");*/
	}
}