/*
Javascript code supporting ajax functionalities.
*/

var NotesCookie = false;
var PrintCartCookie = false;
var LinkCartCookie  = false;
var dldInProgress = false;
var basepath = '/';
var notesUrl = "";
var printUrl = "";
var LinksUrl = "";
var mailerUrl = "";
var feedbackUrl = "";
var downloadsUrl = "";
var exitUrl = "";
var options = false;

function establishPgId()
{
	var contentClass = $('body').attr("class");
	var rg = new RegExp("pg\\d+");
	var res = rg.exec(contentClass);
	contentClass = res;
	return res;
}


function isInNotepad(){
	var pg = $('body').attr('class');
	var rg = new RegExp("pg\\d+");
	var res = rg.exec(pg);
	pg=res;
	var MyCookie = NotesCookie;
	return (MyCookie && MyCookie.indexOf('###'+pg) > -1);
}

function setNotepadPageStatus(){
    if (isInNotepad()){
		$('li.note > #notes').text('Edit');
	}
}


function isInCart(){
		var value =  PrintCartCookie;
		return (value != null && value.indexOf(establishPgId())>-1)
}

function isInLinkCart(){
		var value =  LinkCartCookie;
		return (value != false && value.indexOf(establishPgId())>-1);
}

function setCartPageStatus(){
		if (isInCart()){
		$('li.printbasketadd a').remove();
		$('li.printbasketadd').append('<span>Page added</span>')
	}

}

function setLinkCartStatus(){
    if (isInLinkCart()){
		$('li.linkBasketAdd > #linkbasket').remove();
		$('li.linkBasketAdd > span.slashsep').remove();	}
}

function getPageFromLink(link){
		var pg = $(link).attr('href');
		var rg = new RegExp("pg\\d+");
		var res = rg.exec(pg);
		return res;
}
function displayPopup(){
	$('body').append('<div id="dialog" class="jqmWindow"><div class="close" alt="Close window">Close</div><div class="content"></div><div id="splash"><h2>Processing...</h2><img src="'+basepath+'images/loading.gif" /></div></div>');
	$('#dialog').jqm({onShow: showEvent, modal: true}).jqmShow();
	$('div.jqmOverlay').click(function(){ClosePopup();});
	$('.close').click(function(){ClosePopup();});
}
function showEvent(hash){
		SetSplashStatus(true);
		hash.w.show();
		$.get(options['url'],options['params'],function (data){
				loadEvent(data);
			}
	);
}
function loadEvent(data){
	$('#dialog > div.content').html(data);
	SetSplashStatus(false);
	if (options['CancelAction']){
			$(options['CancelAction']).click(function(){
				ClosePopup();
				return false;
			});
			$(options['CancelAction']).show();
	}
	if (options['DoAction']) {
		$(options['DoAction']).click(submitEvent);
	}

	if (options['loadCallback']) {
		options['loadCallback']();
	}
}

function submitEvent(data){
	  SetSplashStatus(true);
	  var fields = $('#dialog > div.content').find(":input");
	  var inputs = getAjaxFormFields(fields);
	  $.get(options['url'],inputs,function (data){
	  		loadEvent(data);
	  		if (options['submitCallback'] != null){
	  			options['submitCallback']();
				}
	  	});
		return false;
}
function ClosePopup(){
	$('#dialog').jqmHide();
	$('#dialog').remove();
}

function getAjaxFormFields(fields){
	var inputs = new Object();
	inputs['ajax']=1;
	for (i=0;i<fields.length;i++){
	  	if (fields[i].name != '') {
			if ((fields[i].type == 'radio' || fields[i].type == 'checkbox')){
				if (fields[i].checked) inputs[fields[i].name]= fields[i].value;
			}
			else
				inputs[fields[i].name]= fields[i].value;
		}
	}
	return inputs;
}

function SetSplashStatus(visible){
	if (visible){
		$('#splash').show();
		$('#dialog > div.content').hide();
	}
	else{
		$('#splash').hide();
		$('#dialog > div.content').show();
	}
}


