
function getSessionurl() {
    document.getElementById('ctl00_elementSubNavigation_hdnSession').Value = window.location.href;
    
}
function PaymentAddressSelect(checkbox)
{
    $('.selected_address').each(function()
    {
        var thisCheckbox = $(this).children().get(0);
        
        if(thisCheckbox.id != checkbox.id)
        {
            thisCheckbox.checked = false;
        }
    }
    );
}

function PackagingOptionSelect(checkbox)
{
    $('.packagingoptioncheckbox').each(function()
    {
        var thisCheckbox = $(this).children().get(0);
        
        if(thisCheckbox.id != checkbox.id)
        {
            thisCheckbox.checked = false;
        }
    }
    );
}
function PackagingOptionSelectGift(checkbox)
{
    $('.packagingoptioncheckboxGift').each(function()
    {
        var thisCheckbox = $(this).children().get(0);
        
        if(thisCheckbox.id != checkbox.id)
        {
            thisCheckbox.checked = false;
        }
    }
    );
}
function AddressSelectionCheck(sender, args)
{
    var selected = false;
    
    $('.selected_address').each(function()
    {
        var thisCheckbox = $(this).children().get(0);
        
        if(thisCheckbox.checked == true)
        {
            selected = true;
        }
    }
    );
    args.IsValid = selected;
}

function ShowAddressEditPanel(litPanelID, tbPanelID)
{
    
    var litPanel = document.getElementById(litPanelID);
    var tbPanel = document.getElementById(tbPanelID);

    litPanel.style.display = 'none';
    tbPanel.style.display = 'block';

    
    
    return false;
}

function ShowAddressAddPanel(addButtonID, addDivID)
{
    var addButton = document.getElementById(addButtonID);
    var addDiv = document.getElementById(addDivID);

    addButton.style.display = 'none';
    addDiv.style.display = 'block';
    
    $('.proceedDiv').hide();
    
    $('.selected_address').each(function()
    {
        $(this).children().get(0).checked = false;
    });
    
    return false;
}

function ShowAdditional()
{
	$('img.additionalButton').hide();
        $('div.additional').show();

}

function HideAdditional()
{
	$('img.additionalButton').show();
        $('div.additional').hide();

}

$(document).ready(function(){
    
        $('.priceDropDown').change(function(){
            
            var index = this.selectedIndex;
            
            var prices = $('div.optionPrices').text();
            
            var pricesArray = prices.split('|');
            
            $('.priceChange').html(pricesArray[index - 1]);
        });
    
        $('.vlink1').click(function(){
            $('.vlink1').css({display:'none'});
            $('.vlink2').css({display:'block'});
            $('.vt1').css({display:'block'});
        });
        
        $('.vlink2').click(function(){
            $('.vlink2').css({display:'none'});
            $('.vlink3').css({display:'block'});
            $('.vt2').css({display:'block'});
        });
        
        $('.vlink3').click(function(){
            $('.vlink3').css({display:'none'});
            $('.vt3').css({display:'block'});
        });

        $('a.privilegeQuestion').click(function(){
            //getting height and width of the message box
            var topVal = $('a.privilegeQuestion').offset().top - 250 + "px";
            var leftVal = $('a.privilegeQuestion').offset().left - 320 + "px";
            
            //show the popup message and hide with fading effect
            $('#popup_privilege').css({left:leftVal,top:topVal}).show();
            return false;
        });    
  
      $('a.voucherQuestion').click(function(){
            //getting height and width of the message box
            var topVal = $('a.voucherQuestion').offset().top - 250 + "px";
            var leftVal = $('a.voucherQuestion').offset().left - 320 + "px";
            
            //show the popup message and hide with fading effect
            $('#popup_voucher').css({left:leftVal,top:topVal}).show();
            return false;
      });
      
      $('a.discountQuestion').click(function(){
            //getting height and width of the message box
            var topVal = $('a.discountQuestion').offset().top - 250 + "px";
            var leftVal = $('a.discountQuestion').offset().left - 320 + "px";
            
            //show the popup message and hide with fading effect
            $('#popup_discount').css({left:leftVal,top:topVal}).show();
            return false;
      });
      
      $('a.sizeQuestion').click(function(){
            //getting height and width of the message box
            var topVal = $('a.sizeQuestion').offset().top - 250 + "px";
            var leftVal = $('a.sizeQuestion').offset().left - 320 + "px";
            
            //show the popup message and hide with fading effect
            $('#popup_size').css({left:leftVal,top:topVal}).show();         
            return false;
      });
      
      $('a.deliveryQuestion').click(function(){
            //getting height and width of the message box
            var topVal = $('a.deliveryQuestion').offset().top - 250 + "px";
            var leftVal = $('a.deliveryQuestion').offset().left - 320 + "px";
            
            //show the popup message and hide with fading effect
            $('#popup_delivery').css({left:leftVal,top:topVal}).show();
            return false;
      });
      
      $('a.returnsQuestion').click(function(){
            //getting height and width of the message box
            var topVal = $('a.returnsQuestion').offset().top - 250 + "px";
            var leftVal = $('a.returnsQuestion').offset().left - 320 + "px";
            
            //show the popup message and hide with fading effect
            $('#popup_returns').css({left:leftVal,top:topVal}).show();
            return false;
      });
      
      $('.popup_msg').click(function(){
        $(this).show().fadeOut(500);
      });
      
      $('img.giftTagImage').click(function(){
       
        var inputid = '#' + $(this).parent().attr('for');
        $(inputid).attr('checked','checked');
        $('img.giftTagImage').attr('class','giftTagImage');
        $(this).attr('class','giftTagImage selectedx');
        
      });
      
      $('div.sitemap a').mouseover(function(){
        $(this).attr('class','darkgrey');
      });
      
      $('div.sitemap a').mouseout(function(){
        $(this).attr('class','');
      });
      
	/*
      $('img.additionalButton').click(function(){
        $(this).hide();
        $('div.additional').show();
      });
      
      $('div.additional img').click(function(){
        $('img.additionalButton').show();
        $('div.additional').hide();
      });*/
      
      /*
      $('div.homeWelcome').click(function(){
        window.location = '/1/style-stories.aspx';
      });
      
      $('div.homeEthical').click(function(){
        window.location = '/content/about-element/default.aspx';
      });*/
      
 }); 
 
 var lpPosY = 100;


