﻿$(document).ready
(
    function() {
        $("img[@src$=png], .bluetextleft, .menu_cont_bottom_left, .searchtextleft , .poll_tooltip_placeholder").pngfix
        (
            {
                sizingMethod: "scale"
            }
        );
    }
);
    $(".AppPoint_Technologies").ready
(
    function() {
        /*worldwide menu section*/
        /*table row color chenge*/
        $(".worldwide_menu table tr").hover
        (
            function() {
                $('td', this)
                    .css({ backgroundColor: '#d9d9d9', cursor: 'pointer' })
            },
            function() {
                $('td', this)
                    .css({ backgroundColor: '#ffffff', cursor: 'pointer' })
            }
        );
        /*table row color chenge*/
        /*menu show/hide*/
        $(".Worldwidelink")
            .hoverIntent
                (
                    {
                        sensitivity: 100,
                        interval: 500,
                        out: WorldwidelinkOff,
                        over: WorldwidelinkOn,
                        timeout: 500

                    }
                );
                
                $(".Worldwidelinks")
            .hoverIntent
                (
                    {
                        sensitivity: 100,
                        interval: 500,
                        out: WorldwidelinksOff,
                        over: WorldwidelinksOn,
                        timeout: 500

                    }
                );
        /*menu show/hide*/
        /*worldwide menu section*/
        /*search section*/
        /*define search variable*/
        var gray_Left_placeholder_width_left_chenger = $('.gray_Left_placeholder');
        var height = gray_Left_placeholder_width_left_chenger.height();
        var width = gray_Left_placeholder_width_left_chenger.width();
        gray_Left_placeholder_width_left_chenger.css({ width: "113px" });
        gray_Left_placeholder_width_left_chenger.css({ left: "156px" }); //270px
        $(".gray_area").css({ width: "109px" });
        /*define search variable*/
        /*gogo buttion palce in diff browsers*/
        jQuery.each
        (
            jQuery.browser, function(i) {
                if ($.browser.msie) {
                    $(".gogo").css({ marginTop: "21px", marginLeft: "122px" })
                }
                else if ($.browser.mozilla) {
                    $(".gogo").css({ marginTop: "21px", marginLeft: "122px" })
                }
                else if ($.browser.safari) {
                    $(".gogo").css({ marginTop: "21px", marginLeft: "122px" })
                }
                else if ($.browser.chrome) {
                    $(".gogo").css({ marginTop: "21px", marginLeft: "122px" })
                }
                else if ($.browser.opera) {
                    $(".gogo").css({ marginTop: "16px", marginLeft: "122px" })
                }
            }
        );
        /*gogo buttion palce in diff browsers*/
        /*search buttion click*/
        $("div.gray_Left_placeholder").toggle
        (
            function() {
                $(".searchtextbox")
                    .attr("value", "For ?");
                $(this)
                    .removeClass("gray_Left_placeholder_round")
                    .addClass("gray_Left_placeholder_square")
                    .animate
                    (
                        {
                            width: "270px", left: "0px"
                        },
                        {
                            duration: 500, complete:
                            function() {
                                $(".searchtextbox").fadeIn();
                            }
                        }
                    )
                    .parent().parent().animate
                    (
                        {
                            width: "270px", left: "0px"
                        },
                        {
                            duration: 500, complete:
                            function() {
                                //do somthing
                            }
                        }
                    );

                $(".gray_area", this)
                        .css({ width: "266px" })

                $(".gray_sq_cir", this)
                        .addClass("gray_cir");
            },
            function() {
                $(".graytext")
                    .css({ width: "91px" })
                $(".searchtextbox")
                    .attr("value", " ");
                $(".searchtextbox")
                    .hide();
                $(this)
                    .animate
                    (
                        {
                            width: "113px", left: "0px", height: "30px"
                        },
                        {
                            duration: 500, complete:
                            function() {
                                //do somthing
                            }
                        }
                    )
                    .parent().parent().animate
                    (
                        {
                            width: "113px", left: "0px", height: "30px"
                        },
                        {
                            duration: 500, complete:
                            function() {
                                //do somthing
                            }
                        }
                    );
                $(".gray_area", this)
                    .animate
                    (
                        {
                            width: "109px", left: "0px"
                        },
                        {
                            duration: 500, complete:
                            function() {
                                //do somthing
                            }
                        }
                    );
                $(".gray_sq_cir", this)
                        .addClass("gray_cir");
            }
        );
        /*search buttion click*/
        /*Clear text box value on click*/
        $(".searchtextbox").click
        (
            function() {
                $(this).val('');
            }
        );
        /*Clear text box value on click*/
        /*gogo buttion function*/
        $(".gogo").click
        (
            function() {
                
                if ($(".searchtextbox").val() == "AppPoint Site" || $(".searchtextbox").val() == " " || $(".searchtextbox").val() == "")
                 {
                  
                    $(".searchtextbox")
                        .attr("value", "AppPoint site");
                    $("div.gray_Left_placeholder")
                        .removeClass("gray_Left_placeholder_round")
                        .addClass("gray_Left_placeholder_square")
                        .animate
                        (
                            {
                                width: "270px", left: "0px"
                            },
                            {
                                duration: 500, complete:
                                function() {
                                
                                    $(".searchtextbox").fadeIn();
                                }
                            }
                        )
                        .parent().parent().animate
                        (
                            {
                                width: "270px", left: "0px"
                            },
                            {
                                duration: 500, complete:
                                function() {
                                    $('#search_form').submit();
                                }
                            }
                        );

                    $("div.gray_area")
                            .css({ width: "266px" })

                    $("div.gray_sq_cir")
                            .addClass("gray_cir");
                    return false;
                }
                else {
                var tbVal = $(".searchtextbox").val();
//                    alert("searching for " + tbVal);
                    window.open( 'http://www.google.com/search?q='+tbVal+'+site%3Awww.apppoint.com' );
                    //$("#search_form").attr("action", $(".searchtextbox").val());
                    //return true;
                    return false;                    
                }
            }
        );
        /*gogo buttion function*/
        /*search section*/
        /*menu section*/
        /*menu/search roiund corners*/
        /*DD_roundies.addRule('.menu_place', '5px 0 0 5px', true);
        DD_roundies.addRule('.menu_place_blue', '5px 0 0 5px', true);
        DD_roundies.addRule('.menu_place_gray', '0 0 0 5px', true);
        DD_roundies.addRule('.gray_sq_cir', '5px 0 0 5px', true);
        DD_roundies.addRule('.gray_cir', '5px 0 0 5px', true);*/
        /*menu roiund corners*/
        /*menu mouseover/out action*/
        $("div.menu_place")
            .hoverIntent
                (
                    {
                        sensitivity: 100,
                        interval: 550,
                        out: mouseOff,
                        over: mouseOn,
                        timeout: 100
                    }
                );
        /*menu mouseover/out action*/
        /*z-Index chenge in menu_left mouse over*/
        $("table.ri_trends_pad_menu")
            .hoverIntent
                (
                    {
                        sensitivity: 100,
                        interval: 0,
                        out: menu_left_expan,
                        over: menu_left_squiz,
                        timeout: 100
                    }
                );

        /*z-Index chenge in menu_left mouse over*/
        /*worldwide menu*/
        /*fade effect for menu,search buttion*/
        $(".menu_left top").fadeIn(1000);
        $(".search_place").fadeIn(1000);
        $(".menu_place").fadeIn(1000);
        $(".gogo").fadeIn(1000);
        /*fade effect for menu,search buttion*/

        $(".resourse_link_header")
            .click
            (
                function() {
                    var resourse_link_header_id = $(this).attr("id");
                    $("." + resourse_link_header_id)
                        .fadeIn();
                }
            );
        $(".popup_close")
            .click
            (
                function() {
                    $(".popup_corner")
                        .fadeOut();
                }
            );
    }
);
/*World wide menu */
function WorldwidelinkOn() {
    $("#corporateoffice").stop().slideDown("slow");
}
function WorldwidelinkOff() {
    $("#corporateoffice").stop().slideUp("slow");
}

