function wrap(id) {
	if (window.innerWidth < 580)
	{
		document.getElementById(id).style.width = '280px';
	}
	
	else if (window.innerWidth < 860)
	{
		document.getElementById(id).style.width = '560px';
	}
	
	else if (window.innerWidth < 1140)
	{
		document.getElementById(id).style.width = '840px';
	}
	
	else if (window.innerWidth < 1420)
	{
		document.getElementById(id).style.width = '1120px';
	}
	
	else if (window.innerWidth < 1670)
	{
		document.getElementById(id).style.width = '1400px';
	}
	
	else if (window.innerWidth < 1980)
	{
		document.getElementById(id).style.width = '1680px';
	}
	
	else
	{
		document.getElementById(id).style.width = '1680px';
	}
}

function expand(id) {
	var element = document.getElementById(id);
	element.className = (element.className == 'expanded') ? 'unexpand' : 'expanded';
}

function front(event) {
	event.currentTarget.className='front flipped';
}

function mail(id) {
	document.getElementById(id).className = 'contact show';
}

function closemail(id) {
	document.getElementById(id).className = 'contact hide';
}

function related(id) {
	var element = document.getElementById(id);
	element.className = (element.className == 'dropdown show') ? 'dropdown' : 'dropdown show';

}

function back(id) {
	document.getElementById(id).className = 'front animate';
}

function scale(id) {
	document.getElementById(id).className = 'scale post';
}

function scaleback(id) {
	document.getElementById(id).className = 'scaleback post';
}


/*
CSS Browser Selector v0.3.5 (Feb 05, 2010)
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/

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.documentElement,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);