﻿var scrollLockHeight = 0;
var scrollHeight = 0;
var isIE6 = navigator.userAgent.toLowerCase().indexOf('msie 6') != -1;
$(document).ready(function () {
    if ($(".scrollLockTarget")[0]) {
        offset = $(".scrollLockTarget").offset();
        scrollHeight = $(".scrollLockTarget").height();
        scrollLockHeight = offset.top;
        window.onscroll = function () {
            if ($(document).scrollTop() > scrollLockHeight) {
                if (isIE6 == false) {
                    $(".scrollLockTarget").css({ 'position': 'fixed', 'top': '10px' })
                }
                else {
                    $(".scrollLockTarget").css({ 'position': 'absolute', 'top': $(document).scrollTop() + 10 })
                }
            }
            else {
                $(".scrollLockTarget").css({ 'position': '', 'top': '0px' })
            }
        }
    }
});

function ValidateParentCat(source, arguments) {
    parentcat = $(source).siblings(".ddlParentCategory").val();
    if (parentcat != "") {
        arguments.IsValid = true;
    } else {
        arguments.IsValid = false;
        return; 
    }
}
function ValidateSubCat(source, arguments) {
    subcat = $(source).siblings(".ddlSubCategory").val();
    if (subcat != "") {
        arguments.IsValid = true;
    } else {
        arguments.IsValid = false;
        return;
    }
}

