window.remoteURL = '/remote/?action=';
window.subURL = window.remoteURL;
$(function () {
    initFunctions();

    try {
        //setupPopDiv();
    } catch (e) {
    }
    $('body').bind('click', function () {
        hidemenu()
    });

});

function showmenu(thismenu,x) {
	hidemenu();
	actualposition = x;
	document.getElementById(thismenu).style.visibility = "visible";
	document.getElementById(thismenu).style.left = actualposition;
}

function showmenu(menuid,x) {
	hidemenu();
	
	x = x - 477;
	thismenu = document.getElementById(menuid);
	if (thismenu) {
		thismenu.style.visibility = 'visible';
		thismenu.style.left = x+'px';
	}
	window.menux = x;
}

function showLoader() {
    $.fancybox.showActivity();
}

function hideLoader() {
    $.fancybox.hideActivity();
}

function initFunctions() {
    window.openProductCategory = function (fID) {
        showLoader();
        $('#category-products-view').fadeOut(100);
        $.get(window.subURL + 'loadProductCategory&linkid=' + fID, function (data) {
            $('#category-products-view').html(data);
            $('#category-products-view').fadeIn(300);
            $.fancybox.close();
            hideLoader();
        });
    }
}

function disableLoader() {
    hideLoader();
}
