﻿
jQuery.noConflict(); if (jQuery("#loadingBlock")[0] != null) { jQuery("#loadingBlock")[0].style.display = 'none'; }

function MM_preloadImages() { //v3.0
    var d = document; if (d.images) {
        if (!d.MM_p) d.MM_p = new Array();
        var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++)
            if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; }
    }
}

function MM_swapImgRestore() { //v3.0
    var i, x, a = document.MM_sr; for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
}

function MM_findObj(n, d) { //v4.01
    var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
        d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p);
    }
    if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
    for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
    if (!x && d.getElementById) x = d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
    var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2); i += 3)
        if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; }
}




//Specify highlight behavior. "TD" to highlight table cells, "TR" to highlight the entire row:
var highlightbehavior = "TD"

var ns6 = document.getElementById && !document.all
var ie = document.all

function changeto(e, highlightcolor) {
    source = ie ? event.srcElement : e.target
    if (source.tagName == "TABLE")
        return
    while (source.tagName != highlightbehavior && source.tagName != "HTML")
        source = ns6 ? source.parentNode : source.parentElement
    if (source.style.backgroundColor != highlightcolor && source.id != "ignore")
        source.style.backgroundColor = highlightcolor
}

function contains_ns6(master, slave) { //check if slave is contained by master
    while (slave.parentNode)
        if ((slave = slave.parentNode) == master)
            return true;
    return false;
}

function changeback(e, originalcolor) {
    if (ie && (event.fromElement.contains(event.toElement) || source.contains(event.toElement) || source.id == "ignore") || source.tagName == "TABLE")
        return
    else if (ns6 && (contains_ns6(source, e.relatedTarget) || source.id == "ignore"))
        return
    if (ie && event.toElement != source || ns6 && e.relatedTarget != source)
        source.style.backgroundColor = originalcolor
}


var feature1Text = "<br>Monitor your vehicles and assets in real-time. Obtain information on your vehicle such as its location, engine status, speed and direction.";
var feature2Text = "<br>Seewhere your cars have been using webtraQ’s history feature simply by selecting a time range. You can even replay the trip on the map!";
var feature3Text = "<br>webtraQ supports Google Maps, MS Bing Map and OpenStreetMaps.<br><br>Use the map of your choice.";
var feature4Text = "<br>View the location of multiple trackers simultaneously on the same screen. <br><br>Ideal feature for logistics and fleet management.";
var feature5Text = "<br>Grant or deny functions or features to certain selected users.<br><br>webtraQ allows you to manage your client’s access level and privileges.";
var feature6Text = "<br>Select the language of your choice. We can integrate new languages at your request.";
var feature7Text = "<br>Our interface was specifically designed for ease of use.<br><br>WebtraQ is simple yet professional.";
var feature8Text = "<br>WebtraQ can send alerts regarding your trackers’ activities by email and SMS.<br><br> For example, webtraQ can alert you every time your tracker enters a pre-determined zone.";
var feature9Text = "<br>Be notified when your tracker enters or exits a defined geofence area.";
var feature10Text = "<br>Stay aware of your driver’s behavior on the road. Be notified when one of your vehicules vehicle goes over your pre-set speed limit.";
var feature11Text = "<br>Be notified when the alert button on a tracker has been activated.";
var feature12Text = "<br>Need a specific type of alert?<br><br>We can customize alerts to suit your needs.";
var feature13Text = "<br>Place landmarks on maps for ease of reference. You can use landmarks to locate the nearest vehicles.";
var feature14Text = "<br>Generate an optional public viewing link to share your tracking with family, friends or clients.";
var feature15Text = "<br>Need to send a specific command to your trackers? <br><br>webtraQ allows you to send personalized commands directly from the user interface!";
var feature16Text = "<br>WebtraQ offers various types of reports on your tracker’s activities. <br><br>For example, the trip report provides information on driving distance, engine hours, average speed, etc...";
var feature17Text = "<br>Export tracking data onto a spreadsheet like Excel for your own record keeping.";
var feature18Text = "<br>Need to manage hundreds of trackers? <br><br>No problem! WebtraQ is designed to manage a large number of tackers with speed!<br><br><a href=contact.html> Try it and see the difference.</a>";
var feature19Text = "<br>Want to provide your own tracking service to your clients?<br><br>You can have webtraQ installed on your own server. We will remotely install it for you at no extra cost. <br><br><a href=contact.html> Contact us for the technical requirements.</a>";
var feature20Text = "<br>If you don’t want to manage a server, we can host WebtraQ on our servers and create a personalized login page for your company.<br><br><a href=contact.html> Contact us for more details.</a>";
var feature21Text = "<br>Need to integrate your own hardware? <br><br>Webtraq can be customized to support trackers from different manufacturers. <br><br><a href=contact.html> Contact us for more details.</a>";
var feature22Text = "<br>webtraQ is a high performance software with an affordable price. Our customer support is also top notch! <a href=contact.html> Contact us today!</a> ";
var feature23Text = "<br>WebTraq allows you to locate nearest trackers from a landmark. Ideal feature for dispatching!";
var feature24Text = "<br>Click Street View to see a 3D panoramic view from your vehicle’s perspective. (Only available in certain areas)";


