$(document).ready(function() {
		
	// By suppling no content attribute, the library uses each elements title attribute by default
	/*$('ul#filter li').qtip({
  	// Simply use an HTML img tag within the HTML string
  		content: '<img src="./img/tooltip.png" />', // Set the tooltip content to the current corner
  		position: {
  			corner: {
    			tooltip: 'bottomRight', // Use the corner...
				target: 'topRight' // ...and opposite corner
    		}
  		},
  		style: {
  			border:0,
			padding:0,
    		margin:0      
  		}               
	});   */     
  
    $('ul#filter a').click(function() {
		$(this).css('outline','none');
		$('ul#filter .current').removeClass('current');
		$(this).parent().addClass('current');

		var filterVal = $(this).attr("title");			

		if(filterVal == 'all') {
			$('ul#portfolio li.hidden').fadeIn('slow').removeClass('hidden');
		} else {
			$('ul#portfolio li').each(function() {
				if(!$(this).hasClass(filterVal)) {
					$(this).fadeOut('normal').addClass('hidden');
				} else {
					$(this).fadeIn('slow').removeClass('hidden');
				}
		});

	}

	$('html, body').animate({ scrollTop: 200}, 1000); 
		return false;
	});

	//Shadowbox
	Shadowbox.init({
		language: 'en',
		players:  ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv']
	});
		
});

function popUp(URL,Width,Height) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+Width+',height='+Height+'');");
}

function sendMailTo(name, company, domain, subject) {
	   locationstring = 'mai' + 'lto:' + name + '@' + company + '.' + domain + "?subject=" + escape(subject);
	   window.location.replace(locationstring);
}