﻿function pageLoad () {
    $("#fontSizeDecrease").bind("click", decreaseFontSize);
    $("#fontSizeIncrease").bind("click", increaseFontSize);
    $(".MenuBarItemSubmenu").bind("mouseenter", showSubMenu);
    $(".MenuBarItemSubmenu").bind("mouseleave", hideSubMenu);
    $(".MenuBarItemSubmenu").parent().children("ul").bind("mouseenter", showSubMenu);
    $(".MenuBarItemSubmenu").parent().children("ul").bind("mouseleave", hideSubMenu);
};

function showSubMenu() {
    $(this).parent().children("ul").css("left", "0em");
    $(this).parent().addClass("MenuBarHorizontalOnHoverItem"); 
}

function hideSubMenu() {
    $(this).parent().children("ul").css("left", "-1000em");
    $(this).parent().removeClass("MenuBarHorizontalOnHoverItem"); 
}

function increaseFontSize() {
    var test;
    try {
    test  =  $("body").css("font-size").split("px");
    $("body").css("font-size", (parseInt(test[0],10)+1)+ "px");
    } catch(Error) {}
    try {
    test = $(".productListName").css("font-size").split("px");
    $(".productListName").css("font-size", (parseInt(test[0],10)+1)+ "px");
    } catch(Error) {}
    try {
    test = $(".rightControlHeader").css("font-size").split("px");
    $(".rightControlHeader").css("font-size", (parseInt(test[0],10)+1)+ "px");
    } catch(Error) {}
    try {
    test = $(".verticalMenuBrandsHeader").css("font-size").split("px");
    $(".verticalMenuBrandsHeader").css("font-size", (parseInt(test[0],10)+1)+ "px");
    } catch(Error) {}
    try {
    test = $(".brandAllProducts").css("font-size").split("px");
    $(".brandAllProducts").css("font-size", (parseInt(test[0],10)+1)+ "px");
    } catch(Error) {}
    try {
    test = $("h1").css("font-size").split("px");
    $("h1").css("font-size", (parseInt(test[0],10)+1)+ "px");
    } catch(Error) {}
    try {
    test = $(".pageServicesSend > a").css("font-size").split("px");
    $(".pageServicesSend > a").css("font-size", (parseInt(test[0],10)+1)+ "px");
    } catch(Error) {}
    try {
    test = $(".pageServicesTopOfPage > a").css("font-size").split("px");
    $(".pageServicesTopOfPage > a").css("font-size", (parseInt(test[0],10)+1)+ "px");
    } catch(Error) {}
    try {
    test = $(".productListPriceNew").css("font-size").split("px");
    $(".productListPriceNew").css("font-size", (parseInt(test[0],10)+1)+ "px");
    } catch(Error) {}
}

function decreaseFontSize() {
    var test ;
    try {
    test =  $("body").css("font-size").split("px");
    $("body").css("font-size", (parseInt(test[0],10)-1)+ "px");
    } catch(Error) {}
    try {
    test = $(".productListName").css("font-size").split("px");
    $(".productListName").css("font-size", (parseInt(test[0],10)-1)+ "px");
    } catch(Error) {}
    try {
    test = $(".rightControlHeader").css("font-size").split("px");
    $(".rightControlHeader").css("font-size", (parseInt(test[0],10)-1)+ "px");
    } catch(Error) {}
    try {
    test = $(".verticalMenuBrandsHeader").css("font-size").split("px");
    $(".verticalMenuBrandsHeader").css("font-size", (parseInt(test[0],10)-1)+ "px");
    } catch(Error) {}
    try {
    test = $(".brandAllProducts").css("font-size").split("px");
    $(".brandAllProducts").css("font-size", (parseInt(test[0],10)-1)+ "px");
    } catch(Error) {}
    try {
    test = $("h1").css("font-size").split("px");
    $("h1").css("font-size", (parseInt(test[0],10)-1)+ "px");
    } catch(Error) {}
    try {
    test = $(".pageServicesSend > a").css("font-size").split("px");
    $(".pageServicesSend > a").css("font-size", (parseInt(test[0],10)-1)+ "px");
    } catch(Error) {}
    try {
    test = $(".pageServicesTopOfPage > a").css("font-size").split("px");
    $(".pageServicesTopOfPage > a").css("font-size", (parseInt(test[0],10)-1)+ "px");
    } catch(Error) {}
    try {
    test = $(".productListPriceNew").css("font-size").split("px");
    $(".productListPriceNew").css("font-size", (parseInt(test[0],10)-1)+ "px");
    } catch(Error) {}
}
