// init variables var nHideSortMenuTimer = ''; var nSortMenuAnim = 0; var nSortMenuAnimDir = 0; var nSortMenuAnimTimer = ''; var nFavoriteMode = (getValue('sMode')=='favorites'); // functions function animateSortMenu() { nSortMenuAnim+=nSortMenuAnimDir; if(nSortMenuAnim<1) { // fully closed document.getElementById('divSortMenu').style.display = 'none'; nSortMenuAnim = 0; } else { if(nSortMenuAnim<10) { // in transition nPercentage = 1 - Math.sin(((10 - nSortMenuAnim) / 20) * 3.1415) document.getElementById('divSortMenuAnim').style.top = -10 + nSortMenuAnim; document.getElementById('divSortMenuAnim').style.filter = 'Alpha(opacity=' + Math.floor(nPercentage * 100) + ')'; document.getElementById('divSortMenuAnim').style.opacity = nPercentage; if(nSortMenuAnimTimer!='') { nSortMenuAnimTimer = ''; window.clearTimeout(nSortMenuAnimTimer); } nSortMenuAnimTimer = window.setTimeout('animateSortMenu()', 40); } else { // fully open document.getElementById('divSortMenuAnim').style.top = 0; document.getElementById('divSortMenuAnim').style.filter = ''; document.getElementById('divSortMenuAnim').style.opacity = 0.999; document.getElementById('imgSortMenuShadow').style.display = ''; nSortMenuAnim = 10; } } } function boldIfSort(t, s) { if(s==getSort()) { return '' + t + ''; } else { return t; } } function getSort() { nSort = getValue('nSort'); if(nSort!='') { return nSort; } else { return (nFavoriteMode?11:1); } } function getValue(sName) { sQueryString='&'+location.search.substr(1); if(sQueryString.indexOf('&'+sName+'=')>-1) { return sQueryString.substr(sQueryString.indexOf('&'+sName+'=')+sName.length+2).split('&')[0]; } else { return ''; } } function queryString(sQueryString, sName, sValue) { //alert(sName + ', ' + sQueryString) i = ('&' + sQueryString).indexOf('&' + sName + '=') if(sValue.length>0) { if(i==-1) { if(sQueryString.length>0) { return sQueryString + "&" + sName + "=" + escape(sValue) } else { return sName + "=" + escape(sValue) } } else { return sQueryString.substr(0, i + sName.length + 1) + escape(sValue) + sQueryString.substr((sQueryString + '&').indexOf('&', i + 1)) } } else { if(i>-1) { if(sQueryString.indexOf('&', i+1)>-1) { return sQueryString.substr(0, i) + sQueryString.substr((sQueryString + '&').indexOf('&', i + 1) + 1) } else { return sQueryString.substr(0, i - 1) } } } return sQueryString; } function queryStringSort(nSortMode) { return 'SearchResults.asp?' + queryString(queryString(queryString(location.search.substr(1), 'nSort', nSortMode.toString()), 'nView', ''), 'nPage', ''); //return 'SearchResults.asp?' + queryString(queryString(location.search.substr(1), 'nSort', nSortMode.toString()), 'nView', ''); //return 'SearchResults.asp?' + queryString(location.search.substr(1), 'nSort', nSortMode.toString()); } function sortShow() { if(nHideSortMenuTimer!='') { window.clearTimeout(nHideSortMenuTimer); } t = document.getElementById('imgSortMenu'); if(t.src.indexOf('_off')>-1) { t.src = t.src.replace('_off', '_on'); document.getElementById('divSortMenu').style.display = ''; document.getElementById('divSortMenuAnim').style.top = -10; document.getElementById('divSortMenuAnim').style.filter = 'Alpha(opacity=10)'; document.getElementById('divSortMenuAnim').style.opacity = 0.1; document.getElementById('imgSortMenuShadow').style.display = 'none'; nSortMenuAnimDir = 1; animateSortMenu(); //getFlashObject('Effects').SetVariable('nWhooshPan', 0); //getFlashObject('Effects').GotoFrame(3); } } function sortHide() { t = document.getElementById('imgSortMenu'); if(t.src.indexOf('_on')>-1) { nHideSortMenuTimer = window.setTimeout('sortHideMenu();', 10); } } function sortHideMenu() { document.getElementById('imgSortMenu').src = document.getElementById('imgSortMenu').src.replace('_on', '_off'); document.getElementById('imgSortMenuShadow').style.display = 'none'; nSortMenuAnimDir = -1; animateSortMenu(); } // write html portion document.getElementById('tdSortMenu').innerHTML = '' + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + '
' + ' ' + '
'