// VARIABLES

var navlilength =null;
var oddevenvar =null;
var tabsindexcount =null;
var maincontentheight=null;
function isEven(value){
	if (value%2 == 0)
		return '-';
	else
		return '';
}

function switchoddeven(value){
	
if(value=='-')
return '';
else 
return '-';
};


$(document).ready(function(){




/*SLIGHTLY HIDE ACCESS2 SIDE-NAVIGATION WHEN MAIN NAVIGATION SUB NAV APPEARS*/
if($.browser.version !=7.0){
$('#access ul li:first-child, #access ul li:nth-child(2)').not(' #access ul ul li').hover(function(){
$('#access2').css({'opacity':'0.4'});

});

$('#access ul li:first-child, #access ul li:nth-child(2)').not(' #access ul ul li').mouseleave(function(){
$('#access2').css({'opacity':'1','overflow':'visible'});
});
}

/* RANDOM SLOPING ON MAIN NAVIGATION (ACCESS) */


navlilength = $('#access ul').find('li').not('ul ul li').length;
for(i=0;i<navlilength;i++){
var rr =Math.floor(Math.random()*11);
var oddevenvar = isEven(rr);
$('#access ul li:nth-child('+i+')').not('#access ul ul li').css({'-moz-transform':'rotate('+oddevenvar+'1.'+ rr +'deg)'});
$('#access ul li:nth-child('+i+')').not('#access ul ul li').css({'transform':'rotate('+oddevenvar+'1.'+ rr +'deg)'});
$('#access ul li:nth-child('+i+')').not('#access ul ul li').css({'-webkit-transform':'rotate('+oddevenvar+'1.'+ rr +'deg)'});
$('#access ul li:nth-child('+i+')').not('#access ul ul li').css({'-webkit-transform':'rotate('+oddevenvar+'1.'+ rr +'deg)'});



$('#access ul ul').css({'-moz-transform':'rotate(0deg)'});
$('#access ul ul').css({'-webkit-transform':'rotate(0deg)'});

};


/* STAGGERED SIDE NAVIGATION(ACCESS 2) */

navlilength2 = $('#access2 ul li').length;
for(a=0;a<navlilength2;a++){
	var rr2 =Math.floor(Math.random()*11);
	var rr2andb =Math.floor(Math.random()*10);
	var access2width =$('#access2 ul li').width();
$('#access2 ul li:eq('+a+')').css({'padding-left':'1'+rr2andb+'px','position':'relative','left':'-'+rr2+'.0px'});

};


/* back button */

	$('.backpage').show();
$('.backpage').click(function(event){
	
	event.preventDefault();
	
	parent.history.back();
	
	});



});
//END DOCUMENT READY

