var userLoginScript = 'user_v4';
var req_url = '';
var lsmouse = false;
$(document).ready(function(){
// Login / Signup / Forgot Password Ajax
var options = {
target: '#register_response',
beforeSubmit: function(formData, jqForm, options) {
if(Spry) { // Checks if spry is used
var r = Spry.Widget.Form.validate(jqForm[0]);
if(!r)
return r;
}
},
success: response
};
$('.registerForm').submit(function() {
$(this).ajaxSubmit(options);
return false;
});
// Req URL from product page interaction from button
$(".requestAccess").click(function(){
req_url = $(this).attr("href");
document.getElementById("thvLogin").action = "../scripts/"+userLoginScript+".php?go=login&req_url="+req_url;
document.getElementById("thvSignup").action = "../scripts/"+userLoginScript+".php?go=signup&req_url="+req_url;
$("#register_portable").dialog('open');
return false;
});
// GSA form dialog trigger
$(".requestGSA").click(function(){
$("#contact_gsa").dialog('open');
return false;
});
// GSA Form
$("#contact_gsa").dialog({
modal: true, autoOpen: false, show: "blind", hide: "blind", stack: true,
title: "Request GSA (GS-07F-0337V) Pricing", width: 550,
resizable: false, draggable: true,
open: function(event, ui) {
$("#tls").hide();
document.getElementById('gsaPanelLoader').innerHTML = '
Loading...
';
$("#gsaPanelLoader").load('http://www.thermalvideo.com/pg/incl/contact-gsa_v1.0.php?p=');
},
close: function(event, ui) {
$("#tls").show();
}
});
// Home page news panel adjustment
$('#regFormTab_login').click(function() {
$('#homeNews').animate({
height: 725
}, 0);
});
$('#regFormTab_signup').click(function() {
$('#homeNews').animate({
height: 480
}, 0);
});
$('#regFormTab_support').click(function() {
$('#homeNews').animate({
height: 800
}, 0);
});
// Live Search
function searchBorder(mode) {
if(mode == "on") {
$('.livesearchbox').css("border","1px solid #333");
} else {
$('.livesearchbox').css("border","1px solid #000");
}
}
var options_ls = {
target: '#livesearch',
success: ls_response
};
$('#sitesearch').submit(function() {
searchBorder("on");
$(this).ajaxSubmit(options_ls); return false;
});
$('#search').keyup(function(e) {
searchBorder("on");
$('#sitesearch').ajaxSubmit(options_ls); return false;
});
$('#search').focus(function() {
searchBorder("on");
$('#sitesearch').ajaxSubmit(options_ls); return false;
});
$('#livesearch').mouseover(function() {
searchBorder("on");
lsmouse = true;
});
$('#livesearch').mouseout(function() {
lsmouse = false;
});
$('#search').blur(function() {
if(lsmouse == false) {
searchBorder("off");
$("#livesearch").hide();
}
});
$('#searchButton').click(function() {
ls_jump();
searchBorder("on");
});
// Send to a Colleague form dialog trigger
$(".openShareModal").click(function(){
$("#contact_stc").dialog('open');
return false;
});
// Send to a Colleague Form
$("#contact_stc").dialog({
modal: true, autoOpen: false, show: "blind", hide: "blind", stack: true,
title: "Send to a Colleague", width: 550,
resizable: false, draggable: true,
open: function(event, ui) {
$("#tls").hide();
document.getElementById('stcPanelLoader').innerHTML = 'Loading...
';
$("#stcPanelLoader").load('http://www.thermalvideo.com/pg/incl/contact-stc_v1.0.php?p=');
},
close: function(event, ui) {
$("#tls").show();
}
});
});
// Login / Signup / Forgot Password Interactivity
function response(responseText, statusText) {
$("#register_response").hide();
$("#register_response").fadeIn(500);
$("#register_panel").hide();
}
function retrievemypwd() {
register_TabbedPanels1.showPanel(2);
$("#register_response").hide();
$("#register_panel").fadeIn(500);
}
// Live Search
function ls_response(responseText, statusText) {
$("#livesearch").hide();
$("#livesearch").show();
}
function ls_jump() {
// document.location.href = "home-html.php?pg=search&search=" + document.getElementById('search').value;
}
$("#search").keypress(function (e) { if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { ls_jump(); } });