/**
 * $.include - script inclusion $ plugin
 * Based on idea from http://www.gnucitizen.org/projects/$-include/
 * @author Tobiasz Cudnik
 * @link http://meta20.net/.include_script_inclusion_$_plugin
 * @license MIT
 */
// overload $'s onDomReady
if ( $.browser.mozilla || $.browser.opera ) {
	document.removeEventListener( "DOMContentLoaded", $.ready, false );
	document.addEventListener( "DOMContentLoaded", function(){ $.ready(); }, false );
}
$.event.remove( window, "load", $.ready );
$.event.add( window, "load", function(){ $.ready(); } );
$.extend({
	includeStates: {},
	include: function(url, callback, dependency){
		if ( typeof callback != 'function' && ! dependency ) {
			dependency = callback;
			callback = null;
		}
		url = url.replace('\n', '');
		$.includeStates[url] = false;
		var script = document.createElement('script');
		script.type = 'text/javascript';
		script.onload = function () {
			$.includeStates[url] = true;
			if ( callback )
				callback.call(script);
		};
		script.onreadystatechange = function () {
			if ( this.readyState != "complete" && this.readyState != "loaded" ) return;
			$.includeStates[url] = true;
			if ( callback )
				callback.call(script);
		};
		script.src = url;
		if ( dependency ) {
			if ( dependency.constructor != Array )
				dependency = [dependency];
			setTimeout(function(){
				var valid = true;
				$.each(dependency, function(k, v){
					if (! v() ) {
						valid = false;
						return false;
					}
				})
				if ( valid )
					document.getElementsByTagName('head')[0].appendChild(script);
				else
					setTimeout(arguments.callee, 10);
			}, 10);
		}
		else
			document.getElementsByTagName('head')[0].appendChild(script);
		return function(){
			return $.includeStates[url];
		}
	},
	readyOld: $.ready,
	ready: function () {
		if ($.isReady) return;
		imReady = true;
		$.each($.includeStates, function(url, state) {
			if (! state)
				return imReady = false;
		});
		if (imReady) {
			$.readyOld.apply($, arguments);
		} else {
			setTimeout(arguments.callee, 10);
		}
	}
});


//



  
  			
				function onAfter(curr, next, opts, fwd) {
				//get the height of the current slide
				var $ht = $(this).height();
				//set the container's height to that of the current slide
				$(this).parent().animate({height: $ht});
				};
				

		$(document).ready(function(){
			$(".box").hover(function(){
				$(this).addClass("alt");
			}, function(){
				$(this).removeClass("alt");
			});
		});

  
  $(document).ready(function(){
		if ($("#fade").length) {	
			$('#fade').cycle({ 
				fx:     'fade', 
				speed:  'slow', 
				timeout: 6000, 
				speed: 2000,
				next:   '#next', 
				prev:   '#prev',
				after: onAfter
			});
		}
		$(function() {
			$('#prev img, #next img').animate({opacity:'1.0'},{queue:false,duration:0});
			$('#prev, #next').hover(function(){
				$(this).find('img').animate({opacity:'0.0'},{queue:false,duration:500});
			}, function(){
				$(this).find('img').animate({opacity:'1.0'},{queue:false,duration:500});
			});	
		});		
		
		$(function() {
	jQuery("span#gototop a").click( function() {
		jQuery.scrollTo(jQuery("#post"), 1000);
		return false;
	});
		});
		
	
	$('.blog')
		.css( {height: "58"} )
		.mouseover(function(){
			$(this).stop().animate({height:"76"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({height: "58"}, {duration:500})
		});
		
	});
	
		// coin slider
		$(document).ready(function(){
			if ($("#coin-slider").length) {
				$('#coin-slider').coinslider({
					width: 900, // width of slider panel
					height: 600 // height of slider panel
				});
			}
		});			
		
$(document).ready(function(){
$("div[class*='sthide']").hide();
$("a[class*='nextopen']").click(function(){
$(this).next().slideToggle('slow');
});
});
