function floatbox_show(width,height){ if(width == null){ width=380; } if(height == null){ height=190; } floatbox_load(null,width,height); } function floatbox_load(url,width,height,shadow,hidden,closebutton){ if (width == null){ width=620; } if (height == null){ height=410; } if (typeof(hidden) != "boolean"){ hidden=false; } if (typeof(closebutton) != "boolean"){ closebutton = true; } if (navigator.userAgent.toLowerCase().indexOf("safari") != -1){ floatbox_load_safari(url,width,height,hidden,closebutton); return; } var offsetheight=40; var floatbox_panel = document.getElementById("floatbox_panel"); var floatbox_bg = document.getElementById("floatbox_bg"); var floatbox_screen = document.getElementById("floatbox_screen"); var floatbox_content = document.getElementById("floatbox_content"); var floatbox_message = document.getElementById("floatbox_message"); var floatbox_window = document.getElementById("floatbox_window"); var floatbox_close = document.getElementById("floatbox_close"); var shadows_aren = document.getElementById("shadows_aren"); if(shadow == false) { shadows_aren.className = ''; } else { shadows_aren.className = 'shadows_aren sleft'; } if(navigator.userAgent.toLowerCase().indexOf("msie 6") != -1 || navigator.userAgent.toLowerCase().indexOf("msie 5") != -1) { var arrayPageSize = getPageSize(); var arrayPageScroll = getPageScroll(); floatbox_panel.style.width = (width + 2) + "px"; floatbox_panel.style.height = (height + offsetheight + 2) + "px"; floatbox_panel.style.top = arrayPageScroll[1] + parseInt((arrayPageSize[3] - floatbox_panel.offsetHeight) / 3); + "px"; floatbox_panel.style.left = parseInt((arrayPageSize[2] - width) / 2); + "px"; floatbox_screen.style.position = "absolute"; floatbox_screen.style.left = 0; floatbox_screen.style.top = 0; floatbox_screen.style.width = "100%"; floatbox_screen.style.height = arrayPageSize[1] + "px"; floatbox_screen.style.display = ""; } else { floatbox_panel.style.width = (width + 2) + "px"; floatbox_panel.style.height = (height + offsetheight + 2) + "px"; floatbox_screen.style.left = 0; floatbox_screen.style.top = 0; floatbox_screen.style.width = screen.width + "px"; floatbox_screen.style.height = screen.height + "px"; floatbox_screen.style.display = ""; } floatbox_bg.style.width = width + "px"; floatbox_bg.style.height = (height + offsetheight) + "px"; floatbox_content.style.width = width + "px"; floatbox_content.style.height = (height + offsetheight) + "px"; if (url == null){ floatbox_message.style.display = ""; floatbox_window.style.display = "none"; } else { window.floatboxwindow.document.body.innerHTML=""; floatbox_window.style.width = width + "px"; floatbox_window.style.height = height + "px"; window.floatboxwindow.location.replace(url); floatbox_message.style.display = "none"; floatbox_window.style.display = ""; } floatbox_close.style.display = (closebutton) ? "" : "none"; floatbox_panel.style.display = (hidden) ? "none" : ""; floatbox_center(); window.onresize = floatbox_center; } function floatbox_load_safari(url,width,height,hidden,closebutton){ try{ var offsetheight = 50; var floatbox_panel = document.getElementById("floatbox_panel"); var floatbox_bg = document.getElementById("floatbox_bg"); var floatbox_content = document.getElementById("floatbox_content"); var floatbox_message = document.getElementById("floatbox_message"); var floatbox_window = document.getElementById("floatbox_window"); var floatbox_close = document.getElementById("floatbox_close"); var floatbox_iframe = document.getElementById("floatbox_iframe"); if (hidden){ width=300; height=180; } floatbox_panel.style.width = (width + 2) + "px"; floatbox_panel.style.height = (height + offsetheight + 2) + "px"; floatbox_bg.style.width = width + "px"; floatbox_bg.style.height = (height + offsetheight) + "px"; floatbox_content.style.width = width + "px"; floatbox_content.style.height = (height + offsetheight) + "px"; if (url == null){ floatbox_message.style.display = ""; floatbox_iframe.style.display = "none"; } else { floatbox_iframe.style.display = ""; floatbox_iframe.innerHTML = ''; floatbox_message.style.display = "none"; } floatbox_close.style.display = (closebutton) ? "" : "none"; // floatbox_panel.style.display = (hidden) ? "none" : ""; floatbox_panel.style.display = ""; floatbox_center(); window.onresize = floatbox_center; } catch(e){ // error... } } function floatbox_hide(){ var floatbox_panel = document.getElementById("floatbox_panel"); floatbox_panel.style.display = "none"; var floatbox_screen = document.getElementById("floatbox_screen"); floatbox_screen.style.display = "none"; } function floatbox_setmessage(message){ var o = document.getElementById("floatbox_message"); var s = '

' + message + '

'; s += '
'; o.innerHTML = s; } function floatbox_confirm(question,yesaction,noaction){ var o = document.getElementById("floatbox_message"); var s = '

'+question + '

'; s += '   '; s += ''; s += '
'; o.innerHTML = s; floatbox_load(null,380,125,false,false); } function floatbox_center(){ var floatbox_panel = document.getElementById("floatbox_panel"); if( !floatbox_panel || (iecheck((document.compatMode == 'BackCompat') ? true : false)) ){ return; } windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; floatbox_panel.style.left = Math.max(0,(windowWidth / 2 - floatbox_panel.scrollWidth / 2)) +'px'; floatbox_panel.style.top = Math.max(0,(windowHeight / 2 - floatbox_panel.scrollHeight / 2)) +'px'; } function iecheck(inc_seven){ if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent){ var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, ''); var iever = (inc_seven)?(rslt != null && Number(rslt[1]) >= 5.5):(rslt != null && Number(rslt[1]) >= 5.5 && Number(rslt[1]) < 7 ); } return iever; }