	$(function(){
	
		// IE child fix
		if ( $.browser.msie ) {		
			$("div.articles table tr td:first-child").addClass('first-child');
			$("div.articles table tr td:last-child").addClass('last-child');	
			$("ul.b-news li:last-child").addClass('last-child');
			$("div.b-submenu ul li:last-child").addClass('last-child');
			$("div.b-leftmenu ul li:last-child").addClass('last-child');
			$("div.b-menu-shadow").css('position','absolute');
		}
		
		// Menu
		
		/*$('div.b-submenu').hover( function() {
			$(this).children('div.b-mark-block').css('display','block');
			$(this).children('table').css('display','');			
		}, function() {
			$(this).children('div.b-mark-block').css('display','none');
			$(this).children('table').css('display','none');
		});*/
		
		$('div.b-mark-logo-h').hover( function() {
			$(this).children('a').children('span').css('display','none');
			$(this).children('a').children('span.b-mark-logo-h').css('display','block');			
		}, function() {
			$(this).children('a').children('span').css('display','block');
			$(this).children('a').children('span.b-mark-logo-h').css('display','none');	
		});
		
		// Model
		
		$('div.b-model-passive').hover( function() {
			$(this).children('a').children('span.b-picture-title').css('display','block');
			$(this).children('a').children('span.b-picture-shadow').css('display','block');			
		}, function() {
			$(this).children('a').children('span.b-picture-title').css('display','none');
			$(this).children('a').children('span.b-picture-shadow').css('display','none');
		});
		
		// Callback
		
		$('div.button-call a').click( function() {
			$('div.window-background').css('height',$(document).height()+'px');
			$('div.window-block').css('top',$(window).height()/2-153+'px');
			
			$('div.b-window').css('display','block');
			$('#callback').show();
			$('#callback-complete').hide();
			$('body').css('overflow','hidden');
			$('div.b-window > div.window-block > div.window-close, div.b-window > div.window-background').click(function(){
				$('div.b-window').css('display','none');
				$('body').css('overflow','visible');
			});
			return false;
		});
		
		settings = '[{"width":240,"height":45,"x":0,"y":10,"font":"FreeSetC","fontsize":18,"timer":4,"xml":"/design/flash/banner/1/settings.xml"}]';
		phrases= '[{"phrase":"Service ALL-IN-ONE","color":"#FF3737"},{"phrase":"Кузовной ремонт","color":"#FFFFFF"},{"phrase":"Техобслуживание","color":"#FFFFFF"},{"phrase":"Ремонт","color":"#FFFFFF"},{"phrase":"Беcконтактная мойка","color":"#FFFFFF"},{"phrase":"Химчистка","color":"#FFFFFF"},{"phrase":"Оригинальные запчасти","color":"#FFFFFF"},{"phrase":"Шиномонтаж","color":"#FFFFFF"}]';
		var link = '/hot.html';
		var bg = '/design/images/banner/2/bg_240_b.png';
		
		$('#aio').flash({
				swf: '/design/flash/banner/1/banner.swf',
				width: 240,
				height: 45,
				hasVersion: 10,
				allowscriptaccess: 'always',
				wmode: 'transparent',
				
				flashvars: {
					phrases: phrases,
					settings: settings,
					link: link,
					bg: bg
				}
		});
		
	});
	
	function clear_form(a)
	{			
		if(!a.haschanged)
		{
			a.value="";				
			a.haschanged = true;
		}							
	}
