var HISTORY = [];
HISTORY['timer'];
HISTORY['quick'] = 1;
HISTORY['mouse'] = '';

jQuery.system = {
	quick : function(object)
	{
		if(object)
		{
			clearInterval(HISTORY['timer']);
			HISTORY['quick'] = object;
		}
		else
		{
			HISTORY['quick']++;
			if(HISTORY['quick'] > 3) HISTORY['quick'] = 1;
		}
		$('.quick').css('display', 'none');
		$('#i_quick0' + HISTORY['quick']).css('display', 'block');
		if(object) HISTORY['timer'] = setInterval('$.system.quick()', 3000);
		return;
	},
	timer : function()
	{
		HISTORY['timer'] = setInterval('$.system.quick()', 3000);
		return;
	},
	mouse : function(action, object)
	{
		if(object != HISTORY['mouse'])
		{
			if(action == 'show') $('#' + object).attr('src', $('#' + object).attr('src').replace('off_', 'on_'));
			if(action == 'hide') $('#' + object).attr('src', $('#' + object).attr('src').replace('on_', 'off_'));
		}
		return;
	},
	photo : function(object)
	{
		$('.slide').css('display', 'none');
		$('#slide_' + object).css('display', 'block'); 
		$('.frame').css('border', '1px solid #E1E1E1');
		$('#frame_' + object).css('border', '1px solid #C8CDDC');
		$('.title').css('color', '#333333');
		$('#title_' + object).css('color', '#0066CC');
		return;
	}
};

$(document).ready(function()
{
	$.each(location.search.substr(1).split('&'), function()
	{
		var array = this.split('=');
		if(array['0'] == 'type')
		{
			HISTORY['mouse'] = 'i_' + array['1'];
			$('#' + HISTORY['mouse']).attr('src', $('#' + HISTORY['mouse']).attr('src').replace('off_', 'on_'));
		}
	});
	if(!HISTORY['mouse']) $.system.timer();
});
