

/*
===========================================================================================

						ISSUE DROPDOWN FUNCS
						
===========================================================================================
*/

// - toggle the issue dropdown

$('#pastissues_link').click(function() {
	$('#pastissues_expanded').show();
	$('#pastissues_expanded').animate({opacity: 1,top: "0"}, "fast");
});


$('#past_close').click(function() {
	$('#pastissues_expanded').hide();
	$('#pastissues_expanded').animate({opacity: 0,top: "-10px"}, "fast");
});



/*
===========================================================================================

						SPECIALIZED BACKGROUND FUNCS
						
===========================================================================================
Essentially, the need to push the post-class which is nested, back UP to the page level
*/

/*
___________________________________________________________________
=================================================| ReturnSpecializedClass
FUNCTION to detect a specialized class and add a result to the page;
*/
function ReturnSpecializedClass(){
	var result = '';
	if( $('#article').hasClass('category-webcomics') ){
		
		
		if( $('#article').hasClass('tag-balls') ){
			result = 'specialballs';
		}
		
		
		
		
		
		
		
	}
	
	return result;

}


/*
___________________________________________________________________
=================================================| AddSpecializedClass
FUNCTION to add a specialized class to the master page
*/
function AddSpecializedClass(){
	$('#specialevent').addClass(ReturnSpecializedClass());
	
	//alert(ReturnSpecializedClass());
	
}

AddSpecializedClass();




/*
===========================================================================================

						IE7 Specific Funcs
						
===========================================================================================
isIE7 - variable set in header.php
*/

/*
___________________________________________________________________
=================================================| SetIEWarning
FUNCTION to set the text of the IE warning if its IE7 
NOTE: doing this to avoid the IE div spidering in google and showing in search results as site description
*/
function SetIEWarning(){
	var isIE7 = (document.all && !window.opera && window.XMLHttpRequest) ? true : false;
	

	if(isIE7) $('#IE7').html("You are using an outdated browser that is not supported by ComicBloc, Wordpress or Google. Please upgrade your browser. Certain features on the site will not work.");

}

SetIEWarning();

/*
===========================================================================================

						FOOTER Funcs
						
===========================================================================================
*/


/*
___________________________________________________________________
=================================================| ResizeFooter
FUNCTION to Resize the footer as appropriate
	230 is the hardcoded footer height - i put this here to keep this from flashing the page unnecessarily
*/

$(window).resize(function() {
	ResizeFooter();

});

function ResizeFooter(){
	var docHeight 	= $(document).height();
	var footer 		= $("#footer");
	var special		= $('#specialevent');
	var offset 		= footer.offset();
	var newHeight	= docHeight - offset.top;
	
	
	special.height(docHeight-newHeight);	// - you are here: need to make this its own function and get to fire without requiring page resize (for some reason its not working)
	
	if(newHeight > 290){
		footer.height(newHeight);
	}
		

}


ResizeFooter();


