document.createElement('header');
document.createElement('footer');
document.createElement('section');
document.createElement('aside');
document.createElement('nav');
document.createElement('article'); 
document.createElement('figure');
document.createElement('time');

jQuery.fn.anchorAnimate = function(settings) {
	settings = jQuery.extend({speed : 800 }, settings);
	return this.each(function(){
		var caller = this
		$(caller).click(function (event) {
			event.preventDefault()
			var locationHref = window.location.href
			var elementClick = $(caller).attr("href")
			var destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
				window.location.hash = elementClick
				$('nav li.active').removeClass('active');
				$(caller).parent().addClass('active');
			});

			return false;
		})
	})
};		


$(document).ready(function() {
	$("a.zoom").fancybox();

	$("a.zoom1").fancybox({
		'overlayOpacity'	:	0.7,
		'overlayColor'		:	'#FFF'
	});

	$("a.zoom2").fancybox({
		'zoomSpeedIn'		:	500,
		'zoomSpeedOut'		:	500
		
		});
		
	$("a.vimeo").click(function() {
	$.fancybox({
			'padding'		: 10,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		: 747,
			'height'		: 420,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
});
		
});



$(document).ready(function(){
		//just some regular style sheets. change them as you see fit
		var styling =".htmlres{cursor:pointer;color:#1C94FF;}" +
					  ".fill{display:block;}" +
					  ".opened{color:#6eb1ec;}" +
					  ".closed{color:#1C94FF;}";		
		//attach style to the page
		var style = document.createElement("style");
        style.type = "text/css";
        try {
            style.appendChild( document.createTextNode(styling) );
        } catch (e) {
            if ( style.styleSheet ) {
                style.styleSheet.cssText = styling;
            }
        }
        document.body.appendChild( style );
		//style all questions as closed
		$(".htmlres").addClass("closed"); 
		//make sure first question is styled as open
	   //$(".htmlres:first").removeClass("closed").addClass("opened"); 
		$(".fill").hide(); //hide answers
	//	$(".answer:first").show(); //show first answer
		//question click
		$(".htmlres").click(function() {
			$(".fill").slideUp("fast");
			$(".htmlres").removeClass("opened").addClass("closed");
	
			if ($(this).next(".fill").is(":hidden")) {
				$(this).next(".fill").slideDown("fast");
				$(this).removeClass("closed").addClass("opened");
			} 			   
		});
});

$(document).ready(function() {
	
	// makes my first link active
	$('nav li:first').addClass('active');
		
	// opens external links in a new tab
	$("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");
	
	// slide for internal links
	$('nav a.internal').anchorAnimate();
	
	
});
