function Left(str, n) { if (n <= 0) return ""; else if (n > String(str).length) return str; else return String(str).substring(0,n); } $(function(){ $('#dialog').dialog({ autoOpen: true, width: 600, position: top, resizable: false, buttons: { "Remind Me Later": function() { $(this).dialog("close"); }, "Start/Stop Auto Walk": function() { rmd = true; if (window.auto == true) { ta='';ta = confirm("Are you sure want to stop the timer?"); if (ta) { window.auto = false; $(this).dialog("close"); } } else if (window.auto ==false) { window.auto = true; alert("The timer is enabled now"); $(this).dialog("close"); } }, "Report Broken Link": function() { tny='';tny = prompt("I need your reasons :"); if (tny) { $(this).dialog("close"); dialog("#share","bad",window.jengah[0],tny); } }, "Shorten URL": function() { tny='';tny = confirm("Are you sure want to shortten this url?"); if (tny) { $(this).dialog("close"); dialog("#share","short",window.jengah[0]); } } } }); $('li.mn').cluetip({splitTitle: '|'}); $('li.menuatas').cluetip({splitTitle: '|'}); $("#progressbar").progressbar({value: wkt}); $(".search").keyup(function() { var searchbox = document.getElementById('searchbox').value; var dataString = 'isearchword=' + searchbox; window.jengah[7] = searchbox; $("#display").html('
Searching your request
').show(); $.ajax({ type: "POST", url: "suggest.php", data: dataString, cache: false, success: function(html) { $("#display").html(html).show(); } }); $("#dialog").dialog("close"); }); $("#searchbox").Watermark("Search"); $(".search").mousedown(function(){ //$("#searchbox").focus(); $("#display").show(); $("#dialog").dialog("close"); }); $('#display').hover( function () { //do nothing }, function () { $(this).hide(); }); $(window).bind("beforeunload", function(e){ //har = confirm('Jengah! Walk Read and share\n\nThanks for your visit.\nWe need your confirm to exit our web.'); return false; }); window.abispindah = false; }); function waktu() { if (wkt >0 && auto == true) wkt = wkt-1; if (wkt == 115) { uia = window.path + 'blogwalk.php?blogid=' + window.jengah[0] + '&url=' + window.jengah[1] + '&surfwords=' + window.jengah[7]; if (window.abispindah == false) { pergi.location.href = uia; window.abispindah = false; } } if (wkt == 105) $('#dialog').dialog("close"); if ((wkt < 10) && (rmd == false)) {$("#dialog").dialog("open");rmd = true;} //if ((wkt == 50) && (auto == true)) { bacadata();} if ((wkt == 0) && (auto == true)) { pindah();} $('#progressbar').progressbar('option', 'value', wkt); $('#wak').html(wkt); $('#wik').html(wkt); setTimeout(waktu,1000); } function buka(id,url,cmd,str) { $(id).html('Please wait '); $.post(url, {cmd: ""+cmd+"",str: ""+str+""}, function(data){ if(data.length >0) { $(id).html(data); } }); } function dialog(ktk,cmd,str) { $(ktk).dialog("option","show","blind"); $(ktk).dialog("option","resizable","false"); $(ktk).dialog( {close: function() { $(this).dialog( 'destroy' ) }, open: function() { if (cmd != '') { buka('#share',window.path + 'rpc.php',cmd,str);} else { $(this).html(str);} } }); } function pindah(ke) { window.wkt = 120; if (!ke) ke = 6; $('#blogid').html(window.jengah[ke]); window.jengah[0] = window.jengah[ke]; pergi.location.href = window.path + 'blogwalk.php?blogid=' + window.jengah[ke] + '&url=' + window.jengah[1] + '&surfwords=' + window.jengah[7]; bacadata(window.jengah[ke]); $("#dialog").dialog("close"); $("#dialog").dialog("open"); window.abispindah = false; } function bacadata(blogid) { var jengah = new Array(); jengah = window.jengah; $('#now').hide(); $('#url').html('Jengah! Walk, Read and Share - Your Blog Walking Tools'); $('#ttp').hide(); $('#wait').html('Please wait while receiving information

'); $.post('rpc.php', {cmd: "surf",str: ""+blogid+"",srf: ""+jengah[7]+""}, function(data){ if(data.length >0) { var tem = new Array(); tem = data.split("#JENGAH#"); window.jengah[0] = tem[0]; window.jengah[1] = tem[1]; window.jengah[2] = tem[2]; window.jengah[3] = tem[3]; window.jengah[4] = tem[4]; window.jengah[5] = tem[5]; window.jengah[6] = tem[6]; window.jengah[7] = tem[7]; window.jengah[8] = tem[8]; $('#url').html(Left(window.jengah[1],30)); $('#url2').html(window.jengah[1]); $('#blogid').html(window.jengah[0]); $('#title').html(window.jengah[2]); $('#description').html(window.jengah[3]); $('#keywords').html(window.jengah[4]); $('#viewed').html(window.jengah[8]); $('#wait').html(''); $('#ttp').show(); $('#now').show(); document.title = window.jengah[2] + " | " + window.jengah[1] + " | Jengah! Walk Read And Share"; } }); }