$(document).ready(function() {

	/* MORE FUNCTIONALITY JS */
            var x = document.location.href.replace('http://','');
			var y = $('#logo').attr('src');
			basepath = y.replace('images/logos/astrazeneca.png','');
			//define urls
			notesUrl = basepath+'scripts/notepad.asp';
			printUrl = basepath+'scripts/print.aspx';
			linksUrl = basepath+'scripts/links.aspx';
			mailerUrl = basepath+'scripts/email.aspx';
			exitUrl = basepath+'scripts/exit.aspx';
			feedbackUrl = basepath+'scripts/feedback.aspx';
			downloadsUrl = basepath+'scripts/downloads.aspx';
			 $('#print_all').click(function (){
				$('input.'+$(this).attr('class')).attr('checked',$(this).attr('checked'));
			});
		   $('#delete_all').click(function (){
				$('input.'+$(this).attr('class')).attr('checked',$(this).attr('checked'));
			});
		   $('#email_all').click(function (){
				$('input.'+$(this).attr('class')).attr('checked',$(this).attr('checked'));
			});

			$('a.printButton').click(function() {
				window.print();
		  });
		  NotesCookie = $.ajax({type: 'GET',url: notesUrl,async: false,data: {ajax: 1, ajxcmd: 'getcookie'},dataType: 'text'}).responseText;
		  PrintCartCookie = $.ajax({type: 'GET',url: printUrl,async: false,data: {ajax: 1, ajxcmd: 'getcookie'},dataType: 'text'}).responseText;
		  LinkCartCookie = $.ajax({type: 'GET',url: linksUrl,async: false,data: {ajax: 1, ajxcmd: 'getcookie'},dataType: 'text'}).responseText;
		  $('a.clear-dls').click(function(){
			$("input[type='checkbox']").attr('checked','');
			return false;
		  });
		   $('a.clear-dls').click(function(){
			$("input[type='checkbox']").attr('checked','');
			$("input[type='checkbox']").attr('disabled',false);
			return false;
		  });
		    $('input.swed_parent').click(function(){
			if ($(this).attr('checked')) {
				$("input.swed_child").attr('checked','');
				$("input.swed_child").attr('disabled',true);
			}
			else {
				$("input.swed_child").attr('checked','');
				$("input.swed_child").attr('disabled',false);
			}
		  });
		  $('input.intro_parent').click(function(){
			if ($(this).attr('checked')) {
				$("input.intro_child").attr('checked','');
				$("input.intro_child").attr('disabled',true);
			}
			else {
				$("input.intro_child").attr('checked','');
				$("input.intro_child").attr('disabled',false);
			}
		  });
		   $('input.director_parent').click(function(){
			if ($(this).attr('checked')) {
				$("input.director_child").attr('checked','');
				$("input.director_child").attr('disabled',true);
			}
			else {
				$("input.director_child").attr('checked','');
				$("input.director_child").attr('disabled',false);
			}
		  });
		   $('input.additional_parent').click(function(){
			if ($(this).attr('checked')) {
				$("input.additional_child").attr('checked','');
				$("input.additional_child").attr('disabled',true);
			}
			else {
				$("input.additional_child").attr('checked','');
				$("input.additional_child").attr('disabled',false);
			}
		  });
		  
		  $('input.fulldoc').click(function(){
			if ($(this).attr('checked')) {
				$("input.additional_parent").attr('checked','');
				$("input.additional_child").attr('checked','');
				$("input.additional_parent").attr('disabled',true);
				$("input.additional_child").attr('disabled',true);
				$("input.director_parent").attr('checked','');
				$("input.director_child").attr('checked','');
				$("input.director_parent").attr('disabled',true);
				$("input.director_child").attr('disabled',true);
				$("input.intro_parent").attr('checked','');
				$("input.intro_child").attr('checked','');
				$("input.intro_parent").attr('disabled',true);
				$("input.intro_child").attr('disabled',true);
				$("input.fins").attr('checked','');
				$("input.fins").attr('disabled',true);
			}
			else {
				$("input.additional_parent").attr('checked','');
				$("input.additional_child").attr('checked','');
				$("input.additional_parent").attr('disabled',false);
				$("input.additional_child").attr('disabled',false);
				$("input.director_parent").attr('checked','');
				$("input.director_child").attr('checked','');
				$("input.director_parent").attr('disabled',false);
				$("input.director_child").attr('disabled',false);
				$("input.intro_parent").attr('checked','');
				$("input.intro_child").attr('checked','');
				$("input.intro_parent").attr('disabled',false);
				$("input.intro_child").attr('disabled',false);
				$("input.fins").attr('checked','');
				$("input.fins").attr('disabled',false);
			}
		  });
		  
		  $('#notes').click(function(){
				var callbackFn = function(){
					  NotesCookie = $.ajax({type: 'GET',url: notesUrl,async: false,data: {ajax: 1, ajxcmd: 'getcookie'},dataType: 'text'}).responseText;
						setNotepadPageStatus();
				};
				options = {url: notesUrl,params: {ajax:1,add:getPageFromLink('a#notes')},CancelAction: '#CancelNote',DoAction: '#SaveNote',submitCallback: callbackFn};
				displayPopup();
				return false;
		   });

		  $('li.email a').click(function(){
				options = {url: mailerUrl,params: {ajax:1,pg:getPageFromLink('li.email a')},CancelAction: '.CancelSend',DoAction: '.ActionSend'};
				displayPopup();
				return false;
		   });

		  $('li.feedback a').click(function(){
				options = {url: feedbackUrl,params: {ajax:1},CancelAction: '.CancelSend',DoAction: '.ActionSend'};
				displayPopup();
				return false;
		   });


		   $('a.external').click(function (){
						var surl = (this.href.indexOf('url=')>0) ? this.href.substring(this.href.indexOf('url=')+4) : this.href;
						options = {url: exitUrl,params: {url:surl},CancelAction: '.CancelExit'};
						displayPopup();
						return false;
			 });

		   $('.downloadButton').click(function (){
				var dlds = $('input[name=dld]:checked');
				var docs = '';
				for (i=0;i<dlds.length;i++)	docs += ','+dlds[i].value;
				if (docs.length > 0){
					docs = docs.substr(1);
					var loadCallback = function(){ dldInProgress = true;};
					options = {url: downloadsUrl,params: {ajax:1, dld:docs},loadCallback: loadCallback};
					displayPopup();
				}
				return false;
			 });
		   // Cookie js finds if persistent cookies are enabled
			setCartPageStatus();
			setNotepadPageStatus();
			setLinkCartStatus();

    // Get the absolute URL
var theHost=jQuery.url.attr("host");

if (theHost.toLowerCase().indexOf('webdev')>-1){
    theHost=theHost+'/sites/az.reports.addison.co.uk';

};
if (theHost.toLowerCase().indexOf('reports')>-1){
   theHost=theHost+'/assets/az.reports.addison.co.uk';
};
if (theHost.toLowerCase().indexOf('astrazeneca')>-1){
   theHost=theHost+'/2009';
};

// EXTERNAL LINKS
$('a[rel="external"]')
  .click( function() {
  window.open( $(this).attr('href') );
  return false;
 });

// RANDOM NUMBER ON END OF IMAGE SRC

$('img').each(function(){
   $(this).attr("src",$(this).attr("src")+"?num="+Math.random()*100000);
});
/*$("*").not('#accordion h3').not('#navigation a').each(function(){
    var bg=$(this).css("background-image");

    if (bg.indexOf('url')>-1){
        bg=bg.substring(0,bg.length-1);

    bg=bg+'?num='+Math.random()*100000+')';

    $(this).css("background-image",bg);
    };
});*/

// END RANDOM NUMBER ON END OF IMAGE SRC



	$("#searchField").focus(function() {
		if ($(this).val() == "Search")
			$(this).val('');
    });
	


/*
// Accordion
if (location.hash){	
	var activeAcc=(location.hash).replace('#','');
	activeAcc=parseInt(activeAcc);
} else {
	var activeAcc=false;
};
$("#accordion").accordion({ active:activeAcc,autoHeight: false,change: function(event, ui) { $(window).scrollTo($('.ui-state-active'), 400 ) }});

$(window).scrollTo($('.ui-state-active'), 400 );


jQuery(window).hashchange(function() {

	var activeAcc=(location.hash).replace('#','');
	activeAcc=parseInt(activeAcc);
	
	$(window).scrollTo($('body'), 800, function(){
		$("#accordion").accordion( 'destroy' );
		$("#accordion").accordion({ active:activeAcc,autoHeight: false,change: function(event, ui) { $(window).scrollTo($('.ui-state-active'), 400 ) }});
		$(window).scrollTo($('.ui-state-active'), 800 );
		
		
		
	});
	
	
});
*/



// Accordion
// variable for accordion section
activeAccSubSection = false;
// variable for accordiion subsection and anchor
activeAccSubSectionAnchor = false;
var lastKnownHash = false;

if (location.hash){	
	// remove the # (the has hash can container either a number or text)
	var activeAcc=(location.hash).replace('#','');
	// test to find subsection anchor
	activeAccSubSectionTest = activeAcc.indexOf('=');
	activeAccSubSection = false;
	// if test is true
	if(activeAccSubSectionTest != '-1'){
		// split the varibale example 2(accordion sub section) and animal(anchor within subsection)
		activeAccSubSection = activeAcc.split('=', [2]);
		// place sub section accordion varibale within activeAcc
		activeAcc = activeAccSubSection[0];
		lastKnownHash = location.hash;
		location.hash = '100';		
	} else {
		// else test if activeAcc is either a number or text
		if(/^\d*$/.test(activeAcc)){
			// if a number turn into a interger
			activeAcc=parseInt(activeAcc);
			lastKnownHash = location.hash;
			location.hash = '100';			
		} else {
			// else activeAcc is a text anchor
			activeAccSubSectionAnchor = activeAcc;
		}
	}
	activeAcc=parseInt(activeAcc);
	
	
} else {
	// no hash then false
	var activeAcc=false;
};


//	only a anchor exisit (no accordion needed)
if(activeAccSubSectionAnchor){
	// them scroll to anchor
	$(window).scrollTo($('#'+activeAccSubSectionAnchor), 800 );
} else {
	// else open correct accordion section or leave default depending on hash being present or not
	$("#accordion").accordion({ active:activeAcc,autoHeight: false,change: function(event, ui) { $(window).scrollTo($('.ui-state-active'), 400 ) }});
	// if a sub section with a anchor exist then scroll that anchor after accordion has opened correct section
	if(activeAccSubSection){
		$(window).scrollTo($('#'+activeAccSubSection[1]), 800 );
	} else {
		// if no anchor within a sub section exist then scroll to open accordion
		$(window).scrollTo($('.ui-state-active'), 800 );
	}
}

	
	// hash change
	jQuery(window).hashchange(function() {
		// remove #		
		if(lastKnownHash == false){
			lastKnownHash = true;
			var activeAcc=(location.hash).replace('#','');	
			// test to find subsection anchor
			activeAccSubSectionTest = activeAcc.indexOf('=');
			activeAccSubSection = false;
			// if test is true
			if(activeAccSubSectionTest != '-1'){
				// split the varibale example 2(accordion sub section) and animal(anchor within subsection)
				activeAccSubSection = activeAcc.split('=', [2]);
				// place sub section accordion varibale within activeAcc
				activeAcc = activeAccSubSection[0];
			}
			// test if activeAcc is either a number or text
			if(/^\d*$/.test(activeAcc)){
				activeAcc=parseInt(activeAcc);
				$(window).scrollTo($('body'), 800, function(){	
						$("#accordion").accordion( 'destroy' );
						$("#accordion").accordion({ active:activeAcc,autoHeight: false,change: function(event, ui) { $(window).scrollTo($('.ui-state-active'), 400 ) }});		
						// if a sub section with a anchor exist then scroll that anchor after accordion has opened correct section
						if(activeAccSubSection[1]){
							$(window).scrollTo($('#'+activeAccSubSection[1]), 800 );
						} else {
							// if no anchor within a sub section exist then scroll to open accordion
							$(window).scrollTo($('.ui-state-active'), 800 );
						}
				});
			} else {
				// if #hash change was for a anchor within already open accordion then just go the right anchor without any accodion effect 
				$(window).scrollTo($('#'+activeAcc), 800 );
			}
			
			location.hash = '100';
			//window.location.replace('#','');
		}else {
			lastKnownHash = false;	
		}
	});









	$("#showContents").click( function() {
			if ($("#sitemapslider").height() == '0') {
				$("#sitemapslider").animate({
					height: "650px"
					}, 400 );


				$("#footer").animate({
					height: "720px"
					}, 400 );
				$("#footerContainer").animate({
					height: "720px"
					}, 400 );

				setTimeout("$.scrollTo($('#footer'), 800)",900);
				$("#showContents").text("Hide the contents of this Report");

				$("#showContents").removeClass('closed');
                $("#showContents").addClass('open');

			} else {
				$("#sitemapslider").animate({
					height: "0px"
					}, 400 );

				$("#footer").animate({
					height: "80px"
					}, 400 );

				$("#footerContainer").animate({
					height: "80px"
					}, 400 );

				$("#showContents").text("Show the contents of this Report");
				$("#showContents").removeClass('open');
                $("#showContents").addClass('closed');
			};
            return false;
		});



                /* HOMEPAGE EQUAL HEIGHT FOR BOXES */
                var highestCol =new Array($('.homepageTextbox li').eq(0).height(),$('.homepageTextbox li').eq(1).height(),$('.homepageTextbox li').eq(2).height(),$('.homepageTextbox li').eq(3).height());

                highestCol.sort(function(a,b){return a - b})

                // last item in array is now highest value
                $('.homepageTextbox li').height(highestCol[3]);

                /* HOMEPAGE BOXES HOVER STATES */







                $(".homepageTextbox li").hover(
                  function () {
                    $(this).css("background","none").css("cursor","pointer").css("text-decoration","underline");
                  },
                  function () {
                    $(this).css("color","#FFF").css("background","transparent").css("text-decoration","none");
                  }
                );

                    $(".homepageTextbox li").find("a").hover(
                  function () {
                    $(this).css("text-decoration","underline");
                  },
                  function () {
                    $(this).css("text-decoration","none");
                  }
                );

                /* END HOMEPAGE BOXES HOVER STATES */









                /* DOWNLOAD EQUAL HEIGHT FOR BOXES */
                var highestCol =new Array($('body.downloads ul.pdf_list li').eq(0).height(),$('body.downloads ul.pdf_list li').eq(1).height(),$('body.downloads ul.pdf_list li').eq(2).height());

                highestCol.sort(function(a,b){return a - b})

                // last item in array is now highest value
                $('body.downloads ul.pdf_list li').height(highestCol[2]);



                /* END DOWNLOAD EQUAL HEIGHT FOR BOXES */

                /* SET SUBMIT VALUE */
                $("#searchSubmit").attr("value","");



                /* Temporary fix homepage box 2 */
                $(".homepageTextbox li a").eq(1).css("color","#FFF");

                /* end Temporary fix homepage box 2 */




                /* BOARD OF DIRECTORS SECTION */
                var thisImg=basepath+'/images/governance/';

                //$(".current_board").find('img').attr('src',thisImg+$(".current_board").find('img').attr('id')+'_colour.jpg');

                $('#board_directors li').hover(
                function(){

                    var thisImg=basepath+'/images/governance/';
                    $(this).find('img').attr('src',thisImg+$(this).find('img').attr('id')+'_over.jpg');

                }
                ,
                function(){
                    var thisImg=basepath+'/images/governance/';
                     $(this).not(".current_board").find('img').attr('src',thisImg+$(this).find('img').attr('id')+'_colour.jpg');
                }
                );

                /* info */

                $('#board_directors li').live('click',function(){
                var thisImg=basepath+'/images/governance/';

                        $(".current_board").find('img').attr('src',thisImg+$(".current_board").find('img').attr('id')+'_colour.jpg');



                        $(this).find('img').attr('src',thisImg+$(this).find('img').attr('id')+'_over.jpg');

                    $('#board_directors li').removeClass("current_board");
                    $(this).addClass("current_board");

                    $('#director_info div.clearfix').hide();
                    $('#director_info div.clearfix').eq($('#board_directors li').index(this)).show();



                });

                $('#director_info div.clearfix').not(':first').hide();

                /* END BOARD OF DIRECTORS SECTION */


               /* TABBED BUTTONS POSITIONING */
               $('p.no_top_margin img').load(function() {
                   var p = $("h1");
                   var position = p.position();
                   $('#leftColumn ul.tab_list').css('margin','0');
                   $('.tab_list').not('body.downloads .tab_list').not('.at_a_glance').css("top",position.top);
               });

               // at a glance page
               $('img.medium_bottom_margin').load(function() {
                   var p = $("h2");
                   var position = p.position();
                   $('#leftColumn ul.tab_list').css('margin','0');
                   $('.at_a_glance').css("top",position.top);
               });


               //download page
               if ($('body.downloads .download_list').length){
               var p = $("body.downloads .download_list");
               var position = p.position();

               $('body.downloads .tab_list').css("top",position.top);

               };

               //Directors report
               if ($('body.directors-report .strategy_tab').length){
                   var p = $("body.directors-report .strategy_tabbed");
                   var position = p.position();
                   $('#leftColumn ul.tab_list').css('margin','0');
                $('body.directors-report .strategy_tab').css("top",position.top+20);
               };





               /* END TABBED BUTTONS POSITIONING */



               /* TABBED BUTTONS SELECTED */

               // hide all divs except first one

               $(".tabbed_div").not(':first').hide();



               $('.tab_list li a').live("click",function(){
                   var thisObj=$('.tab_list li a').index(this);
                  $('.tab_list li').removeClass('selected_tab');
                  $(this).parent('li').addClass('selected_tab');
                  $(".tabbed_div").hide();
                  $(".tabbed_div").eq(thisObj).fadeIn("slow");



                  return false;
               });


               /* END TABBED BUTTONS SELECTED */

               /* Facybox */

               $('a[rel*=facybox]').facybox({
				        // noAutoload: true
				      });

				facyClicked=true;

				/*

               $('a[title="Email this page"]').live("click",function(){
                   jQuery.facybox({ ajax: $(this).attr("href")});
				    $("#facybox .body").css("background-color","#FFF");
				    $(".facybox_overlayBG").css("background-color","#000");
				    $("#facybox .w").css("visibility","visible");
				    $("#facybox .e").css("visibility","visible");
				    $("#facybox .s").css("visibility","visible");
				    $("#facybox .sw").css("visibility","visible");
				    $("#facybox .se").css("visibility","visible");
				    $("#facybox .n").css("visibility","visible");
				    $("#facybox .nw").css("visibility","visible");
					return false;
               });
               */


               // flash

               $('#druglifecycle').css("cursor","pointer").live("click",function(){


               $.facybox({ ajax: 'http://www.astrazeneca-annualreports.com/2009/flash/path.html' });

               $("#facybox").css("top","100px");
               $("#facybox").css("width","960px");
               //$("#facybox td").attr("class","");
               $('#facybox .close').css("right","-50px");
               return false;
               });

               /* End facybox */


/* Cross reference table */
  $("#crossref table tr").hover(
      function () { $(this).addClass("hover"); },
      function () { $(this).removeClass("hover"); }
    );


    // Call in notes

    $('div table tr td.numeric a').live("click",function(){
        
       
   $.get($(this).attr('href'),
   function(data){
    var returnedNote=data;
    var pos1=data.indexOf('<!--begin note-->');
    var pos2=data.indexOf('<!--end note-->');
    
    returnedNote=returnedNote.slice(pos1+17,pos2)
    $('div..new_note').remove();
    $('h3.ui-state-active').next('div').append('<div class="new_note">'+returnedNote+'</div>');
	$('.new_note').css('background-color','#f2f2f2').css('padding','7px').css('clear','both');
	$.scrollTo($('.new_note'), 800)
       });
       
        return false;
    });


    //end call in notes




});

