$(document).ready(function(){
	
	//$('#pageContent').load("pages/topnews.htm");
	
	$('.head .emboss').each(function() {
			emboss(this, '#000000');
		});
	
	$('.menu .emboss').each(function() {
		emboss(this, '#7379e7');
	});
	
	$('.navbar a')
		.css( {backgroundPosition: "6px 10px"} )
		.mouseover(function(){
			$(this).stop().animate({/*backgroundColor:"#c0cdef",*/backgroundPosition:"(9px 10px)"}, 200)
		})
		.mouseout(function(){
			$(this).stop().animate({/*backgroundColor:"#cdd9f8",*/backgroundPosition:"(6px 10px)"}, 250)
		})
		.click( function() {
			$('.navbar a').css( {fontWeight: "normal"} );
			$(this).css( {fontWeight: "bold"} );
		})
	
	$('.menu a')
		.css( {backgroundPosition: "0px 0px"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0px -10px)"}, {duration:400})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0px 0px)"}, {duration:500})
		})
	
});

emboss = function(el,color) {
	$(el).append("<span class='embossed' style='color:" + color + "'>" + el.innerHTML + "</span>");
}

pageLoad = function(param) {
	$('.navbar div[id!=""]').hide();
	$('.section img').remove();
	$('#pageContent *').remove();
	$('.section').append('<img src="frontend/images/black/' + param + '.png" />');
	$('.section img').css( {opacity: "0"} );
	$('.navbar').stop().animate({width:'0px'},900,'linear',function() {$('#pageContent').css({paddingLeft:'20px'});} );
	$('.section img').stop().animate({opacity:'1'},1000,
		function() {
			$('.navbar div[id=' + param + ']').parent().stop().animate({width:'125px'},500,'linear',function() {$('#pageContent').css({paddingLeft:'130px'});} );
			$('.navbar div[id!=""]').hide();
			$('.navbar a').css( {fontWeight: "normal"} );
			$('.navbar div[id=' + param + ']').show();
			$($('.navbar div[id=' + param + ']').children()[0]).css( {fontWeight: "bold"} );
		});
}

nav = function(param,i) {
	$('#pageContent').css({background:'url(frontend/images/black/ajax-loader.gif) center no-repeat'});
	setTimeout( function() { $('#pageContent').load("frontend/pages/" + param + ".htm", function() { $('#pageContent').css({background:'none'}); } ) }, i);
	document.getElementById('PageHeading').style.display = '';
	$('#awards').hide();
	/*$('#push-container').css({height:'60px'});*/
}

 get = function(param,i, handler) {
	//$('#pageContent').css({background:'url(frontend/images/black/ajax-loader.gif) center no-repeat'});
	setTimeout( function() { $('#pageContent').load("frontend/" + param + ".php", function() { if(typeof(handler) == 'function') {handler();} $('#pageContent').css({background:'none'}); } ) }, i);
	document.getElementById('PageHeading').style.display = '';
}

function popup(url) {
	var params;
	params = 'width=' + document.body.clientWidth + ',height=' + document.body.clientHeight + ',scrollbars=1,resizable=1';
	window.open(url,'mywindow',params);
}

function showAwards() {
	$('#awards').show();
}
