﻿// Load jQuery from Google
google.load("jquery", "1.3.2");
google.load("jqueryui", "1.8.10");

google.setOnLoadCallback(function () {

    $('#slider').codaSlider({
        crossLinking: false,
        dynamicArrows: false
    });

    $('#slider-noback').codaSlider({
        crossLinking: false,
        dynamicArrows: false
    });

    $(".hover-image").mouseover(function () {
        $(this).find(".image-caption").show("slide", { direction: "up" }, 1000);
    });

    $(".hover-image").mouseout(function () {
        $(this).find(".image-caption").hide("slide", { direction: "down" }, 1000);
    });

    $(document).ready(function () {
        $('.boxgrid.caption').hover(function () {
            $(".cover", this).stop().animate({ top: '-60px' }, { queue: false, duration: 160 });
        }, function () {
            $(".cover", this).stop().animate({ top: '0px' }, { queue: false, duration: 160 });
        });
    });

    $('#username').watermark('Username', { className: 'watermark' });
    $('#password').watermark('Password', { className: 'watermark' });
    $('#search').watermark('Search...', { className: 'watermark' });

    $("#btnSearch").click(function () {
        window.top.location = "http://www.google.com/search?q=" + $("#search").val() + "+site%3Acomsechq.com";
    });

    tb_init('a.thickbox'); // called in onload()

    $("#btnWatchdogSignUp").click(function () {
        tb_show("", "/home/signupwatchdog?width=750&height=310");
    });

    $("#btnProscreenSignUp").click(function () {
        tb_show("", "/home/signupproscreen?width=750&height=310");
    });

    $('#contact-us').click(function () {
        tb_show("", "/home/contact?width=750&height=500");
    });

    $('#form-sales-lead-dialog').dialog({
        autoOpen: false,
        height: 580,
        width: 600,
        modal: true,
        closeOnEscape: true,
        dialogClass: 'dialog-no-scroll',
        draggable: false,
        resizable: false,
        title: 'Request Information'
    });

    //get the sales lead view 
    $('.btnRegisterInterest').click(function () {

        document.domain = 'comsechq.com';

        $("#form-sales-lead-dialog").html('<iframe id="modalIframeId" width="100%" height="100%" marginWidth="0" marginHeight="0" frameBorder="0" scrolling="auto" />').dialog("open");

        $("#modalIframeId").attr("src", "http://watchdog.comsechq.com/home/new-sales-lead");


        return false;
    });

});


function closeIframe() {
    $('#form-sales-lead-dialog').dialog('close');
    return false;
}



