function checkForm(f,inputs) { inputs = inputs.split(','); for(i=0;i 800 ? 800 : screen.availHeight - 100; //screen.availHeight - 100; if(!w) w = screen.availHeight > 900 ? 900 : screen.availWidth - 100; //screen.availWidth - 100; var popUrl = ''; if(url.indexOf('?') == -1) popUrl += '?'; else popUrl += '&'; popUrl += 'popUp=1'; if(!name) { var nd = new Date; name = nd.getHours()+''+nd.getMinutes()+''+nd.getSeconds(); } window.open(rootUrl+url+popUrl,'winName'+name,'width='+w+',height='+h+',scrollbars=1,status=1,top=50,left=50,resizable=1'); } function toggleDiv(id) { var obj = document.getElementById('obj_'+id); if(obj.style.display == '') obj.style.display = 'none'; else obj.style.display = ''; } function submitForm(n) { if(document.forms[n]) { document.forms[n].submit(); } } function doRedirect(url) { window.location = rootUrl+url; } function pImg(file,w,h,title) { var ww = window.open('','pimg','width='+w+',height='+h); ww.document.write(''+unescape(title)+''); ww.document.write(''+unescape(title)+''); ww.document.write(''); ww.focus(); } function calcPayment() { var f = document.forms['formula']; var bruto = f.bruto.value.replace(',','.'); var neto_x = 0; var bruto_x = bruto; neto = f.bruto.value; neto_x = parseInt(bruto * 0.006); f._bruto1.value = bruto; f._bruto2.value = bruto; f._bruto3.value = bruto; f._bruto4.value = bruto; f._bruto5.value = bruto; f.sots.value = parseInt(bruto * 0.33); f.tootusk.value = parseInt(bruto * 0.003); f.bruto_kindl.value = parseInt(bruto * 0.006); if(f.psammas[f.psammas.selectedIndex].value == 1) { neto_x += parseInt(bruto * 0.02); f.bruto_sammas.value = parseInt(bruto * 0.02); document.getElementById('sammas').style.display = ''; } else { document.getElementById('sammas').style.display = 'none'; } f.sum1.value = neto_x; bruto_x = bruto - neto_x; if(f.tulmin[f.tulmin.selectedIndex].value == 1) { bruto_x = bruto_x - 2250; document.getElementById('maksuvaba').style.display = ''; } else { document.getElementById('maksuvaba').style.display = 'none'; } var tulum = parseInt(bruto_x * 0.21); f.sum11.value = tulum; neto = bruto - neto_x - tulum; f.neto.value = neto; f.totalsum.value = parseInt(bruto) + parseInt(f.sots.value) + parseInt(f.tootusk.value); } function calcPaymentNew() { var f = document.forms['formula']; var bruto = f.bruto.value.replace(',','.'); var neto_x = 0; var bruto_x = bruto; neto = f.bruto.value; neto_x = parseInt(bruto * 0.02); f._bruto1.value = bruto; f._bruto2.value = bruto; f._bruto3.value = bruto; f._bruto4.value = bruto; f._bruto5.value = bruto; f.sots.value = parseInt(bruto * 0.33); f.tootusk.value = parseInt(bruto * 0.01); f.bruto_kindl.value = parseInt(bruto * 0.02); if(f.psammas[f.psammas.selectedIndex].value == 1) { neto_x += parseInt(bruto * 0.02); f.bruto_sammas.value = parseInt(bruto * 0.02); document.getElementById('sammas').style.display = ''; } else { document.getElementById('sammas').style.display = 'none'; } f.sum1.value = neto_x; bruto_x = bruto - neto_x; if(f.tulmin[f.tulmin.selectedIndex].value == 1) { bruto_x = bruto_x - 2250; document.getElementById('maksuvaba').style.display = ''; } else { document.getElementById('maksuvaba').style.display = 'none'; } var tulum = parseInt(bruto_x * 0.21); f.sum11.value = tulum; neto = bruto - neto_x - tulum; f.neto.value = neto; f.totalsum.value = parseInt(bruto) + parseInt(f.sots.value) + parseInt(f.tootusk.value); } function calcPaymentAugust2009() { var f = document.forms['formula']; var bruto = f.bruto.value.replace(',','.'); var neto_x = 0; var bruto_x = bruto; neto = f.bruto.value; neto_x = parseInt(bruto * 0.028); f._bruto1.value = bruto; f._bruto2.value = bruto; f._bruto3.value = bruto; f._bruto4.value = bruto; f._bruto5.value = bruto; f.sots.value = parseInt(bruto * 0.33); f.tootusk.value = parseInt(bruto * 0.014); f.bruto_kindl.value = parseInt(bruto * 0.028); if(f.psammas[f.psammas.selectedIndex].value == 1) { neto_x += parseInt(bruto * 0.02); f.bruto_sammas.value = parseInt(bruto * 0.02); document.getElementById('sammas').style.display = ''; } else { document.getElementById('sammas').style.display = 'none'; } f.sum1.value = neto_x; bruto_x = bruto - neto_x; if(f.tulmin[f.tulmin.selectedIndex].value == 1) { bruto_x = bruto_x - 2250; document.getElementById('maksuvaba').style.display = ''; } else { document.getElementById('maksuvaba').style.display = 'none'; } var tulum = parseInt(bruto_x * 0.21); f.sum11.value = tulum; neto = bruto - neto_x - tulum; f.neto.value = neto; f.totalsum.value = parseInt(bruto) + parseInt(f.sots.value) + parseInt(f.tootusk.value); } function calcPaymentJanuary2011() { var f = document.forms['formula']; var bruto = f.bruto.value.replace(',','.'); bruto = Math.round(parseFloat(bruto,10) * 100) / 100; var neto_x = 0; var bruto_x = bruto; neto_x = Math.round(parseFloat(bruto * 0.028,10) * 100) / 100; f._bruto1.value = bruto; f._bruto2.value = bruto; f._bruto3.value = bruto; f._bruto4.value = bruto; f._bruto5.value = bruto; var sots_EEK = Math.round(parseFloat(bruto * 0.33,10) * 100) / 100; var sots_EUR = Math.round(sots_EEK / 15.6466 * 100) / 100; var tootusk_EEK = Math.round(parseFloat(bruto * 0.014,10) * 100) / 100; var tootusk_EUR = Math.round(tootusk_EEK / 15.6466 * 100) / 100; var bruto_tootuskindlustus_EEK = Math.round(parseFloat(bruto * 0.028,10) * 100) / 100; var bruto_tootuskindlustus_EUR = Math.round(bruto_tootuskindlustus_EEK / 15.6466 * 100) / 100; f.bruto_kindl.value = bruto_tootuskindlustus_EEK + ' (€ ' + bruto_tootuskindlustus_EUR + ')'; if(f.psammas[f.psammas.selectedIndex].value == 1) { var bruto_sammas_EEK = Math.round(parseFloat(bruto * 0.01,10) * 100) / 100; var bruto_sammas_EUR = Math.round(bruto_sammas_EEK / 15.6466 * 100) / 100; f.bruto_sammas.value = bruto_sammas_EEK + ' (€ ' + bruto_sammas_EUR + ')'; document.getElementById('kogumispensioni_samba_protsent').value = '1'; document.getElementById('sammas').style.display = ''; neto_x += bruto_sammas_EEK; } else if(f.psammas[f.psammas.selectedIndex].value == 2) { var bruto_sammas_EEK = Math.round(parseFloat(bruto * 0.02,10) * 100) / 100; var bruto_sammas_EUR = Math.round(bruto_sammas_EEK / 15.6466 * 100) / 100; f.bruto_sammas.value = bruto_sammas_EEK + ' (€ ' + bruto_sammas_EUR + ')'; document.getElementById('kogumispensioni_samba_protsent').value = '2'; document.getElementById('sammas').style.display = ''; neto_x += bruto_sammas_EEK; } else { document.getElementById('sammas').style.display = 'none'; } f.sum1.value = neto_x; bruto_x = bruto - neto_x; if(f.tulmin[f.tulmin.selectedIndex].value == 1) { bruto_x = bruto_x - 2253.11; document.getElementById('maksuvaba').style.display = ''; } else { document.getElementById('maksuvaba').style.display = 'none'; } var tulum_EEK = Math.round(parseFloat(bruto_x * 0.21,10) * 100) / 100; var tulum_EUR = Math.round(tulum_EEK / 15.6466 * 100) / 100; f.sum11.value = tulum_EEK + ' (€ ' + tulum_EUR + ')'; neto_EEK = Math.round( parseFloat(bruto - neto_x - tulum_EEK,10) * 100) / 100; neto_EUR = Math.round(neto_EEK / 15.6466 * 100) / 100; f.neto.value = neto_EEK + ' (€ ' + neto_EUR + ')'; f.sots.value = sots_EEK + ' (€ ' + sots_EUR + ')' f.tootusk.value = tootusk_EEK + ' (€ ' + tootusk_EUR + ')' var total_EEK = bruto + sots_EEK + tootusk_EEK; var total_EUR = Math.round(total_EEK / 15.6466 * 100) / 100; f.totalsum.value = total_EEK + ' (€ ' + total_EUR + ')' } function calcPayment2011() { var f = document.forms['formula']; var bruto = f.bruto.value.replace(',','.'); bruto = Math.round(parseFloat(bruto,10) * 100) / 100; var neto_x = 0; var bruto_x = bruto; neto_x = Math.round(parseFloat(bruto * 0.028,10) * 100) / 100; f._bruto1.value = bruto; f._bruto2.value = bruto; f._bruto3.value = bruto; f._bruto4.value = bruto; f._bruto5.value = bruto; var sots_EUR = Math.round(parseFloat(bruto * 0.33,10) * 100) / 100; var sots_EEK = Math.round(sots_EUR * 15.6466); var tootusk_EUR = Math.round(parseFloat(bruto * 0.014,10) * 100) / 100; var tootusk_EEK = Math.round(tootusk_EUR * 15.6466); var bruto_tootuskindlustus_EUR = Math.round(parseFloat(bruto * 0.028,10) * 100) / 100; var bruto_tootuskindlustus_EEK = Math.round(bruto_tootuskindlustus_EUR * 15.6466); f.bruto_kindl.value = '€ ' + bruto_tootuskindlustus_EUR + ' (' + bruto_tootuskindlustus_EEK + ' EEK)'; if(f.psammas[f.psammas.selectedIndex].value == 1) { var bruto_sammas_EUR = Math.round(parseFloat(bruto * 0.01,10) * 100) / 100; var bruto_sammas_EEK = Math.round(bruto_sammas_EUR * 15.6466); f.bruto_sammas.value = '€ ' + bruto_sammas_EUR + ' (' + bruto_sammas_EEK + ' EEK)'; document.getElementById('kogumispensioni_samba_protsent').value = '1'; document.getElementById('sammas').style.display = ''; neto_x += bruto_sammas_EUR; } else if(f.psammas[f.psammas.selectedIndex].value == 2) { var bruto_sammas_EUR = Math.round(parseFloat(bruto * 0.02,10) * 100) / 100; var bruto_sammas_EEK = Math.round(bruto_sammas_EUR * 15.6466); f.bruto_sammas.value = '€ ' + bruto_sammas_EUR + ' (' + bruto_sammas_EEK + ' EEK)'; document.getElementById('kogumispensioni_samba_protsent').value = '2'; document.getElementById('sammas').style.display = ''; neto_x += bruto_sammas_EUR; } else { document.getElementById('sammas').style.display = 'none'; } f.sum1.value = neto_x; bruto_x = bruto - neto_x; if(f.tulmin[f.tulmin.selectedIndex].value == 1) { bruto_x = bruto_x - 144.0; document.getElementById('maksuvaba').style.display = ''; } else { document.getElementById('maksuvaba').style.display = 'none'; } var tulum_EUR = Math.round(parseFloat(bruto_x * 0.21,10) * 100) / 100; var tulum_EEK = Math.round(tulum_EUR * 15.6466); f.sum11.value = '€ ' + tulum_EUR + ' (' + tulum_EEK + ' EEK)'; neto_EUR = Math.round( parseFloat(bruto - neto_x - tulum_EUR,10) * 100) / 100; neto_EEK = Math.round(neto_EUR * 15.6466); f.neto.value = '€ ' + neto_EUR + ' (' + neto_EEK + ' EEK)'; f.sots.value = '€ ' + sots_EUR + ' (' + sots_EEK + ' EEK)'; f.tootusk.value = '€ ' + tootusk_EUR + ' (' + tootusk_EEK + ' EEK)' var total_EUR = Math.round( 100 * (bruto + sots_EUR + tootusk_EUR)) / 100; var total_EEK = Math.round(total_EUR * 15.6466); f.totalsum.value = '€ ' + total_EUR + ' (' + total_EEK + ' EEK)' } function calcPaymentApril() { var f = document.forms['formula']; f.neto.value = ''; var bruto = f.bruto.value.replace(',','.'); bruto = 10.0 * Math.round(parseFloat(bruto,10) * 100) / 100; var neto_x = 0; var bruto_x = bruto; neto_x = Math.round(parseFloat(bruto * 0.028,10) * 100) / 100; f._bruto1.value = bruto; f._bruto2.value = bruto; f._bruto3.value = bruto; f._bruto4.value = bruto; f._bruto5.value = bruto; var sots_EUR = Math.round(parseFloat(bruto * 0.33,10) * 100) / 100; var sots_EEK = Math.round(sots_EUR * 15.6466); var tootusk_EUR = Math.round(parseFloat(bruto * 0.014,10) * 100) / 100; var tootusk_EEK = Math.round(tootusk_EUR * 15.6466); var bruto_tootuskindlustus_EUR = Math.round(parseFloat(bruto * 0.028,10) * 100) / 100; var bruto_tootuskindlustus_EEK = Math.round(bruto_tootuskindlustus_EUR * 15.6466); f.bruto_kindl.value = '€ ' + bruto_tootuskindlustus_EUR + ' (' + bruto_tootuskindlustus_EEK + ' EEK)'; if(f.psammas[f.psammas.selectedIndex].value == 1) { var bruto_sammas_EUR = Math.round(parseFloat(bruto * 0.01,10) * 100) / 100; var bruto_sammas_EEK = Math.round(bruto_sammas_EUR * 15.6466); f.bruto_sammas.value = '€ ' + bruto_sammas_EUR + ' (' + bruto_sammas_EEK + ' EEK)'; document.getElementById('kogumispensioni_samba_protsent').value = '1'; document.getElementById('sammas').style.display = ''; neto_x += bruto_sammas_EUR; } else if(f.psammas[f.psammas.selectedIndex].value == 2) { var bruto_sammas_EUR = Math.round(parseFloat(bruto * 0.02,10) * 100) / 100; var bruto_sammas_EEK = Math.round(bruto_sammas_EUR * 15.6466); f.bruto_sammas.value = '€ ' + bruto_sammas_EUR + ' (' + bruto_sammas_EEK + ' EEK)'; document.getElementById('kogumispensioni_samba_protsent').value = '2'; document.getElementById('sammas').style.display = ''; neto_x += bruto_sammas_EUR; } else { document.getElementById('sammas').style.display = 'none'; } f.sum1.value = neto_x; bruto_x = bruto - neto_x; if(f.tulmin[f.tulmin.selectedIndex].value == 1) { bruto_x = bruto_x - 144.0; document.getElementById('maksuvaba').style.display = ''; } else { document.getElementById('maksuvaba').style.display = 'none'; } var tulum_EUR = Math.round(parseFloat(bruto_x * 0.21,10) * 100) / 100; var tulum_EEK = Math.round(tulum_EUR * 15.6466); f.sum11.value = '€ ' + tulum_EUR + ' (' + tulum_EEK + ' EEK)'; neto_EUR = Math.round( parseFloat(bruto - neto_x - tulum_EUR,10) * 100) / 100; neto_EEK = Math.round(neto_EUR * 15.6466); var r = Math.floor(Math.random()*5); switch(r) { case 0: f.neto.value = 'Sinu töötasu on liiga väike arvestades maksukoormust'; break; case 1: f.neto.value = 'Sinu töötasu ei kata maksukoormust'; break; case 2: f.neto.value = 'Maksukoormus on liiga suur, et teha mõistlikke väljamakseid'; break; case 3: f.neto.value = 'Maksude optimeerimine pole sellise tasu juures võimalik'; break; case 4: f.neto.value = 'Sinu tasu on liiga suur ja koormab tööandjat liigselt'; break; default: f.neto.value = '€ ' + neto_EUR + ' (' + neto_EEK + ' EEK)'; } f.sots.value = '€ ' + sots_EUR + ' (' + sots_EEK + ' EEK)'; f.tootusk.value = '€ ' + tootusk_EUR + ' (' + tootusk_EEK + ' EEK)' var total_EUR = Math.round( 100 * (bruto + sots_EUR + tootusk_EUR)) / 100; var total_EEK = Math.round(total_EUR * 15.6466); f.totalsum.value = '€ ' + total_EUR + ' (' + total_EEK + ' EEK)' } function admSearch(type, idInput, nameInput) { doWin('.admin/search/?Type='+type+'&idInput='+idInput+'&nameInput='+nameInput, 300, 500, 'search'); } function voidme(s,x) { window.location = 'mailto:'+s+'@'+x; } function navi(vars, vals) { var f = document.forms['naviform']; if(!f) { return; } for(i = 0; i < vars.length; i++) { if(f[vars[i]]) { f[vars[i]].value = vals[i]; } else { var newinp = document.createElement('input'); newinp.setAttribute('type','hidden'); newinp.setAttribute('name',vars[i]); newinp.setAttribute('value',vals[i]); f.appendChild(newinp); } } f.submit(); } function setTextSize(i) { var f = document.forms['textsize']; f.uset_textsize2.value = parseInt(f.uset_textsize2.value) + i; f.submit(); } function getWindowHeight() { var myHeight = 0; if( typeof( window.innerWidth ) == "number" ) { //Non-IE myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in "standards compliant mode" myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myHeight = document.body.clientHeight; } return myHeight; } function getWindowWidth() { var myWidth = 0; if( typeof( window.innerWidth ) == "number" ) { //Non-IE myWidth = window.innerWidth; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in "standards compliant mode" myWidth = document.documentElement.clientWidth; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; } return myWidth; } function clock() { isIE6 = navigator.userAgent.toLowerCase().indexOf('msie 6') != -1; //if (isIE6) return false; var x = self.getWindowWidth(); if (x>1180) { if (document.getElementById('clock')) { var o = document.getElementById('clock'); var c = document.getElementById('clockDiv'); var t = document.getElementById('clockText'); var right = (parseInt((x-960)/2, 10) - 154) + 'px'; c.style.right = o.style.right = right; t.style.right = (parseInt((x-960)/2, 10) - 115); try {embed = this.document.standardCreateElement('embed');} catch(e) {} if (typeof(embed) != 'object') embed = this.document.createElement('embed'); embed.setAttribute('width',150); embed.setAttribute('height',150); embed.setAttribute('src','http://www.clocklink.com/clocks/0018-orange.swf?TimeZone=Estonia_Tallinn&'); embed.setAttribute('wmode','transparent'); try { document.getElementById('clock').appendChild(embed); t.style.display = c.style.display = o.style.display = ''; } catch(e) {}; } } if (document.getElementById('counterMain')) { if (x < 1180) { document.getElementById('counterMain').style.display = 'none'; } else { var right = (parseInt((x-960)/2, 10) - 154) + 'px'; document.getElementById('counterMain').style.display = ''; document.getElementById('counterMain').style.right = right; } } } function doReport(aobj, id) { window.location = '?report='+id; aobj.style.color = '#c0c0c0'; } //CRM function naviCRM(i) { var f = document.forms['toolbar']; if(!f) return; f.page.value = i; f.submit(); } function doWinCRM(url,w,h,name) { var popUrl = ''; popUrl += '&popUp=1'; if('contact' == name) {w = 700; h = 600;} else if('task' == name) {w = 700; h = 450;} else if('order' == name) {w = 700; h = 500;} else if('print' == name) {w = 800; h = 700;} else { if(!h) h = screen.availHeight - 100; if(!w) w = screen.availWidth - 100; } if(!name) { var nd = new Date; name = nd.getHours()+''+nd.getMinutes()+''+nd.getSeconds(); } window.open(rootUrl+'index.php?PID='+url+popUrl,'winName'+name,'width='+w+',height='+h+',scrollbars=1,status=1,top=50,left=50,resizable=1,menubar=1'); } function toolbarSubmit() { var f = document.forms['toolbar']; //f.sort.value = ''; //f.order.value = ''; f.page.value = 0; f.submit(); } function checkAll(field,value) { for (i = 0; i < field.length; i++) field[i].checked = value; } function setSort(sort, order) { var f = document.forms['toolbar']; if (sort == f.sort.value) f.order.value = order; f.sort.value = sort; f.submit(); } function deleteUserLink(id){ if(id) { $.post("/", { controller: 'ajax', act: 'delete_link', id: id }, function(result){ if(result.error==0) { jQuery('#userLink'+id).remove(); } }, "json"); } } function showTaskbarSupport(text, timeout) { jQuery('#taskbar_support').html(text); jQuery('#taskbar_support').show(); if(timeout != false) { setTimeout ( function(){jQuery('#taskbar_support').hide();}, 3000); } } jQuery(function(){ var closeTaskbar = function() { jQuery('#taskbar_link_container').hide(); jQuery('#taskbar_articles_container').hide(); jQuery('#taskbar_help_container').hide(); return false; }; jQuery('.taskbar_close').click(function() {closeTaskbar();}); jQuery('#taskbarShowHelp').click(function(){ closeTaskbar(); jQuery('#taskbar_help_container').show(); jQuery('#taskbarHelpQuestion').focus(); return false; }); jQuery('#taskbarShowArticles').click(function(){ closeTaskbar(); jQuery('#taskbar_articles_container').show(); if(TaskbarArticleTimestamp > 0) { $.post("/", { controller: 'ajax', act: 'update_taskbar_article_id', timestamp: TaskbarArticleTimestamp }, function(result) { if(result.error==0) jQuery('#taskbarNewArticlesCount').text(''); }, "json"); } return false; }); jQuery('#taskbarShowLinks').click(function(){ closeTaskbar(); jQuery('#taskbar_link_container').show(); return false; }); jQuery('#taskbarAddLink').click(function(){ var title = document.title.split('\/').pop().trim(); title = prompt('Uue viite pealkiri',title); var count = ++userLinksCount; if(title.length) { $.post("/", { controller: 'ajax', act: 'add_link', title: title }, function(result){ if(result.id) { var s = []; s.push('
  • ',title,'
    '); s.push('X
  • '); jQuery('#taskbar_link_list').append(s.join('')); } }, "json"); } return false; }); jQuery('#taskbarAddHelp').click(function(){ var question = jQuery('#taskbarHelpQuestion').val().replace('\'','').trim(); if(question.length) { $.post("/", { controller: 'ajax', act: 'add_question', question: question }, function(result){ if(result.error==0) { jQuery('#taskbarHelpQuestion').val(''); showTaskbarSupport('Teie küsimus on saadetud.'); } }, "json"); } jQuery('#taskbar_help_container').hide(); return false; }); var articleId = parseInt(jQuery('#articleId').val(), 10); if(articleId) { if(getCookie('article_like'+articleId)=='1') { jQuery('#article_like').removeClass('articleLike').addClass('articleLiked').text('Kasulik'); } else { jQuery('#article_like').click(function(){ jQuery('#article_like').text('...'); $.post("/", { controller: 'ajax', act: 'article_like', id: articleId }, function(result) { if(result.error==0) { jQuery('#article_like').unbind('click').removeClass('articleLike').addClass('articleLiked').text('Kasulik'); createCookie('article_like'+articleId,1,1); } }, "json"); }); } } }); /* COOKIES */ var clickyDebug = false; function createCookie(cookieName, cookieValue, expireInHours) { if(typeof(expireInHours)=='undefined') expireInHours = 1; var expDate = new Date(); expDate.setHours(expDate.getHours() + expireInHours); // Retrieves cookie value from the node that was past to the function var cookie = cookieName + '=' + cookieValue + ';path=/;expires=' + expDate.toGMTString(); document.cookie = cookie; if(clickyDebug) if(expireInHours > 0) alert('createCookie: ' + cookie); } function getCookie(cookieName) { var allCookies = document.cookie.split(';'); // Splits all of the cookies and puts them in an array var cookieData = ''; for (var i=0; i < allCookies.length; i++) { // Cycle through all of the cookies in the array if ((allCookies[i].indexOf(cookieName)) != -1) { // Test to see if string contains the cookie name match = allCookies[i].replace(' ', ''); // Deletes whitespace that may proceed the cookie name cookieData = match.substr((cookieName.length + 1)); // Assign the substring that follows the cookie name if(clickyDebug) alert('getCookie: ' + cookieName + ' = ' + cookieData); return cookieData; } } if(clickyDebug) alert('getCookie: ' + cookieName + ' NOT FOUND'); return false; } function deleteCookie(cookieName) { createCookie(cookieName,'',-1); // Creates a cookie with a name value and expiration in days if(clickyDebug) alert('deleteCookie: ' + cookieName); } function clickyGoal(name, revenue) { try { if(typeof(revenue)=='undefined') revenue = 0; if(clickyDebug) { alert('clickyGoal: ' + name + ', ' + revenue); } else { clicky.goal( name, revenue ); clicky.pause( 300 ); } } catch(err) {} } jQuery(document).ready(function(){ if(typeof(TagsJavascript)=='undefined') TagsJavascript = []; var search_options = { lookup: TagsJavascript, serviceUrl: '', minChars:0, width:165, delimiter: /(,|;)\s*/, // regex or character deferRequestBy: 0, //milliseconds noCache: true }; if(jQuery('#simpleSearch').length) { search_options['onSelect'] = function(value, data) { jQuery('#simpleSearch').val(value); jQuery('#simpleSearchForm').submit(); } jQuery('#simpleSearch').autocomplete(search_options); } if(jQuery('#detailSearch').length) { search_options['width'] = 200; search_options['onSelect'] = function(value, data) { jQuery('#detailSearch').val(value); jQuery('#detailSearchForm').submit(); } jQuery('#detailSearch').autocomplete(search_options); } if(jQuery('#tag').length) { search_options['width'] = 200; search_options['onSelect'] = function(value, data) { addTag(value); } jQuery('#tag').autocomplete(search_options); } }); jQuery(document).ready(function(){jQuery('#m_seadused').SimpleTip({menuID:'#seadusedMenu',align:'left',startTop:false,includeWidth:true})}); jQuery(document).ready(function(){jQuery('#m_raamatupidamine').SimpleTip({menuID:'#raamatupidamineMenu',align:'left',startTop:false,includeWidth:true})}); jQuery(document).ready(function(){jQuery('#m_maksundus').SimpleTip({menuID:'#maksundusMenu',align:'left',startTop:false,includeWidth:true})}); jQuery(document).ready(function(){jQuery('#m_toooigus').SimpleTip({menuID:'#toooigusMenu',align:'left',startTop:false,includeWidth:true})}); jQuery(document).ready(function(){jQuery('#m_ettevotlus').SimpleTip({menuID:'#ettevotlusMenu',align:'left',startTop:false,includeWidth:true})}); jQuery(document).ready(function(){jQuery('#m_varia').SimpleTip({menuID:'#variaMenu',align:'right',startTop:false,includeWidth:true})}); jQuery(document).ready(function(){jQuery('#m_foorum').SimpleTip({menuID:'#foorumMenu',align:'right',startTop:false,includeWidth:true})}); jQuery(document).ready(function(){jQuery('#m_koolitused').SimpleTip({menuID:'#koolitusedMenu',align:'right',startTop:false,includeWidth:true})}); jQuery(document).ready(function(){jQuery('#m_epood').SimpleTip({menuID:'#epoodMenu',align:'right',startTop:false,includeWidth:true})});