function showclock() { if (!document.layers&&!document.all&&!document.getElementById) return; var dt=new Date(); var day=dt.getDate(); var month=dt.getMonth()+1; var year=(''+dt.getFullYear()).substr(2); var hours=dt.getHours(); var minutes=dt.getMinutes(); if (minutes<=9) minutes="0"+minutes; myclock=day+"."+month+"."+year+" | " +hours+":"+minutes; if (document.layers) { document.layers.liveclock.document.write(myclock); document.layers.liveclock.document.close(); } else if (document.all) liveclock.innerHTML=myclock; else if (document.getElementById) document.getElementById("liveclock").innerHTML=myclock; setTimeout("showclock()",1000); } function redirect2() { setTimeout("go_now()",1); } function go_now() { window.location.href = "http://www.google.com/"; } function redirect(url) { parent.location=url; } function printpage() { window.print(); } function jump(url) { if ( url.indexOf("go:") == 0 ) url = url.replace("go:","").replace(/#dot#/g,".").replace("#http#","http://"); window.location.href = url; } var slideTimeBetweenSteps = 40; var scrollingContainer = false; var scrollingContent = false; var containerHeight; var contentHeight; var contentObjects = new Array(); var originalslideSpeed = false; function slideContent(containerId) { var topPos = contentObjects[containerId]['objRef'].style.top.replace(/[^\-0-9]/g,''); topPos = topPos - contentObjects[containerId]['slideSpeed']; if ( topPos + contentObjects[containerId]['contentHeight'] < 0 ) topPos = contentObjects[containerId]['containerHeight']; contentObjects[containerId]['objRef'].style.top = topPos + 'px'; setTimeout('slideContent("' + containerId + '")',slideTimeBetweenSteps); } function stopSliding() { var containerId = this.id; contentObjects[containerId]['slideSpeed'] = 0; } function restartSliding() { var containerId = this.id; contentObjects[containerId]['slideSpeed'] = contentObjects[containerId]['originalSpeed']; } function initSlidingContent(containerId,slideSpeed) { scrollingContainer = document.getElementById(containerId); scrollingContent = scrollingContainer.getElementsByTagName('DIV')[0]; scrollingContainer.style.position = 'relative'; scrollingContainer.style.overflow = 'hidden'; scrollingContent.style.position = 'relative'; scrollingContainer.onmouseover = stopSliding; scrollingContainer.onmouseout = restartSliding; originalslideSpeed = slideSpeed; scrollingContent.style.top = '0px'; contentObjects[containerId] = new Array(); contentObjects[containerId]['objRef'] = scrollingContent; contentObjects[containerId]['contentHeight'] = scrollingContent.offsetHeight; contentObjects[containerId]['containerHeight'] = scrollingContainer.clientHeight; contentObjects[containerId]['slideSpeed'] = slideSpeed; contentObjects[containerId]['originalSpeed'] = slideSpeed; slideContent(containerId); } function __openWindow(url,W,H) { var w = window.open(url,"mywindow","width="+W+",height="+H); H = H + 40; w.resizeTo(W,H); if (window.focus) w.focus(); } function openWindow(url,w,h) { leftVal = (screen.width-w) / 2; topVal = (screen.height-h) / 2; winprops = 'height='+h+',width='+w+',top='+topVal+',left='+leftVal+',resizable=0'; winprops += ',menubar=0,toolbar=0,location=0,status=0,statusbar=0'; var wn = window.open(url,'mywindow',winprops); h += 40; if(window.XMLHttpRequest) { if(window.ActiveXObject) { h += 40; } else { h += 40; } } else { } wn.resizeTo(w,h); if (window.focus) wn.focus(); } function closeService() { var layer = 'service_layer'; var a = parent.document.getElementById(layer); if (a==null) self.close(); else parent.hideService(); } function closeServiceAndReloadParent() { var layer = 'service_layer'; var a = parent.document.getElementById(layer); if (a==null) { window.opener.location.reload(); self.close(); } else { parent.location.reload(); parent.hideService(); } } function closeUpload() { closeService(); } function closeUploadAndReloadParent() { closeServiceAndReloadParent(); } function closeMe() { closeService(); } function closeMeAndReloadParent() { closeServiceAndReloadParent(); } function OLD_closeMe() { self.close(); } function OLD_closeMeAndReloadParent() { if(!window.opener.closed) window.opener.location.reload(); self.close(); } function showLayer(id) { var obj= document.getElementById(id); if (obj!=null) { showDisablePage(true); obj.style.display = "block"; obj.style.position = "absolute"; placeIt(id); } } function hideLayer(id) { document.getElementById(id).style.display="none"; showDisablePage(false); } function dom() { return (document.getElementById) ? true : false; } function hideIt(id) { if (dom()) { document.getElementById(id).style.visibility='hidden'; } } function showIt(id) { if (dom()) { document.getElementById(id).style.visibility='visible'; } } function winCenterX_v1(id) { var w,left; if (dom() && !document.all) { w = parseInt(document.getElementById(id).style.width); } if (document.all) { w = parseInt(document.all[id].style.width); } var screenWidth = screen.availWidth; left = (screenWidth-w)/2; return left; } function winCenterY_v1(id) { var h,top; if (dom() && !document.all) { h = parseInt(document.getElementById(id).style.height); } if (document.all) { h = parseInt(document.all[id].style.height); } var screenHeight = screen.availHeight; top = (screenHeight-h)/3; return top; } function placeIt_v1(id) { var disp; if (dom() && !document.all) { document.getElementById(id).style.left = window.pageXOffset + (window.innerWidth - (window.innerWidth-winCenterX(id))) + "px"; document.getElementById(id).style.top = window.pageYOffset + (window.innerHeight - (window.innerHeight-winCenterY(id))) + "px"; disp = document.getElementById(id).style.display; } else if (document.all) { if ( document.body.scrollTop > document.documentElement.scrollTop ) { document.all[id].style.left = document.body.scrollLeft + (document.body.clientWidth - (document.body.clientWidth-winCenterX(id))) + "px"; document.all[id].style.top = document.body.scrollTop + (document.body.clientHeight - (document.body.clientHeight-winCenterY(id))) + "px"; } else { document.all[id].style.left = document.documentElement.scrollLeft + (document.documentElement.clientWidth - (document.documentElement.clientWidth-winCenterX(id))) + "px"; document.all[id].style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight - (document.documentElement.clientHeight-winCenterY(id))) + "px"; } disp = document.all[id].style.display; } if (disp == 'block') window.setTimeout("placeIt('"+id+"')", 10); } function winCenterX(id) { var w,left; if (dom() && !document.all) { w = parseInt(document.getElementById(id).style.width); } if (document.all) { w = parseInt(document.all[id].style.width); } var screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; left = (screenWidth-w)/2; return left; } function winCenterY(id) { var h,top; if (dom() && !document.all) { h = parseInt(document.getElementById(id).style.height); } if (document.all) { h = parseInt(document.all[id].style.height); } var screenHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; top = (screenHeight-h)/3; return top; } function placeIt(id) { var disp; if (dom() && !document.all) { document.getElementById(id).style.left = window.pageXOffset + winCenterX(id) + "px"; document.getElementById(id).style.top = window.pageYOffset + winCenterY(id) + "px"; disp = document.getElementById(id).style.display; } else if (document.all) { if ( document.body.scrollTop > document.documentElement.scrollTop ) { document.all[id].style.left = document.body.scrollLeft + winCenterX(id) + "px"; document.all[id].style.top = document.body.scrollTop + winCenterY(id) + "px"; } else { document.all[id].style.left = document.documentElement.scrollLeft + winCenterX(id) + "px"; document.all[id].style.top = document.documentElement.scrollTop + winCenterY(id) + "px"; } disp = document.all[id].style.display; } if (disp == 'block') window.setTimeout("placeIt('"+id+"')", 10); } function closeMeAndRedirectParent(url) { parent.location = url; closeMe(); } function reloadParent() { var x = parent; if (x==null) x = window.opener.parent; else if (x==null) x = window.opener; if (x!=null) x.location.reload(); } function refreshParent() { parent.location.reload(); } function changeText(id,txt) { document.getElementById(id).innerHTML = txt; } function changeParentText(id,txt) { parent.document.getElementById(id).innerHTML = txt; } function updateBGColor(id,c) { document.getElementById(id).style.backgroundColor = c; } function updateSelectedBGColor(id,ix,n,c1,c2) { try { for (i=0; i<n; i++) { s = i+''; c = c2; if (i==ix) { s = ix+''; c = c1; } document.getElementById(id+s).style.backgroundColor = c; } } catch(err) { } } function changeFrameUrl(id,url) { var x = document.getElementById(id); if (x==null) x = parent.document.getElementById(id); if (x!=null) x.src = url; } function refreshFrameFromFrame() { parent.document.getElementById("P710B_iFrame").src = parent.document.getElementById("P710B_iFrame").src; } function refreshFrame(id) { var x = document.getElementById(id); if (x==null) { x = parent.document.getElementById(id); } if (x==null) { x = window.opener.document.getElementById(id); } if (x==null) { x = window.opener.parent.document.getElementById(id); } if (x!=null) { x.src = x.src; } } function moveUp(element) { for(i = 0; i < element.options.length; i++) { if(element.options[i].selected == true) { if(i != 0) { var temp = new Option(element.options[i-1].text,element.options[i-1].value); var temp2 = new Option(element.options[i].text,element.options[i].value); element.options[i-1] = temp2; element.options[i-1].selected = true; element.options[i] = temp; } } } } function moveDown(element) { for(i = (element.options.length - 1); i >= 0; i--) { if(element.options[i].selected == true) { if(i != (element.options.length - 1)) { var temp = new Option(element.options[i+1].text,element.options[i+1].value); var temp2 = new Option(element.options[i].text,element.options[i].value); element.options[i+1] = temp2; element.options[i+1].selected = true; element.options[i] = temp; } } } } function updateList(list, textBox) { textBox.value = ''; for(i = 0; i < list.options.length; i++) { if (i == 0) textBox.value += list.options[i].value; else textBox.value += ',' + list.options[i].value; } } function swap(list) { var j = 0; for(i = 0; i < list.options.length; i++) { if(list.options[i].selected == true) { j++; switch (j) { case 1: var i1 = i; var temp = new Option(list.options[i].text, list.options[i].value); break; case 2: var i2 = i; var temp2 = new Option(list.options[i].text, list.options[i].value); break; } } } if (j != 2) { alert('Only 2 items can be swapped'); } else { list.options[i1] = temp2; list.options[i1].selected = true; list.options[i2] = temp; list.options[i2].selected = true; } } function updateHref(a, itemlist, url) { a.href = url + itemlist.value; } function openSelectedArticleWindow(IDs,url,W,H) { var list = document.getElementById(IDs); if (list != null && list.value.length>0) { url = url + list.value; showService(url,W,H); } } function openDialogOKCancelWindow(rndKey,listID,url,W,H) { var list = document.getElementById(listID); if (list != null && list.value.length>0) { var params = 'rndkey='+rndKey+'&keys='+listID+'&'+listID+'='+list.value; ajaxPOST('tasks?cmd=p:reqmem',params); showService(url,W,H); } } function updateHrefP716() { try { var url = document.getElementById('save_base_url').value; var s = document.getElementById('items'); var ix = s.options[s.selectedIndex].value; document.getElementById('saveChanges').href = url + ix; } catch(err) { } } function updateParentSelectedList(id) { var list = parent.document.getElementById('selected_articles').value; if ( document.getElementById('article_'+id).checked ) list += id+","; else list = list.replace(id+",",""); parent.document.getElementById('selected_articles').value = list; } function emptyParentSelectedList() { parent.document.getElementById('selected_articles').value = ""; } function updateSelectedListInParent(selectedList,prefix,id) { var list = parent.document.getElementById(selectedList).value; if ( document.getElementById(prefix+id).checked ) list += id+","; else list = list.replace(id+",",""); parent.document.getElementById(selectedList).value = list; } function emptySelectedListInParent(selectedList) { parent.document.getElementById(selectedList).value = ""; } function setSelectedListInParent(selectedList,values) { parent.document.getElementById(selectedList).value = values; } function changeDisplayState(id) { a=document.getElementById(id); if (a.style.display == 'none') a.style.display = 'block'; else a.style.display = 'none'; } var isShowComments = false; function changeAllDisplayState(pref,from,to) { isShowComments = ! isShowComments; for(i = from; i <= to; i++) { id = pref + i; a=document.getElementById(id); if (isShowComments) a.style.display = 'block'; else a.style.display = 'none'; } } function toggleAllDisplayState(pref,from,to) { for(i = from; i <= to; i++) { id = pref + i; a=document.getElementById(id); if (a.style.display == 'none') a.style.display = 'block'; else a.style.display = 'none'; } } function visibleUserBlocks(KeyName,ShowValue) { var isVisible = (document.getElementById(KeyName).value == ShowValue ); var disp = 'none'; var invdisp = 'block'; if (isVisible) { disp = 'block'; invdisp = 'none'; } document.getElementById('users_section1').style.display = invdisp; document.getElementById('parents_section1').style.display = disp; document.getElementById('parents_section2').style.display = disp; } function hideByID(id) { document.getElementById(id).style.display = 'none'; } function showByID(id) { document.getElementById(id).style.display = 'block'; } function showDisablePage(value) { var k = document.getElementById("wrapper_mask_page"); if (value) { var d = getPageSize(); var w = d[0]; var h = d[1]; k.style.width = w+"px"; k.style.height = h+"px"; k.style.display = "block"; } else k.style.display = "none"; } function winResize(id,offsetX,offsetY) { y = document.getElementById(id); if (y != null) { var D = getViewSize(); y.style.left = (D[0] - parseInt(y.style.width)) / 2 +offsetX+ 'px'; y.style.top = (D[1] - parseInt(y.style.height)) / 2 +offsetY+ 'px'; } } function showMsg(id) { y = document.getElementById(id); if (y != null) { winResize(id,0,0); showDisablePage(true); y.style.display="block"; window.onresize = winResize; } } function showMsgWithOffset(id,offsetX,offsetY) { y = document.getElementById(id); if (y != null) { winResize(id,offsetX,offsetY); showDisablePage(true); y.style.display="block"; window.onresize = winResize; } } function hideMsg(id) { document.getElementById(id).style.display="none"; showDisablePage(false); window.onresize = null; } function getViewSize() { var x = document.body.clientWidth; var y = document.body.clientHeight; if (window.innerWidth) x = window.innerWidth; if (window.innerHeight) y = window.innerHeight; return [x,y]; } function getPageSize() { var x = Math.max( document.body.scrollWidth, document.documentElement.scrollWidth); var y = Math.max( document.body.scrollHeight, document.documentElement.scrollHeight); return [x,y]; } var _editor_url = "/BRPortal/resources/plugins/HTMLArea/"; var _editor_lang = "he"; function showEditor(id) { HTMLArea.loadPlugin("ContextMenu"); HTMLArea.onload = function() { var editor = new HTMLArea(id); editor.registerPlugin(ContextMenu); editor.generate(); }; HTMLArea.init(); } function showUploadWaitPanel() { document.getElementById('apDiv1').style.display='none'; document.getElementById('apDiv2').style.display='block'; } function isCancelConfirm(id,msg) { var answer = confirm(msg); if (answer) document.getElementById(id).value = "cancel"; } function setClientURL(id) { document.getElementById(id).value = document.location; } function setParentLocation(newURL) { parent.location.href = newURL; } function reloadParentPage() { parent.location.reload(); } function setParentTitle(newTitle) { parent.document.title = newTitle; } function wakeupPortal() { var startUrl = "P000.jsp?domain="+parent.location.href; redirect(startUrl); } function XSubmit(identifier) { document.forms[0].clickedby.value=identifier; document.forms[0].submit(); } function submitEnter(inputFieldName,e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { renderFieldName = 'com_sun_rave_web_ui_appbase_renderer_CommandLinkRendererer'; document.forms[0][renderFieldName].value='form1:'+inputFieldName; document.forms[0].submit(); return false; } else return true; } function submitXEnter(e,xsubmitAction) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { XSubmit(xsubmitAction); return false; } else return true; } function submitPressEnter(currForm,e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { currForm.submit(); return false; } else return true; } function isPressEnter(e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return false; return (keycode == 13); } function setElementFocus(elementItem) { document.forms['form1'].elements[elementItem].focus(); } function insertAtCursor(area, txt) { try { if (document.selection) { area.value += txt; } else if (area.selectionStart || area.selectionStart == "0") { var startPos = area.selectionStart; var endPos = area.selectionEnd; area.value = area.value.substring(0, startPos) + txt + area.value.substring(endPos, area.value.length); } else { area.value += txt; } } catch(e) { area.value += txt; } } function __embedToComment(embed) { insertAtCursor(window.opener.document.forms['form1'].elements['comment_msg'],"\n"+embed+"\n"); self.close(); } function __embedToArticle(embed) { insertAtCursor(window.opener.document.forms['form1'].elements['form1:arBody'],"\n"+embed+"\n"); self.close(); } function old__keepSessionAlive() { var kareq; var url = "tasks?cmd=p:global;t:keepalive"; if (window.ActiveXObject) { kareq = new ActiveXObject("Microsoft.XMLHTTP"); if (kareq) { kareq.open("GET", url, true); kareq.send(); } } else if (window.XMLHttpRequest) { kareq = new XMLHttpRequest(); try { kareq.open("GET", url, true); kareq.send(null); } catch (e) { } } keepAlive(); } function setDesignColor(c) { a = document.getElementById("selectcolor"); a.style.backgroundColor=c; b = document.getElementById("selectedColor"); b.value=c; } function getHTTPObject() { var xmlhttp; try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } function getXmlHttpObject() { var xmlHttp=null; try { xmlHttp = new XMLHttpRequest(); } catch (e1) { try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e2) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } function keepAlive() { var sleep_millisec = 1000*60*5; window.setTimeout("keepSessionAlive();", sleep_millisec); } function handleHttpResponse() { } function keepSessionAlive() { try { var d = new Date(); var http = getXmlHttpObject(); var url = "tasks?cmd=p:global;t:keepalive&time="+d.getTime(); http.open("GET", url, true); http.onreadystatechange = handleHttpResponse; try { http.send(null); } catch (e) { http.send(); } } catch (e) { } keepAlive(); } function ajaxPOST(url,params) { try { var http = getXmlHttpObject(); http.open("POST", url, true); http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.onreadystatechange = handleHttpResponse; try { http.send(params); } catch (e) { } } catch (e) { } } function setSiteSearch(site,width) { window.frames['search_google'].document.forms['find'].elements['sitesearch'].value = site; window.frames['search_google'].document.forms['find'].elements['q'].style.width = (width-10)+"px"; } function setStatistics() { if (document.referrer&&document.referrer!="") document.forms[0].history_prev_url.value=document.referrer; document.forms[0].history_curr_url.value=window.location; } function sendStatistics() { var curr = window.location; var prev = ""; if (document.referrer&&document.referrer!="") prev=document.referrer; var d = new Date(); var url = "tasks?cmd=p:global;t:stat"+";curr:"+curr+";prev:"+prev+"&time="+d.getTime(); document.getElementById("dummy_img").src = url; } function __sendStatistics() { var sleep_millisec = 1; window.setTimeout("sendStatAlive();", sleep_millisec); } function handleHttpResponseStat() { } function sendStatAlive() { try { var curr = window.location; var prev = ""; if (document.referrer&&document.referrer!="") prev=document.referrer; var d = new Date(); var http = getXmlHttpObject(); var url = "tasks?cmd=p:global;t:stat"+";curr:"+curr+";prev:"+prev+"&time="+d.getTime(); http.open("GET", url, true); http.onreadystatechange = handleHttpResponseStat; try { http.send(null); } catch (e) { http.send(); } } catch (e) { } } function groupChecked(IDs,chk) { var list = IDs.split(','); for(i = 0; i < list.length; i++) { id = list[i]; a = document.getElementById(id); a.checked = chk; } } function tagNameChecked(prefix,chk) { var inputs = document.getElementsByTagName('input'); for(i = 0; i < inputs.length; i++) { var tag = inputs[i]; if ( tag.name.indexOf(prefix)==0 ) inputs[i].checked = chk; } } function showPleaseWait() { showMsg('wait_message_layer'); document.getElementById('message_layer').style.display='none'; document.getElementById('wrapper_mask_page').style.display='block'; } function hidePleaseWait() { document.getElementById('message_layer').style.display='none'; document.getElementById('wait_message_layer').style.display='none'; document.getElementById('wrapper_mask_page').style.display='none'; } var agt=navigator.userAgent.toLowerCase(); var is_major = parseInt(navigator.appVersion); var is_minor = parseFloat(navigator.appVersion); var is_nav  = ( ( (agt.indexOf('mozilla')!=-1) || (agt.indexOf('opera')!=-1) ) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) ); var is_nav4 = (is_nav && (is_major == 4)); var is_nav6 = (is_nav && (is_major == 5)); var is_nav6up = (is_nav && (is_major >= 5)); var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); var offsetX = 20; var offsetY = 20; var opacity = 100; var toolTipSTYLE; function moveToMousePos(e) { if(!is_ie) { x = e.pageX; y = e.pageY; } else { x = event.x; y = event.y; } toolTipSTYLE.left = x + offsetX+'px'; toolTipSTYLE.top = y + offsetY+'px'; return true; } function initToolTips() { if(document.getElementById) { toolTipSTYLE = document.getElementById("toolTipLayer").style; } if(is_ie || is_nav6up) { toolTipSTYLE.visibility = "visible"; toolTipSTYLE.display = "none"; document.onmousemove = moveToMousePos; } } function toolTip(msg, fg, bg) { if (toolTipSTYLE==null) return; if(toolTip.arguments.length < 1) { if(is_nav4) toolTipSTYLE.visibility = "hidden"; else toolTipSTYLE.display = "none"; } else { if(!fg) fg = "#777777"; if(!bg) bg = "#f9f9f9"; var content = '<table border="0" cellspacing="0" cellpadding="0" class="toolTip"><tr><td bgcolor="' + fg + '">' + '<table border="0" cellspacing="1" cellpadding="0"<tr><td bgcolor="' + bg + '">'+ '<font face="sans-serif" color="' + fg + '" size="-2">' + msg + '</font></td></tr></table>'+ '</td></tr></table>'; if(is_nav4) { toolTipSTYLE.document.write(content); toolTipSTYLE.document.close(); toolTipSTYLE.visibility = "visible"; } else if(is_ie || is_nav6up) { document.getElementById("toolTipLayer").innerHTML = content; toolTipSTYLE.display='block'; } } } function showPic(imgUrl,imgTxt) { h = "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"0\" border=\"0\">"; h += "<tr><td align=\"center\" style=\"padding-left:3px;padding-right:3px;padding-top:3px;\"><img src=\""+imgUrl+"\" border=\"0\"/> </td></tr>"; h += "<tr><td colspan=\"2\" align=\"right\" dir=\"rtl\"><hr/>"+imgTxt+"</td></tr>"; h += "</table>"; toolTip(h); } var isEditorEditable= false; var isIE; var isGecko; var isSafari; var isKonqueror; var browser = navigator.userAgent.toLowerCase(); function initiateEditor() { isIE = ((browser.indexOf("msie") != -1) && (browser.indexOf("opera") == -1) && (browser.indexOf("webtv") == -1)); isGecko = (browser.indexOf("gecko") != -1); isSafari = (browser.indexOf("safari") != -1); isKonqueror = (browser.indexOf("konqueror") != -1); if (document.getElementById && document.designMode) { isEditorEditable= true; } } function designerEditor(editor, html, dir, fsize) { var mainContent= "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"+ "<html id=" + editor + "><head>"+ "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"+ "</head><body dir='"+dir+"' style=\"font-family: Arial,Helvetica,sans-serif; font-size: "+fsize+"px;\" >" + html + "</body></html>" ; var edit = document.getElementById(editor).contentWindow.document; edit.write(mainContent); edit.close(); edit.designMode =  "On" ; } function displayEditor(editor, html, width, height,  _cols, _rows) { if(isEditorEditable) { document.writeln('<iframe id="' + editor + '" name="' + editor + '" width="' + width + 'px" height="' + height + 'px"  ></iframe>'); document.writeln('<input type="hidden" id="hidden_' + editor + '" name="hidden_' + editor + '" value="">'); document.getElementById('hidden_' + editor).value = html; designerEditor(editor, html); } else { document.writeln('<textarea dir="rtl" name="' + editor + '" id="' + editor + '" cols="'+_cols+'" rows="'+_rows+'">' + html + '</textarea>'); } } function loadEditor(editor, initEditorDiv, viewEditorDiv, width, height,  _cols, _rows, dir, fsize) { initiateEditor(); var html=document.getElementById(initEditorDiv).innerHTML.replace(/#_gt#/g,">").replace(/#_lt#/g,"<").replace(/#_sc#/g,":"); if(isEditorEditable) { document.getElementById(viewEditorDiv).innerHTML='<iframe id="' + editor + '" name="' + editor + '" width="' + width + 'px" height="' + height + 'px"  ></iframe><input type="hidden" id="hidden_' + editor + '" name="hidden_' + editor + '" value="">'; document.getElementById('hidden_' + editor).value = html; designerEditor(editor, html, dir, fsize); } else { document.getElementById(viewEditorDiv).innerHTML='<textarea dir="rtl" name="' + editor + '" id="' + editor + '" cols="'+_cols+'" rows="'+_rows+'">' + html + '</textarea>'; } } function commandEditor(editor, command, option) { var mainField; mainField = document.getElementById(editor).contentWindow; try { mainField.focus(); mainField.document.execCommand(command, false, option); mainField.focus(); } catch (e) { } } function updateEditor(editor) { if (!isEditorEditable) return; var hiddenField = document.getElementById('hidden_' + editor); if (hiddenField.value == null) hiddenField.value = ""; hiddenField.value = document.getElementById(editor).contentWindow.document.body.innerHTML; } function embedToEditor(editor,embed) { var em = document.getElementById(editor); if (em==null) { if (window.opener==null) em = parent.document.getElementById(editor); else em = window.opener.document.getElementById(editor); } if (em!=null) { var ed = em.contentWindow.document; if (em.contentWindow.getSelection) { var sel = em.contentWindow.getSelection(); if (sel.rangeCount>0) { var range = sel.getRangeAt(0); range.deleteContents(); var newSpan = ed.createElement('span'); newSpan.innerHTML = embed; range.insertNode(newSpan); } else { ed.body.innerHTML += embed; } } else if (document.selection && document.selection.createRange) { ed.focus(); var range2 = ed.selection.createRange(); var str = range2.text; if (str.length>0) range2.pasteHTML(embed); else ed.body.innerHTML += embed; } else { ed.body.innerHTML += embed; } } } function getSelectedHTML() { var rng=null,html=""; if (document.selection && document.selection.createRange) { rng=document.selection.createRange(); html=rng.htmlText||""; } else if (window.getSelection) { rng=window.getSelection(); if (rng.rangeCount > 0 && window.XMLSerializer) { rng=rng.getRangeAt(0); html=new XMLSerializer().serializeToString(rng.cloneContents()); } } return html; } function removeStr(str,removelist) { if (removelist==null || removelist.length==0) return str; else { newArray = removelist.split(','); for(i=0; i<newArray.length; i++) { var reg = new RegExp(newArray[i], "gi"); str = str.replace(reg,""); } return str; } } function wrapSelectionEditor(editor,before,after,removelist) { var em = document.getElementById(editor); if (em==null) em = window.opener.document.getElementById(editor); if (em!=null) { var ed = em.contentWindow.document; if (em.contentWindow.getSelection) { var sel = em.contentWindow.getSelection(); if (sel.rangeCount>0 && window.XMLSerializer) { var range = sel.getRangeAt(0); var str = new XMLSerializer().serializeToString(range.cloneContents()); str = removeStr(str,removelist); if (str.length>0) { range.deleteContents(); var newSpan = ed.createElement('span'); newSpan.innerHTML = before+str+after; range.insertNode(newSpan); } } } else if (document.selection && document.selection.createRange) { ed.focus(); var range = ed.selection.createRange(); var str = range.htmlText||""; str = str.replace(/<p>/gi,"<br>").replace(/<\/p>/gi,""); str = removeStr(str,removelist); if (str.length>0) range.pasteHTML(before+str+after); } } } function wrapBodyEditor(editor,before,after) { var em = document.getElementById(editor); if (em==null) em = window.opener.document.getElementById(editor); if (em!=null) { var ed = em.contentWindow.document; ed.body.innerHTML = before + ed.body.innerHTML + after; } } function embedToComment(embed) { var editor = 'contentEditor_CommentBody'; embedToEditor(editor,'<br/>'+embed+'<br/><br/>'); closeMe(); } function embedToArticle(embed) { var editor = 'contentEditor_ArticleBody'; embedToEditor(editor,'<br/>'+embed+'<br/><br/>'); closeMe(); } function embedObject(editor,embed) { embed = embed.replace(/\\'/g,"'"); embed = embed.replace(/&quot;/g,"\""); embed = '<br/>'+embed+'<br/><br/>'; embedToEditor(editor,embed); closeMe(); } function embedObjectToComment(embed) { var editor = 'contentEditor_CommentBody'; embedObject(editor,embed); } function embedObjectToArticle(embed) { var editor = 'contentEditor_ArticleBody'; embedObject(editor,embed); } function embedToComment2(embed) { var editor = 'contentEditor_CommentBody'; embedToEditor(editor,embed); closeMe(); } function embedToArticle2(embed) { var editor = 'contentEditor_ArticleBody'; embedToEditor(editor,embed); closeMe(); } function loadHtmlDiv2iFrame(divID,iframeID) { if(document.getElementById && !(document.all)) { document.getElementById(iframeID).contentWindow.document.body.innerHTML = document.getElementById(divID).innerHTML.replace(/#_gt#/g,">").replace(/#_lt#/g,"<").replace(/#_sc#/g,":"); } else if(document.all) { document.getElementById(iframeID).contentWindow.document.body.style.backgroundColor = "transparent"; document.getElementById(iframeID).contentWindow.document.body.innerHTML = document.getElementById(divID).innerHTML.replace(/#_gt#/g,">").replace(/#_lt#/g,"<").replace(/#_sc#/g,":"); } } function versionMSIE() { var returnValue = undefined; if (navigator.appName == 'Microsoft Internet Explorer') { var ua = navigator.userAgent; var ie = ua.indexOf('MSIE'); returnValue = parseInt(ua.substring(ie+5, ua.indexOf ('.', ie))); } return returnValue; } function autoResizeiFrameHeight(divID,iframeID,sleep_millisec) { var d1,d2; var ieVer = versionMSIE(); if ( ieVer==undefined || ieVer>=9 ) { h1 = document.getElementById(divID).scrollHeight; h2 = document.getElementById(iframeID).contentDocument.body.scrollHeight; d1 = h1+h2+"px"; d2 = document.getElementById(iframeID).style.height; document.getElementById(iframeID).style.height = d1; } else { h1 = document.getElementById(divID).scrollHeight; h2 = document.frames(iframeID).document.body.scrollHeight; d1 = h1+h2+"px"; d2 = document.getElementById(iframeID).style.height; document.getElementById(iframeID).style.height = d1; } window.setTimeout("autoResizeiFrameHeight('"+divID+"','"+iframeID+"',"+sleep_millisec+");", sleep_millisec); } function initDiv2iFrame(divID,iframeID) { loadHtmlDiv2iFrame(divID,iframeID); autoResizeiFrameHeight(divID,iframeID,400); } function setChecked(id) { document.getElementById(id).checked='checked'; } function updateFormAction() { try { var url = ""+document.location; var p1 = url.indexOf("//")+2; var p2 = url.indexOf("/",p1); var host = url.substring(p1,p2); var uri = url.substring(p2); if (document.forms.length>0) { document.forms[0].action = uri; if (document.forms[0].current_page_url) document.forms[0].current_page_url.value = url; } } catch (e) { } } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,""); } function ltrim(stringToTrim) { return stringToTrim.replace(/^\s+/,""); } function rtrim(stringToTrim) { return stringToTrim.replace(/\s+$/,""); } function reloadSection(secName, secUrl, secTime, maxLoop) { if (maxLoop==null) { maxLoop = 100000000; } if ( maxLoop>0 && document.getElementById(secName) != null ) { var sleep_millisec = 1000*secTime; window.setTimeout("repeatSection('"+secName+"','"+secUrl+"',"+secTime+","+maxLoop+");", sleep_millisec); } } function updateSection(secName, secUrl) { try { var d = new Date(); var http = getXmlHttpObject(); var url = secUrl +"&time="+d.getTime(); http.open("GET", url, true); http.onreadystatechange = function() { if (http.readyState==4) { var output = trim( http.responseText ); if ( output.length>0 && output != "null" ) { document.getElementById(secName).innerHTML = output; } } }; try { http.send(null); } catch (e1) { http.send(); } } catch (e2) { } } function repeatSection(secName, secUrl, secTime, loop) { loop = loop - 1; updateSection(secName, secUrl); reloadSection(secName, secUrl, secTime, loop); } function ChatObject(objName,tagName,url,sec,loops) { var chatObjectTimerID = null; var chatObjectName = objName; var defaultChatObjectDiv = tagName; var defaultChatObjectUrl = url; var defaultChatObjectTimerSec = sec; var defaultChatObjectTimerLoop = loops; var chatObjectTimerSec = defaultChatObjectTimerSec; var chatObjectTimerLoop = defaultChatObjectTimerLoop; this.changeChatTimer = function(sec,loops) { chatObjectTimerLoop=loops; if (sec < chatObjectTimerSec ) { chatObjectTimerSec=sec; if ( chatObjectTimerID != null ) { try { this.stopChatTimer(); this.startChatTimer(); } catch(e) {} } } else { chatObjectTimerSec=sec; } }; this.startChatTimer = function() { if (chatObjectTimerLoop==0) { chatObjectTimerSec = defaultChatObjectTimerSec; chatObjectTimerLoop = defaultChatObjectTimerLoop; } if ( document.getElementById(defaultChatObjectDiv) != null ) { var sleep_millisec = 1000*chatObjectTimerSec; chatObjectTimerID = window.setTimeout(chatObjectName+".repeatChatObject();", sleep_millisec); } }; this.stopChatTimer = function() { clearTimeout( chatObjectTimerID ); }; this.repeatChatObject = function() { chatObjectTimerID = null; chatObjectTimerLoop = chatObjectTimerLoop - 1; updateSection(defaultChatObjectDiv, defaultChatObjectUrl); this.startChatTimer(); }; } function beginTag(tagName) { document.write("<"+tagName); } function endTag() { document.write("/>"); } function addTagLine(line) { line = line.replace(/#QT#/g,"\""); document.write(" "+line+" "); } function addTagProp(propName,propValue) { document.write(" "+propName+"=\""+propValue+"\" "); } function addTagPropEnc(propName,propValue) { propValue = propValue.replace(/#dot#/g,".").replace("#http#","http://"); addTagProp(propName,propValue); } function writeLine(line) { line = line.replace(/#b#/g,"<"); line = line.replace(/#e#/g,">"); line = line.replace(/#q#/g,"\""); line = line.replace(/#d#/g,"."); line = line.replace(/#h#/g,"http://"); document.write(line); } function encodeToHex(str) { var r=""; var e=str.length; var c=0; var h; while(c<e) { h=str.charCodeAt(c++).toString(16); while(h.length<3) h="0"+h; r+=h; } return r; } function decodeFromHex(str) { var r=""; var e=str.length; var s; while(e>0) { s=e-3; r=String.fromCharCode("0x"+str.substring(s,e))+r; e=s; } return r; } function changeSelection(selectTagId, optionValue) { document.getElementById(selectTagId).value = optionValue; } function changeParentSelection(selectTagId, optionValue) { parent.document.getElementById(selectTagId).value = optionValue; } function setHomePageUrl() { setHomePageUrl(null) } function setHomePageUrl(thiz,url) { thiz.style.behavior='url(#default#homepage)'; if (url==null) thiz.setHomePage(location.href); else thiz.setHomePage(url); } function showByID(id) { a = document.getElementById(id); a.style.display = 'block'; } function hideByID(id) { a = document.getElementById(id); a.style.display = 'none'; } function postToUrl(url, params) { var form = document.createElement('form'); form.action = url; form.method = 'POST'; for (var key in params) { if (params.hasOwnProperty(key)) { var input = document.createElement('input'); input.type = 'hidden'; input.name = key; input.value = params[key]; form.appendChild(input); } } form.submit(); } function loadSubmit(url,outputID) { var outID = "#"+outputID; jQuery( outID ).load( url ); } function postSubmit1(url,outputID) { var outID = "#"+outputID; jQuery.post( url, function( data ) { jQuery( outID ).empty().append( data ); }); } function postSubmit2(url,inputID,outputID) { var inID = "#"+inputID; var outID = "#"+outputID; jQuery.post( url, jQuery(inID).serialize(), function( data ) { jQuery( outID ).empty().append( data ); }); } function postSubmit3(url,inputID,outputID,evalJsInID) { var inID = "#"+inputID; var outID = "#"+outputID; jQuery.post( url, jQuery(inID).serialize(), function( data ) { jQuery( outID ).empty().append( data ); var jsContainer = jQuery("#"+evalJsInID); if ( jsContainer.length ) eval( jsContainer.get(0).innerHTML ); }); } function postSubmit4(url) { jQuery.post( url ); } function postSubmit5(url,inputID) { var inID = "#"+inputID; jQuery.post( url, jQuery(inID).serialize() ); } function GSubmit(url,outputID) { loadSubmit(url,outputID); } function YSubmit(url,outputID) { postSubmit1(url,outputID); } function PSubmit(url,inputID,outputID) { postSubmit2(url,inputID,outputID); } function JSubmit(url,inputID,outputID,jsID) { postSubmit3(url,inputID,outputID,jsID); } function ZSubmit(url,outputID) { PSubmit(url,'form1',outputID); } function jsZSubmit(url,outputID) { ZSubmit(url,outputID); } function RSubmit1(url) { postSubmit4(url); } function RSubmit2(url,inputID) { postSubmit5(url,inputID); } function RSubmit(url) { postSubmit5(url,'form1'); } function XRSubmit(clickedby_value) { document.forms[0].clickedby.value=clickedby_value; url=document.forms[0].action; RSubmit(url); } function mouseX(evt) { if (evt.pageX) return evt.pageX; else if (evt.clientX) return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); else return null; } function mouseY(evt) { if (evt.pageY) return evt.pageY; else if (evt.clientY) return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); else return null; } function tooltipOver(e,txt,tooltipID){ var a = document.getElementById(tooltipID); a.innerHTML=txt; a.style.display="block"; posx=mouseX(e); posy=mouseY(e); a.style.left=posx+'px'; a.style.top=posy+'px'; } function tooltipOut(tooltipID){ a = document.getElementById(tooltipID); a.style.display="none"; } 