$(document).ready(function(){
	$('#notes_nav ul').makeacolumnlists({cols:3,colWidth:0,equalHeight:false,startN:1});					   
});



// Back button remberance
/*$(window).unload(function() {


    if ($('#accordion').length>0){
        if ($('h3').hasClass('ui-state-active')){
             Pos=($('#accordion h3').index($('#accordion h3.ui-state-active')));
             _accordion='true';
        };
    } else {
       Pos=$(window).scrollTop();
       _accordion='false';
    };


   if (!$.cookie('COOKIE_URL1') && !$.cookie('COOKIE_URL2')){
  var COOKIE_URL1 =new Array(jQuery.url.attr("path"),_accordion,Pos);
                var options = { path: '/', expires: 30 };

                // set cookie by number of days

                    $.cookie('COOKIE_URL1', COOKIE_URL1, options);
                    $.cookie('COOKIE_URL2', "", options);


  }
  else if ($.cookie('COOKIE_URL1')!="" && $.cookie('COOKIE_URL2')==""){
      
      var COOKIE_URL2 =new Array(jQuery.url.attr("path"),_accordion,Pos);
                var options = { path: '/', expires: 30 };

                // set cookie by number of days

                    $.cookie('COOKIE_URL2', COOKIE_URL2, options);

  }
   else if ($.cookie('COOKIE_URL1')!="" && $.cookie('COOKIE_URL2')!=""){
       cook1=$.cookie('COOKIE_URL1');
       cook1=cook1.split(',');
       if (cook1[0]==jQuery.url.attr("path")){
        $(window).scrollTop(cook1[2]);

       };



      var COOKIE_URL1 =new Array(jQuery.url.attr("path"),_accordion,Pos);
                var options = { path: '/', expires: 30 };

                // set cookie by number of

                    $.cookie('COOKIE_URL2', '', options);
                    $.cookie('COOKIE_URL1', COOKIE_URL1, options);

 };

});
*/
 // End back button rememberance
 
 $(".full").click(function() {
  $(".dl1").attr("disabled", true);
  $(".dl2").attr("disabled", true);
  $(".dl3").attr("disabled", true);
  $(".dl4").attr("disabled", true);
  $(".dl5").attr("disabled", true);
  $(".dl6").attr("disabled", true);
  $(".dl7").attr("disabled", true);
  $(".dl8").attr("disabled", true);
  $(".dl9").attr("disabled", true);
  $(".dl10").attr("disabled", true);
  $(".dl11").attr("disabled", true);
  $(".dl12").attr("disabled", true);
  $(".dl13").attr("disabled", true);
  $(".dl14").attr("disabled", true);
  $(".dl15").attr("disabled", true);
  $(".dl16").attr("disabled", true);
  $(".dl17").attr("disabled", true);
  $(".dl18").attr("disabled", true);
  $(".dl19").attr("disabled", true);
  $(".dl20").attr("disabled", true);
  $(".dl21").attr("disabled", true);
  $(".dl22").attr("disabled", true);
  $(".dl23").attr("disabled", true);
  $(".dl24").attr("disabled", true);
  $(".dl25").attr("disabled", true);
  $(".dl26").attr("disabled", true);
}); 
