function sortUp(sPageName, sPageObjectId, sAllQueryStrings) { resort("up", sPageName, sPageObjectId, sAllQueryStrings); } function sortDown(sPageName, sPageObjectId, sAllQueryStrings) { resort("down", sPageName, sPageObjectId, sAllQueryStrings); } function resort(sMode, sPageName, sPageObjectId, sAllQueryStrings) { document.location.href = "/eprise/main/hemhyra/firstpage/resortFirstPage_step_1?mode=" + sMode + "&objectid=" + sPageObjectId + "&pagename=" + sPageName + "&returnurl=" + escape(document.location.href); } function deleteItem(sItemObjectId, sPageName, sPageObjectId, sParentMenuID, sAllQueryStrings) { if(confirm("Den valda notisen kommer att raderas!")) { document.location.href = "/eprise/main/hemhyra/firstpage/deleteFirstPageItem_step_1?objectid=" + sItemObjectId + "&pageobjectid=" + sPageObjectId + "&pagename=" + sPageName + "&parentmenuid=" + sParentMenuID + "&returnurl=" + escape(document.location.href); } } function imgLoadAndScale(imgObj, MaxWidth, MaxHeight) { var imgWidth = imgObj.width; var imgHeight = imgObj.height; var ratio = imgWidth / imgHeight if(imgWidth > MaxWidth) { imgWidth = MaxWidth; imgHeight = MaxWidth / ratio; } if(imgHeight > MaxHeight) { imgWidth = MaxHeight * ratio; imgHeight = MaxHeight; } imgObj.width = imgWidth; imgObj.height = imgHeight; imgObj.style.position = "relative"; imgObj.style.visibility = "visible"; var oTop = imgObj.parentNode.parentNode; var divRightMargin = imgWidth + 10; if(oTop.clientHeight < imgHeight) { oTop.style.height = imgHeight + "px"; } for(i = 0;i < oTop.childNodes.length; i++) { switch(oTop.childNodes[i].className) { case "firstPageLeftColumn": oTop.childNodes[i].style.width = imgWidth + "px"; break; case "firstPageRightColumn": oTop.childNodes[i].style.marginLeft = divRightMargin + "px"; break; } } }