/*
var http_root = "https://www.spappmonitoring.com/"
var http_root_unecrypted = "http://www.spappmonitoring.com/"
*/
var http_root = "https://www.spappmonitoring.com/"
var show_log_window = null;
$('document').ready(function(){
$('.dispaly_new_version_warn .close-btn').click(function(){
$('.dispaly_new_version_warn').animate({'top':'-200px'},500,function(){
});
return false;
})
$('#accept_cookies').click(function(){
$('#cookie_disclaimer').hide();
$.ajax({
url: "/m/content/set_cookies",
type: "POST",
dataType: "html"
});
})
$('#no_accept_cookies').click(function(){
location.href = "/m/content/cancel_cookies";
})
$(".link_lang_sel").show();
$('.display_sel_lang').click(function(){
$('.display_all_lang').slideDown("slow");
$('.display_sel_lang a').css("color", "#FFFFFF");
$('.display_sel_lang a').removeClass("arrow_black");
$('.display_sel_lang a').addClass("arrow_white");
return false;
})
$('html').click(function(e) {
if(!$(e.target).hasClass('display_sel_lang') )
{
$('.display_sel_lang a').css("color", "#000000");
$('.display_sel_lang a').removeClass("arrow_white");
$('.display_sel_lang a').addClass("arrow_black");
$('.display_all_lang').slideUp("slow");
}
});
$('.div_log_type a').mouseover(function(){
$(this).children('.title').animate({ fontSize: "14px" }, 1000 ).clearQueue()
$(this).children('.new').animate({ color: "#f00" }, 1000 ).clearQueue()
})
$('.div_log_type a').mouseout(function(){
$(this).children('.title').animate({ fontSize: "12px" }, 1000 ).clearQueue()
$(this).children('.new').animate({ color: "#000" }, 1000 ).clearQueue()
})
$('#phone_info_back').click(function(){
window.location = http_root + "spy/index";
});
$( ".datepicker" ).datepicker();
$( ".tooltip-event" ).tooltip({
show: null,
position: {
my: "left top",
at: "left bottom"
},
open: function( event, ui ) {
ui.tooltip.animate({ top: ui.tooltip.position().top + 10 }, "fast" );
}
});
// bind form using ajaxForm
$('#newsletter_form').ajaxForm({
// target identifies the element(s) to update with the server response
target: '#div_res',
// success identifies the function to invoke when the server response
// has been received; here we apply a fade-in effect to the new content
success: function() {
$('#div_res').fadeIn('slow');
}
});
$('#newsletter_but').click(function (){
$('#newsletter_form').submit();
return false;
});
$( "#email_login_left" ).blur(function (){
if($( "#email_login_left" ).val() == ''){
$( "#email_login_left" ).val('Email');
}
});
$( "#email_login_left" ).focus(function (){
if($( "#email_login_left" ).val() == 'Email'){
$( "#email_login_left" ).val('');
}
});
$( "#parola_login_left" ).blur(function (){
if ($('#parola_login_left').attr('value') == '') {
$('#parola_login_left').hide();
$('#fakepassword').show();
}
});
$( "#fakepassword" ).focus(function (){
$('#fakepassword').hide();
$('#parola_login_left').show();
$('#parola_login_left').focus();
});
$( "#email_news_left" ).blur(function (){
if($( "#email_news_left" ).val() == ''){
$( "#email_news_left" ).val('Email');
}
});
$( "#email_news_left" ).focus(function (){
if($( "#email_news_left" ).val() == 'Email'){
$( "#email_news_left" ).val('');
}
});
$("#filters_header").click(function () {
img = $(this).css('background-image');
if(img.match('orange_arrow_up.png') ){
$(this).css('background-image', 'url(images/orange_arrow_down.png)');
var options = {};
$( "#filters_container" ).hide( "blind", options, 1000, function(){} );
}
else{
$(this).css('background-image', 'url(images/orange_arrow_up.png)');
var options = {};
$( "#filters_container" ).show( "blind", options, 1000, function(){} );
}
});
$('#sms_checkbox, #phone_checkbox, #gps_checkbox, #ring_checkbox, #power_checkbox, #browser_checkbox, #mms_checkbox, #pic_checkbox, #facebook_checkbox, #whatsapp_checkbox, #contact_checkbox, #calendar_checkbox, #viber_checkbox, #skype_checkbox, #line_checkbox, #soft_checkbox, #record_checkbox, #kik_checkbox, #tango_checkbox, #snapchat_checkbox, #video_checkbox, #hangouts_checkbox, #track_checkbox, #twitter_checkbox').change(function (){
redirect_log_type();
});
$('#demo_sms_checkbox, #demo_phone_checkbox, #demo_gps_checkbox, #demo_ring_checkbox, #demo_power_checkbox, #demo_browser_checkbox, #demo_mms_checkbox').change(function (){
demo_redirect_log_type();
});
$('#select_device').change(function (){
window.location = "spy/logs/" + $('#select_device').val();
});
$('a.support_a').click(function (){
$(this).parent().children('.support_p').slideToggle('slow');
return false;
});
$('#log_out_button').click(function (){
$.prompt("Are you sure you want to log out?", {
title: "Log out",
buttons: { "Yes": true, "No": false },
submit: function(e,v,m,f){
if(v){
document.location = '/spy/login/log_out';
}
}
});
return false;
});
// 6.0 begin
$('.payment_choose_phone, .choose_payment, #pay_include_voice').change(function(){
var numSelected = parseFloat($("input.payment_choose_phone:checked").length)
var pay = parseFloat($("input.choose_payment:checked").attr('cost'))
if(pay && numSelected){
var price = numSelected * pay;
if($('#pay_include_voice').is(':checked')){
price = price * 2;
}
if(numSelected > 1){
if(numSelected > 10) numSelected = 10;
var discount = 90 - (5 * (numSelected-2))
price = (price * discount)/100
price = price.toFixed(2)
}
$('#payment_total').html("$"+price+"");
$('#payment_total_hid').val("$"+price+"");
}
else{
$('#payment_total').html("");
$('#payment_total_hid').val("");
}
});
// 6.0 end
$(".next_payment").click(function(){
var numSelected = parseFloat($("input.payment_choose_phone:checked").length)
var pay = parseFloat($("input.choose_payment:checked").val())
if(pay && numSelected){
/*
$.prompt("Are you sure you want to continue?", {
title: "Make payment",
buttons: { "Yes": true, "No": false },
submit: function(e,v,m,f){
if(v){
document.getElementById("form_order").submit();
}
}
});
*/
document.getElementById("form_order").submit();
}
else{
$.prompt("Please choose a payment type and the phone/phones for which you want to make the payment.", {
title: "Validation error",
buttons: { "Close": true }
});
}
})
$("#discounts_list").click(function (){
$.prompt("2 phones 10%
3 phones 15%
4 phones 20%
5 phones 25%
6 phones 30%
7 phones 35%
8 phones 40%
9 phones 45%
10 phones 50%", {
title: "Discounts list for multiple phones",
buttons: { "Close": true }
});
return false;
})
$('#delete_account').click(function (){
$.prompt("Are you sure you want to permanently delete your account?", {
title: "Delete your account",
buttons: { "Yes": true, "No": false },
submit: function(e,v,m,f){
if(v){
$('#account_deletion').val(1);
document.getElementById('myForm6').submit();
}
}
});
return false;
});
$('.delete_phone').click(function (){
var id = $(this).attr('id');
$.prompt("Are you sure you want to permanently delete your logs for this phone?", {
title: "Delete logs",
buttons: { "Yes": true, "No": false },
submit: function(e,v,m,f){
if(v){
$('#phone_deletion').val(id);
document.getElementById('myForm6').submit();
}
}
});
return false;
});
$('.delete_all_phone').click(function (){
var id = $(this).attr('id');
$.prompt("Are you sure you want to permanently delete this phone?", {
title: "Delete phone",
buttons: { "Yes": true, "No": false },
submit: function(e,v,m,f){
if(v){
$('#phone_all_deletion').val(id);
document.getElementById('myForm6').submit();
}
}
});
return false;
});
$('.view_last_sms').click(function (){
log_id = $(this).attr('sms_id');
$("#dialog_logs").load(http_root + "spy/get_last_sms/" + log_id );
if(!show_log_window){
show_log_window = $( "#dialog_logs" ).dialog({
modal: true,
width: 950,
height: 600,
buttons: {
"Close": function() {
$( this ).dialog( "close" );
}
}
});
}
else{
show_log_window.dialog('open');
}
return false;
});
});
function show_log(log_id, log_type){
$("#dialog_logs").load(http_root + "spy/display_log/" + log_id + '/' + log_type);
if(!show_log_window){
show_log_window = $( "#dialog_logs" ).dialog({
modal: true,
width: 950,
height: 600,
buttons: {
"Close": function() {
$( this ).dialog( "close" );
}
}
});
}
else{
show_log_window.dialog('open');
}
}
function show_log_demo(log_id, log_type){
$("#dialog_logs").load(http_root + "demo/display_log/" + log_id + '/' + log_type);
if(!show_log_window){
show_log_window = $( "#dialog_logs" ).dialog({
modal: true,
width: 950,
height: 600,
buttons: {
"Close": function() {
$( this ).dialog( "close" );
}
}
});
}
else{
show_log_window.dialog('open');
}
}
function activate_trial(phone_id, phone_name){
$.prompt("Are you sure you want to activate the trial period for "+phone_name+"?", {
title: "Trial",
buttons: { "Yes": true, "No": false },
submit: function(e,v,m,f){
if(v){
var request = $.ajax({
url: "/payment/activate_trial/"+phone_id,
type: "POST",
dataType: "html"
});
request.done(function(msg) {
if(msg == "The trial for this phone was successfully activated"){
$("#trial"+phone_id).hide();
$("#trial_active"+phone_id).html("Active");
}
$.prompt(msg, {
title: "Trial",
buttons: { "Close": true }
});
});
request.fail(function(jqXHR, textStatus) {
//alert( "Request failed: " + textStatus );
});
}
}
});
}
function redirect_log_type(){
type_string = new Array();
i = 0;
if($("#sms_checkbox").prop('checked')){
type_string[i] = "sms";
i++;
}
if($("#phone_checkbox").prop('checked')){
type_string[i] = "phone";
i++;
}
if($("#mms_checkbox").prop('checked')){
type_string[i] = "mms";
i++;
}
if($("#gps_checkbox").prop('checked')){
type_string[i] = "gps";
i++;
}
if($("#ring_checkbox").prop('checked')){
type_string[i] = "ring";
i++;
}
if($("#power_checkbox").prop('checked')){
type_string[i] = "power";
i++;
}
if($("#browser_checkbox").prop('checked')){
type_string[i] = "browser";
i++;
}
if($("#pic_checkbox").prop('checked')){
type_string[i] = "pic";
i++;
}
if($("#facebook_checkbox").prop('checked')){
type_string[i] = "facebook";
i++;
}
if($("#whatsapp_checkbox").prop('checked')){
type_string[i] = "whatsapp";
i++;
}
if($("#contact_checkbox").prop('checked')){
type_string[i] = "contact";
i++;
}
if($("#calendar_checkbox").prop('checked')){
type_string[i] = "calendar";
i++;
}
if($("#viber_checkbox").prop('checked')){
type_string[i] = "viber";
i++;
}
if($("#skype_checkbox").prop('checked')){
type_string[i] = "skype";
i++;
}
if($("#line_checkbox").prop('checked')){
type_string[i] = "line";
i++;
}
if($("#soft_checkbox").prop('checked')){
type_string[i] = "soft";
i++;
}
if($("#record_checkbox").prop('checked')){
type_string[i] = "record";
i++;
}
if($("#kik_checkbox").prop('checked')){
type_string[i] = "kik";
i++;
}
if($("#tango_checkbox").prop('checked')){
type_string[i] = "tango";
i++;
}
if($("#snapchat_checkbox").prop('checked')){
type_string[i] = "snapchat";
i++;
}
if($("#video_checkbox").prop('checked')){
type_string[i] = "video";
i++;
}
if($("#hangouts_checkbox").prop('checked')){
type_string[i] = "hangouts";
i++;
}
if($("#track_checkbox").prop('checked')){
type_string[i] = "track";
i++;
}
if($("#twitter_checkbox").prop('checked')){
type_string[i] = "twitter";
i++;
}
if(type_string){
//window.location = "spy/logs/0/" + type_string.join("_");
$("#form_filters").prop('action', "spy/logs/0/" + type_string.join("_"));
document.getElementById("form_filters").submit();
}
}
function demo_redirect_log_type(){
type_string = new Array();
i = 0;
if($("#demo_sms_checkbox").prop('checked')){
type_string[i] = "sms";
i++;
}
if($("#demo_phone_checkbox").prop('checked')){
type_string[i] = "phone";
i++;
}
if($("#demo_mms_checkbox").prop('checked')){
type_string[i] = "mms";
i++;
}
if($("#demo_gps_checkbox").prop('checked')){
type_string[i] = "gps";
i++;
}
if($("#demo_ring_checkbox").prop('checked')){
type_string[i] = "ring";
i++;
}
if($("#demo_power_checkbox").prop('checked')){
type_string[i] = "power";
i++;
}
if($("#demo_browser_checkbox").prop('checked')){
type_string[i] = "browser";
i++;
}
if(type_string){
//window.location = "spy/logs/0/" + type_string.join("_");
$("#form_filters").prop('action', "demo/logs/0/" + type_string.join("_"));
document.getElementById("form_filters").submit();
}
}
function submit_form_filters_month(id){
$("#sel_month").val(id);
document.getElementById("form_filters").submit();
}
function showContactResponse(responseText, statusText, xhr, $form) {
$('#output1').hide();
$('#contact_submit').removeAttr('disabled');
$.prompt(responseText, {
title: "Contact",
buttons: { "Ok": true},
});
if(responseText.indexOf('The message has been sent') != -1){
$('#contact_form #nume').val("");
$('#contact_form #email').val("");
$('#contact_form #mesaj').val("");
$('#contact_form #question_type').val(0);
$('#possible_questions_holder').hide();
}
}
function showContactRequest(formData, jqForm, options){
$('#output1').show();
$('#contact_submit').attr('disabled', 'disabled');
}
//design v2
function display_home_div(tthis){
tthis.find('p').slideDown()//.clearQueue();
tthis.unbind( "mouseover" );
tthis.bind( "mouseout", function() {
hide_home_div(tthis)
});
}
function hide_home_div(tthis){
tthis.find('p').slideUp()//.clearQueue();
tthis.bind( "mouseover" , function (){
display_home_div(tthis)
});
}
$('document').ready(function(){
$(".home_div").on("mouseover mouseleave",function(event) {
if(event.type == "mouseover"){
$(this).find("p").slideDown();
}
if(event.type == "mouseleave"){
$(this).find("p").stop().slideUp();
}
});
$('#tabs_home #tabs1').show();
$('.tab_action1, .tab_action3, .tab_action2').click(function(){
$('.home_tab').removeClass('active')
$(this).addClass('active')
var click_c = $(this);
if(click_c.hasClass('tab_action1')){
$('#tabs_home .active_tab').stop().fadeOut('slow', function(){
$('#tabs1').fadeIn('slow')
$('.tabs_display').removeClass('active_tab')
$('#tabs1').addClass('active_tab')
});
}
if(click_c.hasClass('tab_action2')){
$('#tabs_home .active_tab').stop().fadeOut('slow', function(){
$('#tabs2').fadeIn('slow')
$('.tabs_display').removeClass('active_tab')
$('#tabs2').addClass('active_tab')
});
}
if(click_c.hasClass('tab_action3')){
$('#tabs_home .active_tab').stop().fadeOut('slow', function(){
$('#tabs3').fadeIn('slow')
$('.tabs_display').removeClass('active_tab')
$('#tabs3').addClass('active_tab')
});
}
})
var sudoSlider = $("#slider").sudoSlider({
auto:true,
pause: '6000',
afterAnimation: function (t) {
if (t == sudoSlider.getValue("totalSlides")) {
sudoSlider.stopAuto();
}
}
});
$('.nextBtn, .prevBtn').addClass("test_hide");
$('#testimonials_div_inner').mouseover(function(){
$('.nextBtn, .prevBtn').removeClass("test_hide");
});
$('#testimonials_div_inner').mouseleave(function(){
$('.nextBtn, .prevBtn').addClass("test_hide");
});
/*
V 7.0
*/
$('#more_button').click(function(){
$('#more_button').fadeOut( 1600 );
$('.menu_hide').fadeIn( 1600 );
});
})