jQuery(document).ready(function()
{
	MainMyOwnBossCA.init ();
	MainMyOwnBossCA.rotateAds();
});

var MainMyOwnBossCA = {
	ad_timer : 7000,
	ad_count : 0,
	ad_timeout_id : -1,

	init : function()
	{
		var input = jQuery("form#searchform input[name='s']");

		input.bind('focus', function(e)
		{
			if (!jQuery(this).attr('visited'))
				this.value = '';

			jQuery(this).attr('visited', true);
		});

		input.bind('blur', function(e)
		{
			if (this.value == '')
			{
				this.value = 'Search';
				jQuery(this).removeAttr('visited');
			}
		});
	},
	
	rotateAds : function() 
	{
        if (jQuery('#rotating-big-ads').get(0))
		{
			MainMyOwnBossCA.ad_timeout_id = window.setTimeout("MainMyOwnBossCA.ad_rotate()", MainMyOwnBossCA.ad_timer);
		}
	},
	
	ad_rotate : function() 
	{
		if (++MainMyOwnBossCA.ad_count > 2)
			MainMyOwnBossCA.ad_count = 0;
			
		jQuery("#rotating-big-ads .big-box, #rotating-big-ads2 .big-box").hide();
		jQuery("#rotating-big-ads .big-box").eq(MainMyOwnBossCA.ad_count).show();
		jQuery("#rotating-big-ads2 .big-box").eq(MainMyOwnBossCA.ad_count).show();
		
		MainMyOwnBossCA.ad_timeout_id = setTimeout ("MainMyOwnBossCA.ad_rotate()", MainMyOwnBossCA.ad_timer);
	}
	
}


