// IE Warning // 
$(function() {
	if (jQuery.browser.msie) {
		var ver = $.browser.version;
		if(ver < 8) {
			var msg = '<b>*You are using an old web browser!</b><br>To view the site properly you might need to <a style="color:#000" href="http://www.microsoft.com/windows/internet-explorer/default.aspx">upgrade Internet Explorer</a>, or preferably,<br>upgrade to a modern browser for better security and support for modern web standards.<br><a style="color:#000" href="http://www.getfirefox.com">Download Firefox</a> / <a style="color:#000" href="http://www.apple.com/safari/download/">Download Safari</a> / <a style="color:#000" href="http://www.opera.com/browser/download/">Download Opera</a> / <a style="color:#000" href="http://www.google.com/chrome/">Download Google Chrome</a><br><p>Thank you.</p>';
$('body').append('<div style="position: absolute; top:20px; right: 20px; color:#f00; font-size:11px; background:#ff6; padding:10px; z-index:999">'+msg+'</div>');
		}
	}
});


$(function() { 

  original = $('li.page_item a').css('color'); 

  $('li.page_item a, li.menu-item a').hover(function() { //mouseover 

var col = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')'; 

    $(this).animate({'color': col},500); 

  },function() { //mouseout 

    $(this).not('.current_page_item a').animate ({'color': original},3000); 
  	//$(this).animate ({'color': original},3000); 
  });
			
var col = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')'; 
       $('.current_page_item a').css({'color': col});
});

// Remove background image #full div if no image specified
$(function() { 
	var imgsrc = $('#full').attr('src');
	var imgcheck = imgsrc.length;
	if(imgcheck==0){
		$('#full').remove();
	} 
});

// Colour effect for iPad iPhone
$(function() {
	if (/iPhone|iPad/.test(navigator.userAgent)){
		$('li.page_item a').click(function(){
    		$('li.page_item a').each(function(){ 
var c2 = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')'; 			
				$(this).animate({"color": c2},500)
        		.delay(500)
        		.not('.current_page_item a')
        		.animate({"color": "#666"},500);
			});
		});

	}
});
