﻿$(function(){
	$('img[class^="btn_o"], input[type="image"][class^="btn_o"]').each(function(){
		var theImgType = $(this).attr('src').toString().match(/\.[a-z][a-z][a-z][a-z]?$/);
		var theExt = $(this).attr('class').toString().match(/btn_[a-zA-Z0-9]*/gi).toString().replace('btn', '');
		$(this).mouseover(function(){
			$(this).attr('src', $(this).attr('src').toString().replace(''+theImgType,''+theExt+theImgType));
	    }).mouseout(function(){
			$(this).attr('src', $(this).attr('src').toString().replace(''+theExt+theImgType,''+theImgType));
	    });
	});
});

$('#html_content img').ready(function(){
	$('#html_content img').each(function(){
		if(! this.complete){
		//	$(this).attr('src', domain);
		}
	});
});

$(document).ready(function(){
	$('#submenu > ul > li').hover(
		function(){
			$(this).css('background-color','#2b3034');
			$(this).children('a').css('color','#14a0dd');
			$(this).css('cursor','pointer');
		},
		function(){
			$(this).css('background-color','#959595');
			$(this).children('a').css('color','#ffffff');
			$(this).css('cursor','default');
		}
		
	);
	
	$('#submenu > ul > li').click(function(){
		window.location = $(this).children('a').attr('href');	
	});
	
	$('.topMenu > li').hover(
		function(){
			
			$(this).find('#submenu').stop(true,true).fadeIn(300);
			$(this).css('cursor','pointer');
		},
		function(){
			
			$(this).find('#submenu').fadeOut(300);
			$(this).css('cursor','default');
		}
	);
});
