



/*
 * ################ START BASE START ################ 
 */

/**********************
 * Base JS 
 **********************/

function bubble(){
	$$('a[rel=bubble]').each(function(element){
		element.observe('mouseout',function(){
			$('sympton_content_'+element.getAttribute('see')).removeClassName('show');
			$('sympton_content_'+element.getAttribute('see')).addClassName('hide');
		});
		element.observe('mouseover',function(){
			$('sympton_content_'+element.getAttribute('see')).removeClassName('hide');
			$('sympton_content_'+element.getAttribute('see')).addClassName('show');
		});
	});
}

Event.observe(window, 'load', function(){
	if($('mainpage_symptons') && $('module_mainpage')){
		$('mainpage_symptons').observe('change', function(){
			window.location='/tunetek/'+$F('mainpage_symptons');
		});
	}

	$$('.search_submit_sympton a').each(function(element){
		element.observe('click',function(){
			console.log($('search_sympton_form'));
			$('search_sympton_form').submit();
		});
	});

	$$('.search_submit_disease a').each(function(element){
		element.observe('click',function(){
			console.log($('search_disease_form'));
			$('search_disease_form').submit();
		});
	});
	
	$$('#my_symptons a.restore').each(function(element){
		element.observe('click',function(){
			var reg_exp = '/'+element.getAttribute('url_part');
			var url = document.location.pathname.replace(reg_exp, '');
			if(url=='/tunetek/') url='/';
			window.location=url;
		});
	});
	//window.location(document.location.pathname.replace(/laz\//g, ''));

	bubble();

});

/*
 * ################ END BASE END ################ 
 */




