$(document).ready(function()
{
  try
  {
    $(".itemMatDet").hide();
    $(".itemDelDet").hide();
    $(".linkItemDesc").parent().addClass("bn");

    $("a.linkItemDesc").click(function()
    {
        $(".itemDescBox li").removeClass("bn");
        $(this).parent().addClass("bn");
        $(".itemDescBox div").hide();
        $(".itemDescDet").show();
    });

    $("a.linkItemDel").click(function()
    {
        $(".itemDescBox li").removeClass("bn");
        $(this).parent().addClass("bn");
        $(".itemDescBox div").hide();
        $(".itemDelDet").show();
    });

    $("a.linkItemMat").click(function()
    {
        $(".itemDescBox li").removeClass("bn");
        $(this).parent().addClass("bn");
        $(".itemDescBox div").hide();
        $(".itemMatDet").show();
    });

    $(".btnFSSpring").hover(function()
    {
        //$(".btnHoverfsf09").show();
        AllowRoateImages=false;RotateImages('1')
    }, function()
    {
        AllowRoateImages=true;RotateImages('2')
//        $(".btnHoverfsf09").hide();
//        $(".btnHoverfsf09").show();
    });

  $(".btnFSFall09").hover(function()
    {
//        $(".btnHoverfss09").show();
        AllowRoateImages=false;RotateImages('2')
    }, function()
    {
//        $(".btnHoverfss09").hide();
//        $(".btnHoverfsf09").show();
        AllowRoateImages=true;RotateImages('3')
    });
    
    $(".btnCampaign").hover(function()
    {
        AllowRoateImages=false;RotateImages('3')
        //$(".btnHovercav").show();
    }, function()
    {
        AllowRoateImages=true;RotateImages('4')
        //$(".btnHovercav").hide();
        //$(".btnHoverfsf09").show();
    });

//    $(".btnDenim").hover(function()
//    {
//        $(".btnHoverdft").show();
//    }, function()
//    {
//        $(".btnHoverdft").hide();
//        $(".btnHoverfsf09").show();
//    });

    $(".btnNews").hover(function()
    {
     //   alert('onhover');
        AllowRoateImages=false;RotateImages('4')
        //$(".btnHovernap").show();
    }, function()
    {
   // alert('onmouseout');
        AllowRoateImages=true;RotateImages('5')
//        $(".btnHovernap").hide();
//        $(".btnHoverfsf09").show();
    });

  

    $(".btnShopOnline").hover(function()
    {
        AllowRoateImages=false;RotateImages('5')
        //$(".btnHovershop").show();
    }, function()
    {
        AllowRoateImages=true;RotateImages('1')
        //$(".btnHovershop").hide();
        //$(".btnHoverfsf09").show();
    });
  }catch(ex){}
});

$(function() {
 try{
	$('.galleryLB a').lightBox();
	}catch(ex){}
});

/*Rotate images*/
var imgIndex=2;
var AllowRoateImages = true;
function RotateImages(selecteddiv)
{
	try
	{
	   	var LogoId;	  
		//Default settings		
		$('#ctl00_ctl00_right_uxSpringFashionShow').removeClass();
		$('#ctl00_ctl00_right_uxSpringFashionShow').addClass('btnFSSpring');
		$(".btnHoverfss09").hide();
		
		$('#ctl00_ctl00_right_uxFall09FS').removeClass();
		$('#ctl00_ctl00_right_uxFall09FS').addClass('btnFSFall09');
		$(".btnHoverfsf09").hide();
		
		$('#ctl00_ctl00_right_uxCampaignVideo').removeClass();
		$('#ctl00_ctl00_right_uxCampaignVideo').addClass('btnCampaign');
		$(".btnHovercav").hide();
		
		$('#ctl00_ctl00_right_uxPressNews').removeClass();
		$('#ctl00_ctl00_right_uxPressNews').addClass('btnNews');
		$(".btnHovernap").hide();
		
		$('#uxShopOnline').removeClass();
		$('#uxShopOnline').addClass('btnShopOnline');
		$(".btnHovershop").hide();
		
		if(AllowRoateImages)
		{
			if(selecteddiv!=null)
				imgIndex=selecteddiv;
				
			if(imgIndex>5)
				imgIndex=1;
			LogoId = 'uxLogo' + imgIndex;
			imgIndex++;
		}
		else
		{
			if(selecteddiv!=null)
			{	
				LogoId='uxLogo' + selecteddiv;
				imgIndex=selecteddiv;
			}
		}
		//On hover case: Storing the index in case exception comes and switch default case runs automatically.
	 	var exIndex;
	    if(LogoId != 'undefined')
	        exIndex=imgIndex;
		switch (LogoId){		
			case "uxLogo1":
			$('#ctl00_ctl00_right_uxSpringFashionShow').addClass('selectedSpr btnFSSpring');
			$(".btnHoverfss09").show();
			break;
			case "uxLogo2":
			$('#ctl00_ctl00_right_uxFall09FS').addClass('selectedFSFall09 btnFSFall09');
			$(".btnHoverfsf09").show();
			break;
			case "uxLogo3":
			$('#ctl00_ctl00_right_uxCampaignVideo').addClass('selectedCamp btnCampaign');
			$(".btnHovercav").show();
			break;
			case "uxLogo4":
			$('#ctl00_ctl00_right_uxPressNews').addClass('selectedNews btnNews');
			$(".btnHovernap").show();
			break;
			case "uxLogo5":
			$('#uxShopOnline').addClass('selectedShop btnShopOnline');
			$(".btnHovershop").show();
			break;
			default:
			    RotateImages(exIndex);
		}
	
	}catch(ex){}
}
