bw=new BrowserCheck(); function ChekCookie(){ var tmpcookie = new Date(); chkcookie = (tmpcookie.getTime() + ''); document.cookie = "chkcookie=" + chkcookie + "; path=/"; if (document.cookie.indexOf(chkcookie,0) < 0) { alett("Hey dude"); } else { } } function ChekJS(){ alert("Pane Javascript uugama!"); } function addfav(url,header){ window.external.addfavorite(url,header); } function OpenPhraseQuickEdit(url) { document.open(url,'phrase_quick_edit','height=200,width=250'); } function openpopup(){ var popurl="http://www.cvkeskus.ee" winpops=window.open(popurl,"","width=400,height=338,") } function AvaAken(url) { AvaSuurAken(url); } function AvaSuurAken(url) { kaugusH=10; kaugusV=10; laius=Min(800,screen.availWidth-50); korgus=Min(550,screen.availHeight-50); aknoo=open(url,"displayWindow", "top="+kaugusH+",left="+kaugusV+",width="+laius+",height="+korgus+","+ "resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no"); aknoo.focus(); } function AvaVaikeAken(url) { kaugusH=10; kaugusV=10; laius=Math.min(330,screen.availWidth-50); korgus=Math.min(610,screen.availHeight-50); aknoo=open(url,"displayWindow", "top="+kaugusH+",left="+kaugusV+",width="+laius+",height="+korgus+","+ "resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no"); aknoo.focus(); } function AvaVaikePopup(url) { kaugusH=10; kaugusV=10; laius=Math.min(350,screen.availWidth-50); korgus=Math.min(300,screen.availHeight-50); aknoo=open(url,"displayWindow", "top="+kaugusH+",left="+kaugusV+",width="+laius+",height="+korgus+","+ "resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no"); aknoo.focus(); } function loadHelp(url) { kaugusH=10; kaugusV=10; laius=Math.min(430,screen.availWidth-50); korgus=Math.min(410,screen.availHeight-50); aknoo=open(url,"help", "top="+kaugusH+",left="+kaugusV+",width="+laius+",height="+korgus+","+ "resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no"); aknoo.focus(); } function Max(yks,kaks) { if(yks>kaks) return yks; return kaks; } function Min(yks,kaks) { if(yks-1 this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0; this.ie4=(document.all && !this.dom && !this.opera5)?1:0; this.ie=this.ie4||this.ie5||this.ie6; this.mac=this.agent.indexOf("Mac")>-1; this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; this.ns4=(document.layers && !this.dom)?1:0; this.ns=this.ns4||this.ns6; this.bw=(this.ie||this.ns||this.opera5); return this; } function SetLayerText(layer_id,text) { bw=new BrowserCheck(); if(bw.dom) { document.getElementById(layer_id).innerHTML=text; } else if(bw.ie4) { document.all[layer_id].innerHTML=tekst; } else if(bw.ns4) { document.layers[layer_id].document.open(); document.layers[layer_id].document.write(tekst); document.layers[layer_id].document.close(); } } function SetLayerTextForWindow(window_name,layer_id,text) { bw=new BrowserCheck(); if(bw.dom) { window_name.document.getElementById(layer_id).innerHTML=text; } else if(bw.ie4) { window_name.document.all[layer_id].innerHTML=tekst; } else if(bw.ns4) { window_name.document.layers[layer_id].document.open(); window_name.document.layers[layer_id].document.write(tekst); window_name.document.layers[layer_id].document.close(); } } function IsChecked(obj) { if(obj.length==null) { return obj.checked; } else { for(i=0; i< obj.length; i++) { if(obj[i].checked) return true; } return false; } } function GetObject(obj_id) { bw=new BrowserCheck(); if(bw.dom) { return document.getElementById(obj_id); } else if(bw.ie4) { return document.all[obj_id]; } else if(bw.ns4) { return document[obj_id]; } } function ToggleCheckboxes(frm,obj_name,value) { for(i=0; i< frm.elements.length; i++) { if( (frm.elements[i].name==obj_name) || (frm.elements[i].name.slice(0,obj_name.length+1)==obj_name+"[") ) { frm.elements[i].checked=value; } } return true; } function AvaLeht(url) { laius=screen.Width-15; korgus=screen.Height-200; aknoo=open(url,"Uus","width="+laius+",height="+korgus+",top=0,left=0,location=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes,menubar=yes"); aknoo.focus(); } function AvaCAken(url,laius,korgus) { var aken = open(url,"Uus","width="+laius+",height="+korgus+",top=0,left=0,resizable=yes"); } function GetRadioValue(obj) { if(obj.length==null) { if(obj.checked) { return obj.value; } else { return null; } } else { for(i=0; i< obj.length; i++) { if(obj[i].checked) return obj[i].value; } return null; } } function SetRadioValue(obj,sel_value) { if(obj.length==null) { if(obj.value==sel_value) { obj.checked=true; return true; } return false; } else { for(i=0; i< obj.length; i++) { if(obj[i].value==sel_value) { obj[i].checked=true; return true; } } return false; } } function OpenGfxWindow(url) { aknoo=open(url,"GfxWindow", "top=10,left=10,width=500,height=300,"+ "resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no"); aknoo.focus(); } function BAction1() { document.all.hdiv.style.visibility="hidden"; } function AAction1() { document.all.hdiv.style.visibility="visible"; } function OpenWindow(url,laius,korgus) { kaugusH=10; kaugusV=10; laius=Math.min(laius,screen.availWidth-50); korgus=Math.min(korgus,screen.availHeight-50); aknoo=open(url,"displayWindow","width="+laius+",height="+korgus+",top=0,left=0,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no"); aknoo.focus(); } function getSelectionStart(input) { if(bw.ns) { return input.selectionStart; } else if(bw.ie) { selectedRange = document.selection.createRange().duplicate(); selectedRange.moveEnd("character",input.value.length); pos=input.value.lastIndexOf(selectedRange.text); if (selectedRange.text=="") pos=input.value.length; return pos; } } function getSelectionEnd(input) { if(bw.ns) { return input.selectionEnd; } else if(bw.ie) { selectedRange = document.selection.createRange().duplicate(); selectedRange.moveStart("character",-input.value.length); pos=selectedRange.text.length; return pos; } } function HideLayer(layer_id) { document.getElementById(layer_id).style.display='none'; } function UnhideLayer(layer_id) { document.getElementById(layer_id).style.display='block'; } function IsLayerHidden(layer_id) { var hidden=document.getElementById(layer_id).style.display='none'; return hidden; } function ToggleLayerVisibility(layer_id) { if(document.getElementById(layer_id).style.display=='none') { UnhideLayer(layer_id); } else { HideLayer(layer_id); } } function File2Path(frm,object,target) { for( counter=0; counter'); } } function JsInitStickyObject(obj,timeout) { var reg_exp = ''; reg_exp = /([0-9]+)(\.[0-9]+)?px/; so_obj = obj; so_timeout = timeout; so_top = JsGetObjStyle(so_obj,'top','top'); so_top = Number(so_top.replace(reg_exp, "$1")); so_cur_top = so_top; JsMoveStickyObject(); } function JsMoveStickyObject() { var new_top = 0; if (window.innerHeight) { new_top = window.pageYOffset } else if (document.documentElement && document.documentElement.scrollTop) { new_top = document.documentElement.scrollTop } else if (document.body) { new_top = document.body.scrollTop } new_top = new_top + so_top; if (new_top == so_cur_top) so_obj.style.top = new_top; so_cur_top = new_top; var temp = setTimeout('JsMoveStickyObject()',so_timeout); } function JsSend2Invisible(url) { var invincible = document.getElementById('invisible'); if (!invincible) return false; invincible.contentWindow.location.replace(url); return true; } function JsOpenWindow(url,max_width,max_height,window_name) { var left = 20; var top = 20; var width = Math.min(max_width, screen.availWidth - 2*left); var height = Math.min(max_height, screen.availHeight - 2*top - 70); if (!window_name) window_name = '_blank'; var props = 'width='+width+',outerWidth='+width+',height='+height+',outerHeight='+height+ ',top='+top+',screenY='+top+',left='+left+',screenX='+left; var props2 = 'directories=0,location=1,menubar=0,resizable=1,scrollbars=1,status=1'; var win = window.open(url,window_name,props+','+props2); win.focus(); } function JsOpenWindowNH(url,max_width,max_height,window_name) { var left = 20; var top = 20; var width = Math.min(max_width, screen.availWidth - 2*left); var height = Math.min(max_height, screen.availHeight - 2*top - 70); if (!window_name) window_name = '_blank'; var props = 'width='+width+',outerWidth='+width+',height='+height+',outerHeight='+height+ ',top='+top+',screenY='+top+',left='+left+',screenX='+left; var props2 = 'directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=1'; var win = window.open(url,window_name,props+','+props2); win.focus(); }