﻿$(document).ready(function () {

$('.ModXModProC, .ModXModProFormViewC, XModProContent').find('p').css({ 'width': '0px', 'height': '0px', 'display': 'none' });
    //$('.test-r').click(function () { alert('o'); });
//jobs corner
 $("#cor_pageflip").hover(function () {
     $("#cor_pageflip img , .cor_msg").stop()
			.animate({
			    width: '305px',
			    height: '317px'
			}, 500);
 }, function () {
     $("#cor_pageflip img").stop()
			.animate({
			    width: '95px',
			    height: '97px'
			}, 720);
     $(".cor_msg").stop()
			.animate({
			    width: '93px',
			    height: '93px'
			}, 700);

});
 // jobs filter
var t = $('.job_entry').length; $('#job-display').find('.jobcounter-stat').text(t);
var a = "all"; $('#job_footer-data .testA').text(a); $('#job_header-filter div').children('span').eq(0).css({ 'background-color': 'red' }); $('#listdept').attr('disabled', '');
$('.job_entry').each(function () { $(this).fadeIn(); });

$('#job_header-filter div').children('span').click(function () {
    var a = $(this).attr('rel'); $('#job_footer-data .testA').text(a);
    $(this).css({ 'background-color': 'red' }).siblings('span').css({ 'background-color': '#9C0' }); ;
    if (a == "all") {
        $('#listdept').attr('disabled', ''); $("#job_header-data .job-depthead").css({ 'color': '#f7f7f7' });
        $('.job_entry').each(function () { $(this).fadeIn(); });
    } else if (a == "st") {
        $("#listdept").attr('disabled', 'disabled'); $("#job_header-data .job-depthead").css({ 'color': '#444' });
        $('.job_entry').each(function () {
            if (!$(this).hasClass(a)) {
                $(this).fadeOut('normal').addClass('hidden');
            } else {
                $(this).fadeIn('slow').removeClass('hidden');
            }
        });
    } else if (a == "hq") {
        $('#listdept').attr('disabled', ''); $("#job_header-data .job-depthead").css({ 'color': '#f7f7f7' });
        $('.job_entry').each(function () {
            if (!$(this).hasClass(a)) {
                $(this).fadeOut('normal').addClass('hidden');
            } else {
                $(this).fadeIn('slow').removeClass('hidden');
            }
        });
    };
    return false;
});

$("#listdept").change(function () {
    var b = "";
    $("#listdept option:selected").each(function () {
        b = $(this).attr('value');
        $('#job_footer-data .testB').text(b);
        if (b == "all" || b == "select") {
            $('.job_entry').each(function () { $(this).fadeIn(); });
        } else {
            $('.job_entry').each(function () {
                if (!$(this).hasClass(b)) {
                    $(this).fadeOut('normal').addClass('hidden');
                } else {
                    $(this).fadeIn('slow').removeClass('hidden');
                }
            });
        };
        return false;
    });
})


$('.job_t').toggle(function () {
    $(this).css({ 'color': 'red' }).next('.job_d').slideDown(); $(this).find('.desc_view').text('-');
}, function () {
    $('.job_t').css({ 'color': 'black' }); $('.job_d').slideUp(); $('.desc_view').text('+');
});
//annivesary 1
$('.tetbg-l, .tetbg-r').css({'cursor':'pointer'}).click(function(){window.location.href="/Default.aspx?tabid=186"});
$("#xro-all a").click(function (e) { e.preventDefault(); }); $('.xbd-trow').hide(); $('.xro-list').css({ 'opacity': 0.9 })
$('.xro-stores').css({ 'cursor': 'pointer' }).click(function () { $('.xro-list').slideToggle(300);});
$('.xro-list li').css({ 'cursor': 'pointer' }).hover(function () { $(this).addClass('xro-activ'); },
function () { $(this).removeClass('xro-activ'); }).click(function () {
$("body, html").scrollTop(500).delay(300);
$('.xbd-hi-1').fadeOut('fast').fadeIn('slow').delay(500); 
$('.xbd-cata').children('img').fadeOut('fast').attr('src', '/Portals/0/slide_09-4.jpg').fadeIn('slow').delay(300).fadeOut().fadeIn(); 

$(this).addClass('xro-activ'); $('.xro-list').slideUp(300); var irel = $(this).attr('rel'); var txt = $(this).text();
$('.xro-stores').html("").html('<span style="line-height:50px" rel="' + irel + '">' + txt + '</span>');

var sc = $('.xro-stores').children('span').attr('rel');
$('.xbd-trow').each(function () {
$(this).hide().children('td').eq(4).filter(function () { return $(this).attr('rel') == sc; }).parent('tr').show();
});
});

$('.xbd-cata').click(function (event) {
var sc = $('.xro-stores').children('span').attr('rel'); if (sc != undefined) {
$(this).attr('target', '_blank');
$(this).attr('href', '/Default.aspx?tabid=169&StoreCode=' + sc + '');
} else { $(this).attr('target', '_self'); }
}); 

/////////////////////////////////
/////////menu/////////////////////
////////////////////////////////	
$('#slidemenu li').css({'opacity':0.9}).find('a').css({'color':'#444'});
$("#slidemenu li.down").mouseover(function(){
											   var n= $(this).children('div').length; 
											   var m= 26*n + 35;
											  						  
$(this).stop().animate({'height':+ m +'px'},{queue:false, duration:400, easing: 'swing'});
});		
$("#slidemenu li.down").mouseout(function(){
											
$(this).stop().animate({height:'34px'},{queue:false, duration:400, easing: 'swing'});
		
	});
	
$('#slidemenu div').mouseover(function(){
		
$(this).css({"background-color": "#daf772"},100).children('a').css({"color": "#000"},100);
	});
	
	
	$("#slidemenu div").mouseout(function(){
		$(this).css({"background-color": "#c7ec37"},100).children('a').css({"color": "#444"},100);
		
	});

$('.rollover').mouseenter(
            function(){ 
                var t = $(this);
				 //t.hide();
               t.attr('src',t.attr('src').replace('_0', '_1'));}).mouseleave(
            function(){ 
                var t= $(this);
                t.attr('src',t.attr('src').replace('_1','_0'));
				//t.show();
            });

            //media center////
            $('.imgbox').mouseenter(function () { $(this).css({ 'background-color': '#A6C93A', 'color': 'white' }); }).mouseleave(function () { $(this).css({ 'background-color': '#060', 'color': 'white' }); });
            $('.textbox').css({ 'opacity': 0.6 });

            $(function () {
                $("ul#ticker02").liScroll({ travelocity: 0.05 });
            });
//////////////////////////////////////////
////////////////////////faq//////////////////////////////////////
////////////////////////////////

$('#bcfaq .a, #bcfaq-left .a').css('display', 'none');


$('#bcfaq .q').click(
  function () {
    $(this).siblings().not('.a, .theme').css({opacity: 1});
	$(this).prev('.nitem').css({opacity: 1});
	$(this).css({color: '#9C0'}).next('#bcfaq .a').slideDown('normal');
	$(this).css({opacity: 1}).siblings().not('.theme').css({color: '#333'}).next('#bcfaq .a').slideUp();
	$(this).css({opacity: 1}).parent().siblings().children('#bcfaq .q').not('.theme').css({opacity: 1}).next('#bcfaq .a').slideUp();
  }
);


$('#bcfaq-left .q').click(function(){$(this).css({color: '#9C0'}).next('#bcfaq-left .a').slideDown('normal');
	$(this).css({opacity: 1}).siblings().not('.theme').css({color: '#333'}).next('#bcfaq-left .a').slideUp();
	$(this).css({opacity: 1}).siblings('.q').css({color: '#900'});
	$(this).css({opacity: 1}).parent().siblings().children('#bcfaq-left .q').not('.theme').css({opacity: 1}).next('#bcfaq-left .a').slideUp();});
	
//////////////////////////////////////////
/////////////////////stores map/////////////////// 
///////////////////////////////////////////


$('white').css({opacity: 0}); $('.bg1').css({opacity: 1});
$('.city').click( function(){ var i = $(this).index()-2;
$(this).css({"color":"red"}).siblings('.city').css({"display":"none"}); 
$('.g' + i +'').fadeIn(700);
$('.white').animate({opacity: 0.8},400); $('.city').not('.g' + i +'').animate({opacity: 0.2},400);
});
$('.white').click( function(){ $(this).animate({opacity: 0},400);$('.pict').fadeOut(400);$('.city').animate({opacity: 1},400); $('.city').css({"color":"black"}).siblings('.city').css({"display":"block"});});
$('.pict').children('a').children('img').hover( function(){
$(this).removeClass('nonhilite').addClass('hilite');
}, function(){
$(this).removeClass('hilite').addClass('nonhilite');
}
);

///////////////////////////////////////////////////
///staff slideshow////////////////////////////////
////////////////////////////////////////////////////

						
$('.people li').not('.intro').css({opacity: 0.2}); 
$('.description').css({display: 'none'});
$('.people li').animate({"left":"50px"}, 1000, "easeOutBack").eq(1).css({opacity: 0.9}); 
$('.infoposition').eq(1).show('fast');

$(".icons li").css({opacity: 0.6}); 
$(".icons li").hover(function ()
{
var i= $(this).index(); var e = -(i-2)*122-66; var d = 50; 

      $(".icons li").eq(i).css({opacity: 1});
	  
	  $('.people li').animate({"left":""+ e +"px"}, d, "easeOutBack").eq(i).css({opacity: 0.9}).siblings().not('.intro').css({opacity: 0.2});
	
	  $(".description").slideUp('slow');
	  $('.infoposition').eq(i).show().siblings('.infoposition').hide(); 
	 
    }
	, function () {
	
   $(".icons li").css({opacity: 0.6});
	  $('.info').css({opacity: 0.9});
    });
$(".icons li").click(function(){var j = $(this).index()-1; $(".description").eq(j).slideDown('normal');});

///////////////////////////////////////////////
//////////////////shoppingmall/////////////////
//////////////////////////////////////////////

for (var i=1; i<10; i++){ var w = ($('#slidep2').width())/4; var d = 6000; $('.o').text(w+';'+d);
$('#slidep2').animate({left: '-='+w+'px'}, d, 'linear').animate({left: '+='+w+'px'}, d, 'linear');
};

////////////////////////////////////////////////////
///////////////////store x info/////////////////////
//////////////////////////////////////////////////
$('a.astx span').click(function(){$('#storesubinfo').slideToggle();});
///test
$('.test').click(function(){$(this).css({ "background-color": "#c7ec37", color: "black" });});


//////////////////////////////////////////////////
///////////////////star products/////////////////////
//////////////////////////////////////////////////////

$(function() {
    $("#bcadslide").jCarouselLite({
        'btnNext': ".next",
        'btnPrev': ".prev",
		'auto': 2500,
		'easing': "swing",
		'speed': 1000
    });
});

////////////////////////////////////////////////////
///////////////////////ads homepage////////////////
//////////////////////////////////////////////////

$('#hpadslider').jqFancyTransitions({width:670,height:300,strips:1,delay:2000,stripDelay:1,titleOpacity:0,titleSpeed:1000,position:'alternate',direction:'right',effect:'wave',navigation:true,links:true});	

/////////////////////////////////////////////
/////////////toggles achievments////////////////
//////////////////////////////////////////////

	$('#awards ul').click(function(){
	$(this).next('div').slideToggle();
	});
	
	
	
	

////////////////////////////////////////////////////
   ////////////////////////lohasmenu///////////
////////////////////////////////////////////////////////	
$('#lohasmenu').find('img').hover(function(){
          var newSrc = $(this).attr("src").replace("_off", "_on");
          $(this).attr("src", newSrc);  
		  }, function(){ 
		  var newSrc = $(this).attr("src").replace("_on", "_off");
          $(this).attr("src", newSrc);  
		  });
	
	
	
/////////////////////////	
	///////////GalleryPhoto////////////
	/////////////////////////////////////
	
//Default Action
	$(".bcnewstab_content").hide(); //Hide all content
	$("ul.bcnewstabs li:first").addClass("active").show(); //Activate first tab
	$(".bcnewstab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.bcnewstabs li").click(function() {
		$("ul.bcnewstabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".bcnewstab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});






//special 2dcode product
//$('.spe_tb').toggle(function(){$(this).next('.spe_desc').slideDown();},function(){$(this).next('.spe_desc').slideUp();});



//wish
 $('.wishsubmit').click(function(){
 function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}
var l = getUrlVars()["language"]; //alert(l);
if(l){
switch (l){
case 'en-US':
$('.bc_wishinput').val()==0 ? alert('Please tell us your idea and submit it') : alert('Thank you for your feedback');
break;
case 'vi-VN':
$('.bc_wishinput').val()==0 ? alert('Vui lòng viết ý kiến của Quý khách vào ô trống!') : alert('Cảm ơn ý kiến của Quý khách!');
break;
case 'en':
$('.bc_wishinput').val()==0 ? alert('Please tell us your idea and submit it') : alert('Thank you for your feedback!');
break;
case 'vi':
$('.bc_wishinput').val()==0 ? alert('Vui lòng viết ý kiến của Quý khách vào ô trống!') : alert('Cảm ơn ý kiến của Quý khách!');
break;
case '':
$('.bc_wishinput').val()==0 ? alert('Vui lòng viết ý kiến của Quý khách vào ô trống!') : alert('Cảm ơn ý kiến của Quý khách!');
break;
}
}else{$('.bc_wishinput').val()==0 ? alert('Vui lòng viết ý kiến của Quý khách vào ô trống!') : alert('Cảm ơn ý kiến của Quý khách!');}
});

//lessaffre
	
          $('#textwithpopimg a').css({ 'position': 'relative' })
          .click(function (e) { e.preventDefault(); })
          .hover(function () {wcbpop=$(this).attr('rel'); $(this).prepend('<div style="position:absolute;top:-200px;left:100px;z-index:10;border:4px solid Maroon;" class="wcb-boximg"><img src="http://www.bigc.vn/Portals/0/WCB/'+wcbpop+'.jpg" alt="Big C WCB"></div>'); }
          , function () { $('.wcb-boximg').remove(); });

          $('.WCB_slidedownbtn').click(function () {
              $('#WCB_stories').slideDown('slow');
          });
          $('.WCB_slideupbtn img').click(function () {
              $('#WCB_stories').slideUp(800);
          });

          $('.WCB_slidedownbtn2').click(function () {
              $('#WCB_stories2').slideDown('slow');
          });
          $('.WCB_slideupbtn2 img').click(function () {
              $('#WCB_stories2').slideUp(800);
          });

          $('#bcdatastore').find('a').click(function () { $('#bcpromoframe').hide(); });
 // end       
});
