$(document).ready(function(){

$(".roll").hover(
	function() {
		$(this).not(".rollhi").attr("src", $(this).attr("src").split('off').join('on'));
	}, 
	function(){
		$(this).not(".rollhi").attr("src", $(this).attr("src").split('on').join('off'))
	}
);


$.preloadImages = function() {
var a = (typeof arguments[0] == 'object')? arguments[0] : arguments;
	for(var i = a.length -1; i > 0; i--) {
			$("<img>").attr("src", a[i]);
	}
}

var images = [];
$('.roll').each(function(){
    images.push($(this).html());
});

$.preloadImages(images);


var currentFontSize = $('body').css('font-size');
var currentFontSizeNum = parseFloat(currentFontSize, 10);

// Increase Font Size
$(".bigsize").click(function(){
	var newFontSize = currentFontSizeNum*1.1;
	currentFontSizeNum = newFontSize;
	$('#contentcolr *').css('font-size', newFontSize);
	$('#contentfull *').css('font-size', newFontSize);
	$('.topbuyhire *').css('font-size', newFontSize);
	$('.topnews *').css('font-size', newFontSize);
	return false;
});

// Decrease Font Size
$(".lowsize").click(function(){
	var newFontSize = currentFontSizeNum*0.9;
	currentFontSizeNum = newFontSize;
	$('#contentcolr *').css('font-size', newFontSize);
	$('#contentfull *').css('font-size', newFontSize);
	$('.topbuyhire *').css('font-size', newFontSize);
	$('.topnews *').css('font-size', newFontSize);
	return false;
});





var options = { 
		clearForm: true,
		beforeSubmit:  showRequest,  // pre-submit callback 
		success:       showResponse  // post-submit callback 
}; 

// bind form using 'ajaxForm' 
$('#enewsform').ajaxForm(options); 




function showRequest(formData, jqForm, options) { 
    var queryString = $.param(formData); 
    return true; 
} 
 
// post-submit callback 
function showResponse(responseText, statusText)  { 
  alert(responseText);
} 



});

jQuery.fn.idle = function(time) {
      var o = $(this);
      o.queue(function()
      {
         setTimeout(function()
         {
            o.dequeue();
         }, time);
      });
      return this;   
}

function rollhi(hi) {
	var on = $('.' + hi);
	$(on).attr("src", $(on).attr("src").split('off').join('on'));
	$(on).addClass("rollhi");
}

