$(document).ready(function() {
	$('.roundleft').wrap('<div class="round_wrap alignleft">')
	$('.roundright').wrap('<div class="round_wrap alignright">')
	$('.round').wrap('<div class="round_wrap">')
	$('.round_wrap').append('<img class="topleft" src="images/topleft-trans.png"/><img class="topright" src="images/topright-trans.png"/><img class="bottomleft" src="images/bottomleft-trans.png"/><img class="bottomright" src="images/bottomright-trans.png"/>')
	$('#twitter').after('<div id="bird"></div>')
	$('#sidebar ul li:last-child').css('border','0px none');
	$(".tablesorter").tablesorter(); 
	$(".enlarge").fancybox();
	$('#coda-slider-1').codaSlider({
	});
	$(".social_icon").qtip({
		style: { 
			padding: 5,
			background: '#272727',
			color: 'white',
			textAlign: 'center',
			fontSize: '14px',
			border: {
				width: 1,
				radius: 5,
				color: '#CFCFCF'
			},
			tip: {
				corner: 'bottomMiddle',
				size: {
					x: 10,
					y : 10
				}
			},
			name: 'dark'
		},
		position: {
		  corner: {
			 target: 'topMiddle',
			 tooltip: 'bottomMiddle'
		  }
		}
	});
	
//Portfolio slider on portfolio page (black semi-transparent slider)
	
	$('.boxgrid.captionfull').hover(function(){
		$(".cover", this).stop().animate({top:'50px'},{queue:false,duration:160});
		curvyCorners.redraw()
	}, function() {
		$(".cover", this).stop().animate({top:'150px'},{queue:false,duration:160});
	});
	
});

// This is for the contact form

	$(document).ready(function() { 
		var options = { 
		target:        '#alert'
		}; 
		$('#contactForm').ajaxForm(options); 
	}); 

	$.fn.clearForm = function() {
	  return this.each(function() {
		var type = this.type, tag = this.tagName.toLowerCase();
		if (tag == 'form')
		  return $(':input',this).clearForm();
		if (type == 'text' || type == 'password' || tag == 'textarea')
		  this.value = '';
		else if (type == 'checkbox' || type == 'radio')
		  this.checked = false;
		else if (tag == 'select')
		  this.selectedIndex = -1;
	  });
	};
	
// This is for the twitter feed in the sidebar!

	getTwitters('tweet', { 
		id: 'GeorgeFamilyLP', 
		count: 1, 
		enableLinks: true, 
		clearContents: true,
		template: '%text%<div class="clear"></div>'
	});

// This here is for browser specific CSS

	function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',o='opera',h=document.getElementsByTagName('html')[0],b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);
