var thumbSize = [% IF thumbSize %][% thumbSize %][% ELSE %]250[% END %];
function chooseAlbumOrderBy(value, option, artwork)
{
	if (!artwork && artwork != 0) {
		artwork = 1;
	}
        var url = '[% webroot %]browsedb.html?hierarchy=[% hierarchy %]&level=[% level %][% attributes %][% IF artwork OR artwork == '0' %]&artwork='+artwork+'[% END %]&player=[% playerURI %]'; 
        if (option) {
                url = url + '&orderBy=' + option;
        }
        setCookie( 'SlimServer-orderBy', option );
        window.location = url;
}

function setCookie(name, value) {
        var expires = new Date();
        expires.setTime(expires.getTime() + 1000*60*60*24*365);
        document.cookie =
                name + "=" + escape(value) +
                ((expires == null) ? "" : ("; expires=" + expires.toGMTString()));
}

function resize(src,width) {
	if (!width) {
		// special case for IE (argh)
		if (document.all) { //if IE 4+ 
			width = document.body.clientWidth*0.5;
		} else if (document.getElementById) { //else if NS6+
			width = window.innerWidth*0.5;
		}
	}
	if (src.width > width ) {
		src.width = width;
	}
}
