/*
Alexandru Vita Scripts File

This file should contain any js scripts you want to add to the site.
Instead of calling it in the header or throwing it inside wp-head()
this file will be called automatically in the footer so as not to 
slow the page load.

*/

var scrolltotop={
	setting: {scrollto: 0, scrollduration:1000},
	anchorkeyword: '#top', //Enter href value of HTML anchors on the page that should also act as "Scroll Up" links

	scrollup:function(){
		if (typeof dest=="string" && jQuery('#'+dest).length==1) //check element set by string exists
			dest=jQuery('#'+dest).offset().top
		else
			dest=0
		this.$body.animate({scrollTop: dest}, this.setting.scrollduration);
	}
	
}
		
// as the page loads, cal these scripts
$(document).ready(function() {

	
	$(".photoshelter ul.thumbs li:nth-child(4n+5)").before('<div style="clear:left;line-height:0;height:0;opacity:0.1;width:960px;">&nbsp;</div>');
			
	
	var mainobj=scrolltotop
	var iebrws=document.all
	mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode
	mainobj.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body')
	
	$('a[href="' + mainobj.anchorkeyword +'"]').click(function(){
		mainobj.scrollup()
		return false
	});		
	// add all your scripts here

 
}); /* end of as page load scripts */
