
$(document).ready(function () {
    var select_sort=$("#selectPrductSort option:selected").html();
    $('.button_sort').html(select_sort);
  $('#categoriestopmenu ul.parent').superfish();
  var height_r=screen.height;
  var width_r=screen.width;
  var left_r=width_r/4;
  var top_r =height_r/8;
  var height_b=height_r/2;
  var width_b=width_r/2;
  var h=$(document).height();
  $('.print').click(function(){
        $('.ligh_box_popup').css({'top': top_r+'px','left': left_r+'px','height':height_b+'px','width':width_b+'px'});
        $('.ligh_box_popup').show();
        $('.bg_box_lign').css('height',h+'px');
        $('.bg_box_lign').show();
  });
  $('.bg_box_lign').click(function(){
        $('.ligh_box_popup').hide();
        $('.bg_box_lign').hide();
  });
  $('.close_box').click(function(){
        $('.ligh_box_popup').hide();
        $('.bg_box_lign').hide();
  }); 
});
//animate the opening of the branch (span.grower jQueryElement)
/*function openBranch(jQueryElement, noAnimation) {
		jQueryElement.addClass('CLOSE').removeClass('OPEN');
        jQueryElement.parent().find('ul:first').parent().addClass('long');
        jQueryElement.parent().find('ul:first').parent().addClass('OPEN').removeClass('CLOSE');
		if(noAnimation)
			jQueryElement.parent().find('ul:first').show();
		else
			jQueryElement.parent().find('ul:first').slideDown();
}
//animate the closing of the branch (span.grower jQueryElement)
function closeBranch(jQueryElement, noAnimation) {
	jQueryElement.addClass('OPEN').removeClass('CLOSE');
	if(noAnimation)
		jQueryElement.parent().find('ul:first').hide();
	else
		jQueryElement.parent().find('ul:first').slideUp();
}

//animate the closing or opening of the branch (ul jQueryElement)

function toggleBranch(jQueryElement, noAnimation) {
    if(jQueryElement.hasClass('CLOSE'))
		closeBranch(jQueryElement, noAnimation);
	else
		openBranch(jQueryElement, noAnimation);
}
function hover_over(id_cate,level){
    if($('#name_'+id_cate).children().is('ul')){
        if(level==1){
            $('#cate_'+id_cate).css({'top':'36px','left':'1px','position':'absolute'});
            $('#cate_'+id_cate).show();
        }
        else {
            $('#cate_'+id_cate).css({'top':'0px','left':'200px','position':'absolute'});
            $('#cate_'+id_cate).show();
        }
    }
}
function hover_out(id_category){
    $('#cate_'+id_category).hide();
}
function load_sub(id){
        if($('#cate_'+id).hasClass('CLOSE') && $('#cate_'+id).children().is('ul')){
            $('#cate_'+id).find('ul').css('display','block');
            $('#cate_'+id).find('ul').children().find('ul').css('display','none');
            $('#cate_'+id).addClass('OPEN').removeClass('CLOSE');
            $('#cate_'+id+' li').each(function(){
                if($(this).hasClass('OPEN')){
                    $(this).addClass('CLOSE').removeClass('OPEN');
                }
                if($(this).children().is('span') && $(this).children().is('ul')){
                    $(this).find('span:first').addClass('OPEN_1').removeClass('CLOSE_1');
                }
            });
            $('#cate_'+id).css('border','0px');
            $('#open_sub_'+id).addClass('CLOSE_1').removeClass('OPEN_1');
        }
        else  if($('#cate_'+id).hasClass('OPEN') && $('#cate_'+id).children().is('ul')){
            $('#cate_'+id).find('ul').css('display','none');
            $('#cate_'+id).addClass('CLOSE').removeClass('OPEN');
            $('#open_sub_'+id).addClass('OPEN_1').removeClass('CLOSE_1');
            $('#cate_'+id).css('border-bottom','1px solid #cccccc');
        }
    }
		// initialise plugins

*/
