if (ieversion > 0) {
    $(function() {
        var zIndexNumber = 1000;
        $('div').each(function() {
            if ($(this).attr("id").indexOf("tipsholder") > -1) {
            } else {
                if ($(this).attr("id").indexOf("addingCategoryie6overlay") > -1) {
                } else {
                  if ($(this).attr("id").indexOf("SignUpForm") > -1) {
                    
                  } else {
                    if ($(this).attr("id").indexOf("pnlRegisterForm") > -1) {
                    } else {
                      if ($(this).attr("id").indexOf("LoginForm") > -1) {
                      } else {
                        if ($(this).attr("id").indexOf("loginPanel") > -1) {
                        } else {
                          if ($(this).attr("class").indexOf("loginPanelItem") > -1) {
                          } else {
                            if ($(this).attr("class").indexOf("loginPanelControl") > -1) {
                            } else {
                              $(this).css('zIndex', zIndexNumber);
                              zIndexNumber -= 10;
                            }
                          }
                        }
                      }
                    }
                  }
                }
            }
        });
    });
} 

$(document).ready(function () {
   $('#tipsholder').hide();
    $('#tipsholder').animate({ opacity: 0 });

    $('#SendToFriendProduct').hide();
    $('#SendToFriendProduct').animate({ opacity: 0 });

   
    $('#SignUpForm').hide();
    $('#SignUpForm').animate({ opacity: 0 });
    $('#LoginForm').hide();
    $('#LoginForm').animate({ opacity: 0 });
    $('#NotApprovedAlert').animate({ opacity: 0 });
    $('#NotApprovedAlert').hide();
    //$("#A1").colorbox({ width: "710px", height: "335px", inline: true, href: "#LoginForm", scrolling: false });
    //$("#A2").colorbox({ width: "600px", height: "560px", inline: true, href: "#SignUpForm", scrolling: false });
    $("#A2").click(function (event) {

        event.stopPropagation();
        $('#SignUpForm').c2kcenter();
        $('#SignUpForm').show();
        $('#SignUpForm').animate({ opacity: 1 });
        $('#mosquitoOverlayBg').show();
    });

    //$(".myCollectionLogIntoCollection").colorbox({ width: "710px", height: "335px", inline: true, href: "#LoginForm", scrolling: false });
    $("#A1").click(function (event) {
        event.stopPropagation();
        $('#LoginForm').c2kcenter();
        $('#LoginForm').show();
        $('#LoginForm').animate({ opacity: 1 });
        $('#mosquitoOverlayBg').show();
    });
    if (window.location.search.substring(1) == "notAMember=1" || window.location.search.substring(1) == "notApproved=1") {

        $("#A1").click();
    }


    if (window.location.search.substring(1).toString().indexOf("userExsistsOrError=1") != -1) {
        $("#A2").click();
    }
    if (window.location.search.substring(1) == "CheckInbox=1") {
        $("#A2").click();
    }
    if (window.location.search.substring(1).indexOf("hasSearchTerm=") != -1) {
        $("#mycollectionRightSideBar h2").replaceWith('<br /><h2 align="center">Search Results</h2>');
        $("#RequestedMemberRightPanel h2").replaceWith('<br /><h2 align="center">Search Results</h2>');
        
    }
    
    if (window.location.search.substring(1) == "reIssuedPassword=1") {
        $("#A1").click();
    }
    
    $('#logIntoCollection').click(function (event) {
        event.stopPropagation();
        $('#LoginForm').c2kcenter();
        $('#LoginForm').show();
       
        $('#LoginForm').animate({ opacity: 1 });
       
        $('#mosquitoOverlayBg').show();
        $('#mosquitoOverlayBg').height(2000);
        $('#mosquitoOverlayBg').css('bottom','-600px !important');
        //$('#mosquitoOverlayBg').css('z-index','0');
    });
    $('#tbStartCollection').click(function (event) {
        event.stopPropagation();
        $('#SignUpForm').c2kcenter();
        $('#SignUpForm').show();
        $('#SignUpForm').animate({ opacity: 1 });
        $('#mosquitoOverlayBg').show();

    });
    //$(".sendToFriendColorbox").colorbox({ width: "600px", height: "460px", inline: true, href: "#SendToFriendProduct", scrolling: false });
    $(".sendToFriendColorbox").click(function (event) {
        event.stopPropagation();
        //alert("this");
        // $('#SendToFriendProduct').c2kcenter();
        $('#SendToFriendProduct').show();
        $('#SendToFriendProduct').animate({ opacity: 1 });
        $('#mosquitoOverlayBg').show();

    });
    $('#SendToFriendProduct').click(function (event) {
        event.stopPropagation();
    });

    $('#tbRFbutton').click(function () {
       /* var currentUrl = window.location.pathname;
        if ($('#tbRFEmailAddress').val() == "" && $('#tbRFFriendEmail').val() == "" && $('#tbRFName').val() == "" && $('#tbRFFriendName').val() == "" && $('#tbRFFriendMessage').val() == "") {
            $('#rafValidate').text('Please complete all fields.');
        } else {
        window.location.replace(currentUrl + '?stfEmail=' + $('#tbRFEmailAddress').val() + '&stfFriendEmail=' + $('#tbRFFriendEmail').val() + '&stfName=' + $('#tbRFName').val() + '&stfFriendName=' + $('#tbRFFriendName').val() + '&stfMessage=' + $('#tbRFFriendMessage').val() + '&stfOptedIn=' + $('#chbSTFOptIn').is(':checked') + '&stfvivOptedIn=' + $('#otherOptIn').is(':checked')); */

        var currentUrl = window.location.pathname;
        if ($('#tbRFEmailAddress').val() == "" && $('#tbRFFriendEmail').val() == "" && $('#tbRFName').val() == "" && $('#tbRFFriendName').val() == "" && $('#tbRFFriendMessage').val() == "") {
            $('#rafValidate').text('Please complete all fields.');
        } else {
            window.location.replace(currentUrl + '?stfEmail=' + $('#tbRFEmailAddress').val() + '&stfFriendEmail=' + $('#tbRFFriendEmail').val() + '&stfName=' + $('#tbRFName').val() + '&stfFriendName=' + $('#tbRFFriendName').val() + '&stfMessage=' + $('#tbRFFriendMessage').val() + '&stfOptIn=' + $('#chbSTFOptIn').val());
        
            
            
            
        }
    });
    var addTip;
    // $('.openTipBox').colorbox({ width: "560px", height: "380px", inline: true, href: "#tipsholder", scrolling: false });
    $('.openTipBox').click(function (event) {
        //alert("this");
        event.stopPropagation();
        $('#tipsholder').c2kcenter();
        $('#tipsholder').show();
        $('#tipsholder').animate({ opacity: 1 });
        $('#mosquitoOverlayBg').show();
    });

    $('body').click(function () {
        $(".Collection2000Overlay").animate({ opacity: 0 });
        $(".Collection2000Overlay").hide();
        $('#tipsholder').animate({ opacity: 0 });
        $('#tipsholder').hide();
        $('#SignUpForm').animate({ opacity: 0 });
        $('#SignUpForm').hide();
        $('#LoginForm').animate({ opacity: 0 });
        $('#LoginForm').hide();
        $('#mosquitoOverlayBg').hide();
        $('#SearchResultsBox').hide();
        $('#xsltsearch h2').hide();
        $('#SendToFriendProduct').hide();
    });
    $('mosquitoOverlayBg').click(function () {
        $('#tipsholder').animate({ opacity: 0 });
        $('#tipsholder').hide();
        $('#SignUpForm').animate({ opacity: 0 });
        $('#SignUpForm').hide();
        $('#LoginForm').animate({ opacity: 0 });
        $('#LoginForm').hide();
        $('#mosquitoOverlayBg').hide();
        $(".Collection2000Overlay").animate({ opacity: 0 });
        $(".Collection2000Overlay").hide();

    });
    $('.overlayCloseButton').click(function () {
        $('#tipsholder').animate({ opacity: 0 });
        $('#tipsholder').hide();
        $('#SignUpForm').animate({ opacity: 0 });
        $('#SignUpForm').hide();
        $('#LoginForm').animate({ opacity: 0 });
        $('#LoginForm').hide();
        $('#mosquitoOverlayBg').hide();
        $(".Collection2000Overlay").animate({ opacity: 0 });
        $(".Collection2000Overlay").hide();
    });
    $('.tipboxclose').click(function () {
        $('#tipsholder').hide();
    });

    $('.c2k-reg-close-button').click(function () {

        $('#mosquitoOverlayBg').hide();
        $(".Collection2000Overlay").animate({ opacity: 0 });
        $(".Collection2000Overlay").hide();
    });
    $('.btn-close-add-look').click(function () {

        $('#mosquitoOverlayBg').hide();
        $(".Collection2000Overlay").animate({ opacity: 0 });
        $(".Collection2000Overlay").hide();
    });


    $('#LoginForm').click(function (event) {
        event.stopPropagation();
    });
    $('#SignUpForm').click(function (event) {
        event.stopPropagation();
    });
    $('#tipsholder').click(function (event) {
        event.stopPropagation();
    });
    $("#colorbox").click(function (event) {
        event.stopPropagation();
    });

});

function ShowVideoLook(video) {
    document.getElementById(video).style.display = "inline";
}