function WorldwidelinksOn() {
    $("#careers").stop().slideDown("slow");
}
function WorldwidelinksOff() {
    $("#careers").stop().slideUp("slow");
}
/*World wide menu */
/*menu mouse over*/
function mouseOn() {
    $(this)
        .animate
        (
            {
                width: "270px",
                left: "0px",
                height: parseInt($(".menu_place_gray", this).height()) + 32
            },
            {
                duration: '700',
                easing: 'easeInOutQuad',
                complete:
                    function() {
                        //do somthing
                    }
            }
        );
    $(".menu_place_gray", this)
        .animate
        (
            {
                height: $(".menu_place_gray", this).outerHeight()
            },
            {
                duration: '700',
                easing: 'easeInOutQuad',
                complete:
                    function() {
                        $("table", this)
                            .fadeIn(1000);
                    }
            }
        );
    $(".menu_place_blue_malfun", this)
        .css
        (
            {
                visibility: "visible"
            }
        );
}
/*menu mouse over*/
/*menu mouse out*/
function mouseOff() {
    $(".menu_place_blue_malfun")
        .css
        (
            {
                visibility: "hidden"
            }
        );
    $("table", this)
        .fadeOut
        (
            500,
            function() {
                $(this).parent().parent()
                    .animate
                    (
                        {
                            width: "113px",
                            left: "0px",
                            height: "30px"
                        },
                        {
                            duration: '700',
                            easing: 'easeInOutQuad',
                            complete:
                                function() {

                                }
                        }
                    );
            }
        );
}
/*menu mouse out*/
/*search mouse on*/
function searchOn() {
    $(this)
        .removeClass("gray_Left_placeholder_round")
        .addClass("gray_Left_placeholder_square")
        .animate
        (
            {
                width: "270px",
                left: "0px"
            },
            {
                duration: 600,
                easing: 'easeInOutQuad',
                complete:
                function() {
                    $(".searchtextbox")
                        .attr("value", "a");

                }
            }
        )
        .parent().parent().animate
        (
            {
                width: "270px",
                left: "0px"
            },
            {
                duration: 600,
                easing: 'easeInOutQuad',
                complete:
                function() {
                    //do somthing
                }
            }
        );

    $(".gray_area", this)
            .css
                (
                    {
                        width: "266px"
                    }
                )

    $(".gray_sq_cir", this)
            .css
                (
                    {
                        backgroundImage: "url(http://67.218.96.186/images/menu/gray_round.gif)"
                    }
                )
}
/*search mouse on*/
/*search mouse off*/
function searchOff() {
    $(".searchtextbox").fadeOut("fast");
    $(this)
        .animate
        (
            {
                width: "113px",
                left: "0px",
                height: "30px"
            },
            {
                duration: 500,
                easing: 'easeInOutQuad',
                complete:
                function() {
                    //do somthing
                }
            }
        )
        .parent().parent().animate
        (
            {
                width: "113px",
                left: "0px",
                height: "30px"
            },
            {
                duration: 500,
                easing: 'easeInOutQuad',
                complete:
                function() {
                    //do somthing
                }
            }
        );
    $(".gray_area", this)
        .animate
        (
            {
                width: "109px",
                left: "0px"
            },
            {
                duration: 500,
                easing: 'easeInOutQuad',
                complete:
                function() {
                    //do somthing
                }
            }
        );
    $(".gray_sq_cir", this)
        .css
            (
                {
                    backgroundImage: "url(http://67.218.96.186/images/menu/gray_round.gif)"
                }
            );
}
/*search mouse off*/
/*left menu did width increase decrease*/
function menu_left_squiz() {
    if ($(".gray_area").outerWidth() == 266) {

        /*close search*/
        $(".graytext")
            .css({ width: "91px" })
        $(".searchtextbox")
            .attr("value", " ");
        $(".searchtextbox")
            .hide();
        $("div.gray_Left_placeholder")
            .animate
            (
                {
                    width: "113px", left: "0px", height: "30px"
                },
                {
                    duration: 500, complete:
                    function() {
                        //do somthing
                    }
                }
            )
            .parent().parent().animate
            (
                {
                    width: "113px", left: "0px", height: "30px"
                },
                {
                    duration: 500, complete:
                    function() {
                        //do somthing
                    }
                }
            );
        $(".gray_area", "div.gray_Left_placeholder")
            .animate
            (
                {
                    width: "109px", left: "0px"
                },
                {
                    duration: 500, complete:
                    function() {
                        //do somthing
                    }
                }
            );
        $(".gray_sq_cir", "div.gray_Left_placeholder")
            .addClass("gray_cir");
        /*close search*/
        t = setTimeout('$(".gray_Left_placeholder").css({ left: "-1px" });//270px $(".search_place") .css ( { width       : "113px" } );$(".menu_left") .css ( { marginLeft : "862px", width : "140px" } );', 1500);
    }
    //checking sudden shock of menu (if u add menus add id here also)
    else if ($(".Resource_Center table").css("display") == "none" && $(".Industries table").css("display") == "none" && $(".Services table").css("display") == "none" && $(".Services table").css("display") == "none" && $(".Contact_Us table").css("display") == "none") {
        //alert("a");
        $(".gray_Left_placeholder")
            .css
            (
                {
                    left: "-1px"
                }
            );
        $(".search_place")
            .css
            (
                {
                    width: "113px"
                }
            );
        $(".menu_left")
            .css
            (
                {
                    marginLeft: "862px",
                    width: "140px"
                }
            );
    }
    //no option left go for this
    else {
        $(".menu_hiddenValue").html("1");
        t = setTimeout(' $(".gray_Left_placeholder").css({ left: "-1px" }); $(".search_place") .css ( { width : "113px" } ); $(".menu_left") .css ( { marginLeft : "862px", width : "140px" } );', 1500);
    }
}
function menu_left_expan() {
    $(".menu_hiddenValue").html("4");
    $('.gray_Left_placeholder').css({ left: "156px" }); //270px
    $(".search_place")
        .css
        (
            {
                width: "270px"
            }
        );
    $(".menu_left")
        .css
        (
            {
                marginLeft: "732px",
                width: "270px"
            }
        );
}
$(".menu_left")
    .mouseover
    (
        function() {
            $(".menu_hiddenValue").html("5");
            if ($(this).outerWidth() < 270) {
                $(".menu_hiddenValue").html("6");
                $('.gray_Left_placeholder').css({ left: "156px" }); //270px
                $(".search_place")
                    .css
                    (
                        {
                            width: "270px"
                        }
                    );
                $(".menu_left")
                    .css
                    (
                        {
                            marginLeft: "732px",
                            width: "270px"
                        }
                    );
            }
            else {
                //  
            }
        }
    );