function ShowFeature(feature, featureText, title) {
    if (jQuery("#loadingBlock")[0] != null) { jQuery("#loadingBlock")[0].style.display = ''; }

    if (jQuery('#aFeature')[0] != null) { jQuery('#aFeature')[0].href = '/images/features/' + feature; jQuery('#aFeature')[0].title = title; }
    if (jQuery('#lblFeature')[0] != null) { jQuery('#lblFeature')[0].innerHTML = featureText; }
    if (jQuery('#imgFeature')[0] != null) {
        jQuery('#imgFeature')[0].src = '/images/features/' + feature;
        jQuery('#imgFeature').load(function () { jQuery("#loadingBlock")[0].style.display = 'none'; });

    }

}


function loadPage(page, target) {
    jQuery.ajax({ url: '' + page,
        success: function (resp) {
            if (resp != '') {
                jQuery("#Content")[0].innerHTML = resp;
                if (target != null) { document.getElementById(target).scrollIntoView(); }
                if (jQuery("#loadingBlock")[0] != null) { jQuery("#loadingBlock")[0].style.display = 'none'; } 
            }
        }
    });
}


function WebContact() {
    if (jQuery("#loadingBlock")[0] != null) { jQuery("#loadingBlock")[0].style.display = ''; }
    var name = jQuery("#tbName")[0].value;
    var company = jQuery("#tbCompany")[0].value;
    var location = jQuery("#tbLocation")[0].value;
    var how = jQuery("#tbHow")[0].value;
    var email = jQuery("#tbEmail")[0].value;
    var selection = "";
    if (jQuery("#cbTR203")[0].checked) { selection += "TR-203,"; }
    if (jQuery("#cbTR206")[0].checked) { selection += "TR-206,"; }
    if (jQuery("#cbTR151")[0].checked) { selection += "TR-151,"; }
    if (jQuery("#cbTR600")[0].checked) { selection += "TR-600,"; }
    if (jQuery("#cbGEO5")[0].checked) { selection += "GEO-5,"; }
    if (jQuery("#cbWebtraq1")[0].checked) { selection += "WebtraQ Server License,"; }
    if (jQuery("#cbWebtraq2")[0].checked) { selection += "WebtraQ Hosting,"; }
    if (jQuery("#cbCustomization")[0].checked) { selection += "Customization,"; }
    if (jQuery("#cbOther")[0].checked) { selection += "Other,"; }
    var usefor = "";
    if (jQuery("#cbForPersonal")[0].checked) { usefor += "For personal use,"; }
    if (jQuery("#cbForCompany")[0].checked) { usefor += " To use in my company,"; }
    if (jQuery("#cbForResale")[0].checked) { usefor += " For resale"; }

    var comment = jQuery("#tbComment")[0].value;

    jQuery.ajax({ url: 'ContactHandler.aspx?name=' + encodeURIComponent(name) + "&company=" + encodeURIComponent(company) + "&location=" + encodeURIComponent(location)
  + "&how=" + escape(how) + "&email=" + encodeURIComponent(email) + "&selection=" + escape(selection) + "&comment=" + encodeURIComponent(comment) + "&usefor=" + escape(usefor),
        cache: false,
        success: function (resp) {
            if (resp != '') {
                jQuery("#lblMsg")[0].innerHTML = "<font color=red> " + resp + "</font>";
                if (jQuery("#loadingBlock")[0] != null) { jQuery("#loadingBlock")[0].style.display = 'none'; }
            }
            else {
                jQuery("#lblMsg")[0].innerHTML = "<font color=blue>Thank you! Our sales team will contact you shortly.</font>";
                if (jQuery("#loadingBlock")[0] != null) { jQuery("#loadingBlock")[0].style.display = 'none'; }
                alert("Thank you! Our sales team will contact you shortly.");
            }
        }
    });
}

function ChangeLanguage() {
    var sel = jQuery("#ddlang")[0].selectedIndex;
    if (sel == 0) { window.location = "/index.html"; }
    if (sel == 1) { window.location = "/lang/es/index.html"; }
    if (sel == 2) { window.location = "/lang/fr/index.html"; }
    if (sel == 3) { window.location = "/lang/ch/index.html"; }
}

jQuery(document).ready(function () {

    if (jQuery("#loadingBlock")[0] != null) { jQuery("#loadingBlock")[0].style.display = 'none'; }
});
 
 