$(".menu_left")
    .mouseout
    (
        function() {
            $(".menu_hiddenValue").html("1");
            t = setTimeout(' $(".gray_Left_placeholder").css({ left: "-1px" }); $(".search_place") .css ( { width     : "113px" } ); $(".menu_left") .css ( { marginLeft  : "862px", width        : "140px" } );', 0);
        }
    );
/*left menu did width increase decrease*/
$(document).ready
(
    function() {
        $(".ser_bts_txt1 a img")
            .hoverIntent
                (
                    {
                        sensitivity: 100,
                        interval: 100,
                        out: ser_bts_txt1_out,
                        over: ser_bts_txt1_hover,
                        timeout: 100
                    }
                );
    }
);
function ser_bts_txt1_hover() {
    var img_id = $(this).attr("id");
    $(this)
        .attr("src", "~/BSImages/mouseover_product/" + img_id + "_over.gif");
    $(".high_1_txt_contain div")
        .hide();
    $(".basetxt")
        .hide();

    $("." + img_id)
        .fadeIn();
}
function ser_bts_txt1_out() {
    var img_id = $(this).attr("id");
    $(this)
        .attr("src", "~/BSImages/mouseover_product/" + img_id + "_norm.gif");
    $(".high_1_txt_contain div")
        .hide();
    $(".basetxt")
        .fadeIn();
}
