//----------------------------- Calculator Tax -------------------------------------

var taxRegion = 1;
var taxAutoType = 2;
var taxAutoTypeSize = 240;
var taxIsKw = false;
var taxCoef = 1;
var power = 0;

var taxAutoTypeMoscow = '<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(1, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Мотоцикл, мотороллер (категория А)' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(2, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Легковой автомобиль(категория В)' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(3, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Грузовой автомобиль(категория С) со сроком полезного использования не более 5 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(4, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Грузовой автомобиль(категория С) со сроком полезного использования свыше 5 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(5, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Автобус(категория D) со сроком полезного использования не более 5 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(6, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Автобус(категория D) со сроком полезного использования свыше 5 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(7, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Другое самоходное транспортное средство, машина или механизм' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(8, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Снегоход, мотосани' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(9, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Катер, моторная лодка или другое водное транспортное средство' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(10, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Яхта или другое парусно-моторное судно' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(11, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Гидроцикл' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(12, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Самолет, вертолет или иное воздушное судно, имеющее двигатель' +
						'</div>';

var taxAutoTypeMO = '<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(1, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Мотоцикл, мотороллер (категория А)' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(2, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Легковой автомобиль(категория В)' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(3, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Грузовой автомобиль(категория С) со сроком полезного использования не более 5 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(4, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Грузовой автомобиль(категория С) со сроком полезного использования свыше 5 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(5, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Автобус(категория D) со сроком полезного использования не более 5 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(6, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Автобус(категория D) со сроком полезного использования свыше 5 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(7, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Другое самоходное транспортное средство, машина или механизм' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(8, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Снегоход, мотосани' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(9, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Катер, моторная лодка или другое водное транспортное средство' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(10, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Яхта или другое парусно-моторное судно' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(11, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Гидроцикл' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(12, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Самолет, вертолет или иное воздушное судно, имеющее двигатель' +
						'</div>';

var taxAutoTypePiter = '<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(1, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Мотоцикл, мотороллер (категория А)' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(2, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Легковой автомобиль(категория В)' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(3, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Грузовой автомобиль(категория С)' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(5, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Автобус(категория D)' +
						'</div>';

var taxAutoTypeLO = '<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(1, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Мотоцикл, мотороллер (категория А)' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(2, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Легковой автомобиль(категория В)' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(3, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Грузовой автомобиль(категория С)' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(5, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Автобус(категория D)' +
						'</div>';	

var taxAutoTypeNovosib = '<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(1, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Легковой автомобиль(категория В) с возрастом не более 5 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(2, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Легковой автомобиль(категория В) с возрастом от 5 до 10 лет включительно' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(3, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Легковой автомобиль(категория В) с возрастом свыше 10 лет' +
						'</div>';							
						
var taxAutoTypeVladik = '<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(1, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Мотоцикл, мотороллер (категория А)' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(2, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Легковой автомобиль(категория В) с возрастом не более 3 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(3, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Легковой автомобиль(категория В) с возрастом свыше 3 до 10 лет включительно' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(4, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Легковой автомобиль(категория В) с возрастом свыше 10 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(5, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Грузовой автомобиль(категория С) с возрастом не более 3 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(6, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Грузовой автомобиль(категория С) с возрастом свыше 3 до 10 лет включительно' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(7, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Грузовой автомобиль(категория С) с возрастом свыше 10 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(8, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Автобус(категория D) с возрастом не более 3 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(9, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Автобус(категория D) с возрастом свыше 3 до 10 лет включительно' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(10, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Автобус(категория D) с возрастом свыше 10 лет' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(11, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Другое самоходное транспортное средство, машина или механизм' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(12, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Снегоход, мотосани' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(13, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Катер, моторная лодка или другое водное транспортное средство' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(14, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Яхта или другое парусно-моторное судно' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(15, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Гидроцикл' +
						'</div>' +
						'<div align="left" style="width:547px;height:14px;padding:3px 10px 3px 10px;background-image:none;background-repeat:repeat-x;font:normal 11px Verdana;cursor:hand;" onclick="changeTaxAutoType(16, this.innerHTML);" onmouseover="this.style.backgroundImage = \'url(images/content/calc/bg.gif)\';this.style.color = \'#FFFFFF\';" onmouseout="this.style.backgroundImage = \'none\';this.style.color = \'#000000\';">' +
							'Самолет, вертолет или иное воздушное судно, имеющее двигатель' +
						'</div>';						
						
function changeTaxRegion(value, label)
{
	var autoTypeContainer = document.getElementById('AutoType2List');
	
	document.getElementById('TaxRegion').innerHTML = label;
	taxRegion = value;
	
	switch (taxRegion) {
		case 1:
			taxAutoTypeSize = 240;
			autoTypeContainer.innerHTML = taxAutoTypeMoscow;
			taxAutoType = 2;
			document.getElementById('AutoType2').innerHTML = "Легковой автомобиль(категория В)";
			break;
		
		case 2:
			taxAutoTypeSize = 240;
			autoTypeContainer.innerHTML = taxAutoTypeMO;
			taxAutoType = 2;
			document.getElementById('AutoType2').innerHTML = "Легковой автомобиль(категория В)";
			break;
			
		case 3:	
			taxAutoTypeSize = 80;
			autoTypeContainer.innerHTML = taxAutoTypePiter;
			taxAutoType = 2;
			document.getElementById('AutoType2').innerHTML = "Легковой автомобиль(категория В)";
			break;
			
		case 4:	
			taxAutoTypeSize = 80;
			autoTypeContainer.innerHTML = taxAutoTypeLO;
			taxAutoType = 2;
			document.getElementById('AutoType2').innerHTML = "Легковой автомобиль(категория В)";
			break;	
		
		case 5:	
			taxAutoTypeSize = 60;
			autoTypeContainer.innerHTML = taxAutoTypeNovosib;
			taxAutoType = 1;
			document.getElementById('AutoType2').innerHTML = "Легковой автомобиль(категория В) с возрастом не более 5 лет";
			break;	
		
		case 6:	
			taxAutoTypeSize = 320;
			autoTypeContainer.innerHTML = taxAutoTypeVladik;
			taxAutoType = 2;
			document.getElementById('AutoType2').innerHTML = "Легковой автомобиль(категория В) с возрастом не более 3 лет";
			break;
		
		default:
			break;
	}
	
	floatyHiddener('TaxRegionList', 0, 120);
	//document.getElementById('TaxRegionListButton').src = 'images/content/calc/right2.gif';
}

function changeTaxAutoType(value, label)
{
	regionLabel = document.getElementById('AutoType2').innerHTML = label;
	taxAutoType = value;
	floatyHiddener('AutoType2List', 0, taxAutoTypeSize);
	//document.getElementById('AutoType2ListButton').src = 'images/content/calc/right2.gif';
}

function changePowerType(value, label)
{
	regionLabel = document.getElementById('PowerType').innerHTML = label;
	taxIsKw = (value == 1);
	floatyHiddener('PowerTypeList', 0, 280);
	//document.getElementById('PowerTypeListButton').src = 'images/content/calc/right2.gif';
}

function countTax()
{
	switch (taxRegion) {
		case 1:
			countTaxMoscow();
			break;
		
		case 2:
			countTaxMO();
			break;
		
		case 3:
			countTaxPiter();
			break;
		
		case 4:
			countTaxLO();
			break;
		
		case 5:
			countTaxNovosib();
			break;
		
		case 6:
			countTaxVladik();
			break;
			
		default:
			countTaxMoscow();
			break;
	}
}

function countTaxMoscow()
{
	power = document.getElementById('PowerValue').value - 0;
	if (taxIsKw) power = 1.36 * power;
	
	switch (taxAutoType) {
		case 1: 
			if (power <= 20) taxCoef = 7;
			if ((power > 20) && (power <= 35)) taxCoef = 15;
			if (power > 35) taxCoef = 50;
			break;
			
		case 2:
			if (power <= 100) taxCoef = 7;
			if ((power > 100) && (power <= 125)) taxCoef = 20;
			if ((power > 125) && (power <= 150)) taxCoef = 30;
			if ((power > 150) && (power <= 175)) taxCoef = 38;
			if ((power > 175) && (power <= 200)) taxCoef = 45;
			if ((power > 200) && (power <= 225)) taxCoef = 60;
			if ((power > 225) && (power <= 250)) taxCoef = 75;
			if (power > 250) taxCoef = 150;
			break;
			
		case 3: 
			if (power <= 100) taxCoef = 10;
			if ((power > 100) && (power <= 150)) taxCoef = 17;
			if ((power > 150) && (power <= 200)) taxCoef = 25;
			if ((power > 200) && (power <= 250)) taxCoef = 35;
			if (power > 250) taxCoef = 45;
			break;
			
		case 4: 
			if (power <= 100) taxCoef = 15;
			if ((power > 100) && (power <= 150)) taxCoef = 26;
			if ((power > 150) && (power <= 200)) taxCoef = 38;
			if ((power > 200) && (power <= 250)) taxCoef = 55;
			if (power > 250) taxCoef = 70;
			break;
			
		case 5: 
			if (power <= 110) taxCoef = 10;
			if ((power > 110) && (power <= 200)) taxCoef = 17;
			if (power > 200) taxCoef = 35;
			break;
			
		case 6: 
			if (power <= 110) taxCoef = 15;
			if ((power > 110) && (power <= 200)) taxCoef = 26;
			if (power > 200) taxCoef = 55;
			break;
			
		case 7: 
			taxCoef = 20;
			break;
		
		case 8: 
			if (power <= 50) taxCoef = 25;
			if (power > 50) taxCoef = 50;
			break;
			
		case 9: 
			if (power <= 100) taxCoef = 50;
			if (power > 100) taxCoef = 100;
			break;
			
		case 10: 
			if (power <= 100) taxCoef = 100;
			if (power > 100) taxCoef = 200;
			break;
			
		case 11: 
			if (power <= 100) taxCoef = 125;
			if (power > 100) taxCoef = 250;
			break;
			
		case 12: 
			taxCoef = 100;
			break;
		
		default: break;
	};
	
	document.getElementById('TaxResult').innerHTML = Math.round(taxCoef * power) + " рублей";
}

function countTaxMO()
{
	power = document.getElementById('PowerValue').value - 0;
	if (taxIsKw) power = 1.36 * power;
	
	switch (taxAutoType) {
		case 1: 
			if (power <= 20) taxCoef = 8;
			if ((power > 20) && (power <= 35)) taxCoef = 14;
			if (power > 35) taxCoef = 46;
			break;
			
		case 2:
			if (power <= 100) taxCoef = 7;
			if ((power > 100) && (power <= 150)) taxCoef = 29;
			if ((power > 150) && (power <= 200)) taxCoef = 43;
			if ((power > 200) && (power <= 250)) taxCoef = 72;
			if (power > 250) taxCoef = 143;
			break;
			
		case 3: 
			if (power <= 100) taxCoef = 17;
			if ((power > 100) && (power <= 150)) taxCoef = 22;
			if ((power > 150) && (power <= 200)) taxCoef = 28;
			if ((power > 200) && (power <= 250)) taxCoef = 39;
			if (power > 250) taxCoef = 50;
			break;
			
		case 4: 
			if (power <= 100) taxCoef = 22;
			if ((power > 100) && (power <= 150)) taxCoef = 29;
			if ((power > 150) && (power <= 200)) taxCoef = 36;
			if ((power > 200) && (power <= 250)) taxCoef = 51;
			if (power > 250) taxCoef = 65;
			break;
		
		case 5: 
			if (power <= 200) taxCoef = 24;
			if (power > 200) taxCoef = 48;
			break;
			
		case 6: 
			if (power <= 200) taxCoef = 29;
			if (power > 200) taxCoef = 57;
			break;
			
		case 7: 
			taxCoef = 18;
			break;
		
		case 8: 
			if (power <= 50) taxCoef = 28;
			if (power > 50) taxCoef = 55;
			break;
			
		case 9: 
			if (power <= 100) taxCoef = 55;
			if (power > 100) taxCoef = 110;
			break;
			
		case 10: 
			if (power <= 100) taxCoef = 110;
			if (power > 100) taxCoef = 220;
			break;
			
		case 11: 
			if (power <= 100) taxCoef = 138;
			if (power > 100) taxCoef = 275;
			break;
			
		case 12: 
			taxCoef = 110;
			break;
		
		default: break;
	};
	
	document.getElementById('TaxResult').innerHTML = Math.round(taxCoef * power) + " рублей";
}

function countTaxPiter()
{
	power = document.getElementById('PowerValue').value - 0;
	if (taxIsKw) power = 1.36 * power;
	
	switch (taxAutoType) {
		case 1: 
			if (power <= 20) taxCoef = 10;
			if ((power > 20) && (power <= 35)) taxCoef = 20;
			if (power > 35) taxCoef = 50;
			break;
			
		case 2:
			if (power <= 100) taxCoef = 24;
			if ((power > 100) && (power <= 150)) taxCoef = 35;
			if ((power > 150) && (power <= 200)) taxCoef = 50;
			if ((power > 200) && (power <= 250)) taxCoef = 75;
			if (power > 250) taxCoef = 150;
			break;
			
		case 3: 
			if (power <= 100) taxCoef = 25;
			if ((power > 100) && (power <= 150)) taxCoef = 40;
			if ((power > 150) && (power <= 200)) taxCoef = 50;
			if ((power > 200) && (power <= 250)) taxCoef = 55;
			if (power > 250) taxCoef = 65;
			break;
			
		case 4: 
			if (power <= 200) taxCoef = 50;
			if (power > 200) taxCoef = 65;
			break;
		
		default: break;
	};
	
	document.getElementById('TaxResult').innerHTML = Math.round(taxCoef * power) + " рублей";
}

function countTaxLO()
{
	power = document.getElementById('PowerValue').value - 0;
	if (taxIsKw) power = 1.36 * power;
	
	switch (taxAutoType) {
		case 1: 
			if (power <= 20) taxCoef = 8;
			if ((power > 20) && (power <= 35)) taxCoef = 20;
			if (power > 35) taxCoef = 50;
			break;
			
		case 2:
			if (power <= 100) taxCoef = 14;
			if ((power > 100) && (power <= 150)) taxCoef = 30;
			if ((power > 150) && (power <= 200)) taxCoef = 50;
			if ((power > 200) && (power <= 250)) taxCoef = 75;
			if (power > 250) taxCoef = 150;
			break;
			
		case 3: 
			if (power <= 100) taxCoef = 25;
			if ((power > 100) && (power <= 150)) taxCoef = 40;
			if ((power > 150) && (power <= 200)) taxCoef = 50;
			if ((power > 200) && (power <= 250)) taxCoef = 55;
			if (power > 250) taxCoef = 65;
			break;
			
		case 4: 
			taxCoef = 40;
			break;
		
		default: break;
	};
	
	document.getElementById('TaxResult').innerHTML = Math.round(taxCoef * power) + " рублей";
}

function countTaxNovosib()
{
	power = document.getElementById('PowerValue').value - 0;
	if (taxIsKw) power = 1.36 * power;
	
	switch (taxAutoType) {
		case 1: 
			if (power <= 100) taxCoef = 6;
			if ((power > 100) && (power <= 150)) taxCoef = 10;
			if ((power > 150) && (power <= 200)) taxCoef = 30;
			if ((power > 200) && (power <= 250)) taxCoef = 60;
			if (power > 250) taxCoef = 150;
			break;
			
		case 2:
			if (power <= 100) taxCoef = 6;
			if ((power > 100) && (power <= 150)) taxCoef = 10;
			if ((power > 150) && (power <= 200)) taxCoef = 22.5;
			if ((power > 200) && (power <= 250)) taxCoef = 45;
			if (power > 250) taxCoef = 112.5;
			break;
			
		case 3: 
			if (power <= 100) taxCoef = 6;
			if ((power > 100) && (power <= 150)) taxCoef = 10;
			if ((power > 150) && (power <= 200)) taxCoef = 15;
			if ((power > 200) && (power <= 250)) taxCoef = 30;
			if (power > 250) taxCoef = 75;
			break;
		
		default: break;
	};
	
	document.getElementById('TaxResult').innerHTML = Math.round(taxCoef * power) + " рублей";
}

function countTaxVladik()
{
	power = document.getElementById('PowerValue').value - 0;
	if (taxIsKw) power = 1.36 * power;
	
	switch (taxAutoType) {
		case 1: 
			if (power <= 20) taxCoef = 5;
			if ((power > 20) && (power <= 35)) taxCoef = 10;
			if (power > 35) taxCoef = 20;
			break;
		
		///////////////////////////////////////
		
		case 2:
			if (power <= 100) taxCoef = 15;
			if ((power > 100) && (power <= 150)) taxCoef = 20;
			if ((power > 150) && (power <= 200)) taxCoef = 30;
			if ((power > 200) && (power <= 250)) taxCoef = 75;
			if (power > 250) taxCoef = 100;
			break;
		
		case 3:
			if (power <= 100) taxCoef = 7;
			if ((power > 100) && (power <= 150)) taxCoef = 12;
			if ((power > 150) && (power <= 200)) taxCoef = 20;
			if ((power > 200) && (power <= 250)) taxCoef = 30;
			if (power > 250) taxCoef = 75;
			break;
			
		case 4:
			if (power <= 100) taxCoef = 5;
			if ((power > 100) && (power <= 150)) taxCoef = 7;
			if ((power > 150) && (power <= 200)) taxCoef = 10;
			if ((power > 200) && (power <= 250)) taxCoef = 12;
			if (power > 250) taxCoef = 30;
			break;	
		
		/////////////////////////////////
		
		case 5: 
			if (power <= 100) taxCoef = 25;
			if ((power > 100) && (power <= 150)) taxCoef = 35;
			if ((power > 150) && (power <= 200)) taxCoef = 40;
			if ((power > 200) && (power <= 250)) taxCoef = 45;
			if (power > 250) taxCoef = 50;
			break;
			
		case 6: 
			if (power <= 100) taxCoef = 15;
			if ((power > 100) && (power <= 150)) taxCoef = 25;
			if ((power > 150) && (power <= 200)) taxCoef = 30;
			if ((power > 200) && (power <= 250)) taxCoef = 30;
			if (power > 250) taxCoef = 40;
			break;
		
		case 7: 
			if (power <= 100) taxCoef = 8;
			if ((power > 100) && (power <= 150)) taxCoef = 10;
			if ((power > 150) && (power <= 200)) taxCoef = 20;
			if ((power > 200) && (power <= 250)) taxCoef = 20;
			if (power > 250) taxCoef = 30;
			break;
			
		/////////////////////////////////////////
		
		case 8: 
			if (power <= 200) taxCoef = 20;
			if (power > 200) taxCoef = 25;
			break;
			
		case 9: 
			if (power <= 200) taxCoef = 15;
			if (power > 200) taxCoef = 20;
			break;
		
		case 10: 
			if (power <= 200) taxCoef = 10;
			if (power > 200) taxCoef = 15;
			break;
		
		/////////////////////////////////////////
		
		case 11: 
			taxCoef = 10;
			break;
		
		case 12: 
			if (power <= 50) taxCoef = 5;
			if (power > 50) taxCoef = 10;
			break;
			
		case 13: 
			if (power <= 100) taxCoef = 40;
			if (power > 100) taxCoef = 80;
			break;
			
		case 14: 
			if (power <= 100) taxCoef = 80;
			if (power > 100) taxCoef = 120;
			break;
			
		case 15: 
			if (power <= 100) taxCoef = 100;
			if (power > 100) taxCoef = 100;
			break;
			
		case 16: 
			taxCoef = 30;
			break;
		
		default: break;
	};
	
	document.getElementById('TaxResult').innerHTML = Math.round(taxCoef * power) + " рублей";
}

function taxShowCoefs()
{
	alert(power + " Л.С. \n\r" + taxCoef + " рублей за каждую Л.С.");
	document.getElementById('TaxResultCoef').style.visibility = "visible";
}

//------------------------------ Calculator Osago -----------------------------------

var coef0 = 2;
var coef1 = 1980;
var coef2 = 1.7;
var coef3 = 0.6;
var coef4 = 1;

function changeCoef0(value, label)
{
	regionLabel = document.getElementById('RegionName').innerHTML = label;
	coef0 = value;
	floatyHiddener('RegionNameList', 0, 120);
	//document.getElementById('RegionNameListButton').src = 'images/content/calc/right2.gif';

}

function changeCoef1(value, label)
{
	regionLabel = document.getElementById('AutoType').innerHTML = label;
	coef1 = value;
	floatyHiddener('AutoTypeList', 0, 280);
	//document.getElementById('AutoTypeListButton').src = 'images/content/calc/right2.gif';

}

function changeCoef2(value, label)
{
	regionLabel = document.getElementById('DriverType').innerHTML = label;
	coef2 = value;
	floatyHiddener('DriverTypeList', 0, 100);
	//document.getElementById('DriverTypeListButton').src = 'images/content/calc/right2.gif';

}

function changeCoef3(value, label)
{
	regionLabel = document.getElementById('EngineType').innerHTML = label;
	coef3 = value;
	floatyHiddener('EngineTypeList', 0, 120);
	//document.getElementById('EngineTypeListButton').src = 'images/content/calc/right2.gif';

}

function changeCoef4(value, label)
{
	regionLabel = document.getElementById('BonusType').innerHTML = label;
	coef4 = value;
	floatyHiddener('BonusTypeList', 0, 320);
	//document.getElementById('BonusTypeListButton').src = 'images/content/calc/right2.gif';

}

function countOsago()
{
	document.getElementById('OsagoResult').innerHTML = Math.round(coef0*coef1*coef2*coef3*coef4) + " рублей";
	document.getElementById('OsagoResultCoef').style.visibility = "visible";
}

function osagoShowCoefs()
{
	alert("Базовая ставка: " + coef1 + "\r\n" + 
		  "Региональный множитель: " + coef0 + "\r\n" + 
		  "Возраст и стаж: " + coef2 + "\r\n" + 
		  "Мощность двигателя: " + coef3 + "\r\n" + 
		  "Бонусный/Малусный класс: " + coef4);
}

//-------------------------- Google Maps ----------------------------------------

var moscowContactsHTML = 
"<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">" + 
	"<tr><td align=\"left\" width=\"100%\" colspan=\"2\" style=\"padding:5px 0px 10px 11px;font:italic 15px Georgia;color:#B60019;\">Адрес: г. Москва, ул. Б. Черемушкинская, д.21</td></tr>" + 
	"<tr style=\"background-color:#d5d5d5\"><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\"><nobr>+7 (495) 788-77-82</nobr><br /><b>(Многоканальный)</b></td><td align=\"left\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\"><nobr>+7 (495) 971-14-83 </nobr><br /><nobr><b>(Обслуживание и ремонт автомобилей)</b></nobr></td></tr>" +
	"<tr><td align=\"left\" width=\"100%\" colspan=\"2\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;white-space:normal;\"><b>Как добраться на метро:</b><br />м. \"Академическая\", первый вагон из центра, из стеклянных дверей налево, по лестнице - налево, затем на первом перекрестке повернуть направо и далее - порядка 10 минут пешком. На трамвайных путях направо и за вторым домом по левую руку - повернуть налево.</td></tr>" +
	"<tr style=\"background-color:#d5d5d5\"><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\"><nobr><b>График работы:</b></nobr><br /><nobr>Ежедневно</nobr><br /><nobr>c 10:00 до 20:00</nobr></td><td align=\"left\" valign=\"middle\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\"><b>E-mail: info@podborauto.ru</b></td></tr>" +
"</table>";
								
var piterContactsHTML = 
"<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">" +
"<tr><td align=\"left\" width=\"100%\" colspan=\"2\" style=\"padding:5px 0px 10px 11px;font:italic 15px Georgia;color:#B60019;\">Адрес: г. Санкт Петербург, Васильевский Остров, Малый проспект, д.60</td></tr>"+
"<tr style=\"background-color:#d5d5d5\"><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\"><nobr>+7 (812) 313-24-81</nobr></td><td align=\"left\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\"></td></tr>" +
"<tr><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\"><nobr><b>График работы:</b></nobr><br /><nobr>Понедельник - Суббота</nobr><br /><nobr>c 10:00 до 20:00</nobr></td><td align=\"left\" valign=\"middle\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\"><b>E-mail: piter@podborauto.ru</b></td></tr>" +
"</table>";

var novosibContactsHTML = 
"<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">" +
"<tr><td align=\"left\" width=\"100%\" colspan=\"2\" style=\"padding:5px 0px 10px 11px;font:italic 15px Georgia;color:#B60019;\">Ищем представителя в Вашем регионе. <a href=\"regions.html\"><u><b>Подробнее ></b></u></a></td></tr>" +
"<tr style=\"background-color:#d5d5d5\"><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\">&nbsp;</td><td align=\"left\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\"></td></tr>" +
"<tr><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\">&nbsp;</td><td align=\"left\" valign=\"middle\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\">&nbsp;</td></tr>" +
"</table>";

var vladikContactsHTML = 
"<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">" +
"<tr><td align=\"left\" width=\"100%\" colspan=\"2\" style=\"padding:5px 0px 10px 11px;font:italic 15px Georgia;color:#B60019;\">Адрес: г. Владивосток, пр-т 100 лет Владивостоку, д.33</td></tr>" +
"<tr style=\"background-color:#d5d5d5\"><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\"><nobr>+7 (4232) 360-095</nobr></td><td align=\"left\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\"></td></tr>" +
"<tr><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\"><nobr><b>График работы:</b></nobr><br /><nobr>Понедельник - Суббота</nobr><br /><nobr>c 10:00 до 20:00</nobr></td><td align=\"left\" valign=\"middle\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\"><b>E-mail: novosib@podborauto.ru</b></td></tr>" +
"</table>";

var irkutskContactsHTML = 
"<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">" +
"<tr><td align=\"left\" width=\"100%\" colspan=\"2\" style=\"padding:5px 0px 10px 11px;font:italic 15px Georgia;color:#B60019;\">Адрес: г. Иркутск, ул. Красноярская, 53, офис 41</td></tr>" +
"<tr style=\"background-color:#d5d5d5\"><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\"><nobr>+7 (3952) 546-743</nobr><br /><nobr>+7 (950) 381-57-47</nobr></td><td align=\"left\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\"></td></tr>" +
"<tr><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\"><nobr><b>График работы:</b></nobr><br /><nobr>Понедельник - Суббота</nobr><br /><nobr>c 10:00 до 20:00</nobr></td><td align=\"left\" valign=\"middle\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\"><b>E-mail: irk@podborauto.ru</b></td></tr>" +
"</table>";

var rostovContactsHTML = 
"<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">" +
"<tr><td align=\"left\" width=\"100%\" colspan=\"2\" style=\"padding:5px 0px 10px 11px;font:italic 15px Georgia;color:#B60019;\">Адрес: г. Ростов-на-Дону, улица Мечникова 112Г офис 611</td></tr>" +
"<tr style=\"background-color:#d5d5d5\"><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\"><nobr>+7 (863) 248-40-40</nobr><br /><nobr>Тел/Факс: +7 (863)207-80-54</nobr></td><td align=\"left\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\"></td></tr>" +
"<tr><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\"><nobr><b>График работы:</b></nobr><br /><nobr>Понедельник - Суббота</nobr><br /><nobr>c 10:00 до 20:00</nobr></td><td align=\"left\" valign=\"middle\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\"><b>E-mail: rostov-don@podborauto.ru</b></td></tr>" +
"</table>";

var krasnoyarskContactsHTML = 
"<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">" +
"<tr><td align=\"left\" width=\"100%\" colspan=\"2\" style=\"padding:5px 0px 10px 11px;font:italic 15px Georgia;color:#B60019;\">Адрес: г. Красноярск, Комсомольский проспект, дом 1к, офис 2-01</td></tr>" +
"<tr style=\"background-color:#d5d5d5\"><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\"><nobr>+7 (3912) 886-881</nobr></td><td align=\"left\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\"></td></tr>" +
"<tr><td align=\"left\" width=\"100%\" style=\"padding:10px 0px 10px 11px;font:11px Verdana;color:#000000;\"><nobr><b>График работы:</b></nobr><br /><nobr>Понедельник - Суббота</nobr><br /><nobr>c 10:00 до 20:00</nobr></td><td align=\"left\" valign=\"middle\" style=\"padding:10px 11px 10px 10px;font:11px Verdana;color:#000000;\"><b>E-mail: krasnoyarsk@podborauto.ru</b></td></tr>" +
"</table>";

function createMarker(point, options) 
{
	var marker = new GMarker(point, options);
	//GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(content); });
	return marker;
}

function setMarker(x, y)
{
	map.addOverlay(createMarker(new GLatLng(x, y), "", ""));
}

function SwitchContacts(city)
{
    document.getElementById('ContactsMoscowPointer').src = "images/contacts/red_pointer_small.png";
    document.getElementById('ContactsMoscowPointer').style.marginTop = "-10px";
    document.getElementById('ContactsMoscowPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsNovosibPointer').src = "images/contacts/grey_pointer_small.png";
    document.getElementById('ContactsNovosibPointer').style.marginTop = "-10px";
    document.getElementById('ContactsNovosibPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsPiterPointer').src = "images/contacts/red_pointer_small.png";
    document.getElementById('ContactsPiterPointer').style.marginTop = "-10px";
    document.getElementById('ContactsPiterPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsVladikPointer').src = "images/contacts/red_pointer_small.png";
    document.getElementById('ContactsVladikPointer').style.marginTop = "-10px";
    document.getElementById('ContactsVladikPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsIrkutskPointer').src = "images/contacts/red_pointer_small.png";
    document.getElementById('ContactsIrkutskPointer').style.marginTop = "-10px";
    document.getElementById('ContactsIrkutskPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsRostovPointer').src = "images/contacts/red_pointer_small.png";
    document.getElementById('ContactsRostovPointer').style.marginTop = "-10px";
    document.getElementById('ContactsRostovPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsVolgogradPointer').src = "images/contacts/grey_pointer_small.png";
    document.getElementById('ContactsVolgogradPointer').style.marginTop = "-10px";
    document.getElementById('ContactsVolgogradPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsSamaraPointer').src = "images/contacts/grey_pointer_small.png";
    document.getElementById('ContactsSamaraPointer').style.marginTop = "-10px";
    document.getElementById('ContactsSamaraPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsNNovgorodPointer').src = "images/contacts/grey_pointer_small.png";
    document.getElementById('ContactsNNovgorodPointer').style.marginTop = "-10px";
    document.getElementById('ContactsNNovgorodPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsKazanPointer').src = "images/contacts/grey_pointer_small.png";
    document.getElementById('ContactsKazanPointer').style.marginTop = "-10px";
    document.getElementById('ContactsKazanPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsUfaPointer').src = "images/contacts/grey_pointer_small.png";
    document.getElementById('ContactsUfaPointer').style.marginTop = "-10px";
    document.getElementById('ContactsUfaPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsChelabinskPointer').src = "images/contacts/grey_pointer_small.png";
    document.getElementById('ContactsChelabinskPointer').style.marginTop = "-10px";
    document.getElementById('ContactsChelabinskPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsEkaterinburgPointer').src = "images/contacts/grey_pointer_small.png";
    document.getElementById('ContactsEkaterinburgPointer').style.marginTop = "-10px";
    document.getElementById('ContactsEkaterinburgPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsOmskPointer').src = "images/contacts/grey_pointer_small.png";
    document.getElementById('ContactsOmskPointer').style.marginTop = "-10px";
    document.getElementById('ContactsOmskPointer').style.marginLeft = "-10px";
    
    document.getElementById('ContactsKrasnoyarskPointer').src = "images/contacts/red_pointer_small.png";
    document.getElementById('ContactsKrasnoyarskPointer').style.marginTop = "-10px";
    document.getElementById('ContactsKrasnoyarskPointer').style.marginLeft = "-10px";
    
    
	switch (city) {
		case "moscow":
			document.getElementById('ContactsMoscowPointer').src = "images/contacts/red_pointer_big.png";
			document.getElementById('ContactsMoscowPointer').style.marginTop = "-23px";
			document.getElementById('ContactsMoscowPointer').style.marginLeft = "-23px";
			
			
			
			document.getElementById('ContactsCityTitle').innerHTML = "Москва";
			
		
			document.getElementById('ContactsBody').innerHTML = moscowContactsHTML;
			
			map.setMapType(G_NORMAL_MAP);
			map.setCenter(new GLatLng(55.680499, 37.589428), 14);
			break;
		
		case "piter":
			document.getElementById('ContactsPiterPointer').src = "images/contacts/red_pointer_big.png";
			document.getElementById('ContactsPiterPointer').style.marginTop = "-23px";
			document.getElementById('ContactsPiterPointer').style.marginLeft = "-23px";
	
			document.getElementById('ContactsCityTitle').innerHTML = "Санкт-Петербург";

			document.getElementById('ContactsBody').innerHTML = piterContactsHTML;
			
			map.setMapType(G_NORMAL_MAP);
			map.setCenter(new GLatLng(59.94074,30.253773), 14);
			break;
			
		case "novosib":
			document.getElementById('ContactsNovosibPointer').src = "images/contacts/grey_pointer_big.png";
			document.getElementById('ContactsNovosibPointer').style.marginTop = "-23px";
			document.getElementById('ContactsNovosibPointer').style.marginLeft = "-23px";

			document.getElementById('ContactsCityTitle').innerHTML = "Новосибирск";

			document.getElementById('ContactsBody').innerHTML = novosibContactsHTML;
			
			map.setMapType(G_NORMAL_MAP);
			map.setCenter(new GLatLng(55.056042,82.912745), 14);
			break;
			
		case "vladik":
			document.getElementById('ContactsVladikPointer').src = "images/contacts/red_pointer_big.png";
			document.getElementById('ContactsVladikPointer').style.marginTop = "-23px";
			document.getElementById('ContactsVladikPointer').style.marginLeft = "-23px";
	
			document.getElementById('ContactsCityTitle').innerHTML = "Владивосток";

			document.getElementById('ContactsBody').innerHTML = vladikContactsHTML;
			
			map.setMapType(G_HYBRID_MAP);
			map.setCenter(new GLatLng(43.149835, 131.906238), 14);
			break;
			
		case "irkutsk":
			document.getElementById('ContactsIrkutskPointer').src = "images/contacts/red_pointer_big.png";
			document.getElementById('ContactsIrkutskPointer').style.marginTop = "-23px";
			document.getElementById('ContactsIrkutskPointer').style.marginLeft = "-23px";
	
			document.getElementById('ContactsCityTitle').innerHTML = "Иркутск";

			document.getElementById('ContactsBody').innerHTML = irkutskContactsHTML;
			
			map.setMapType(G_HYBRID_MAP);
			map.setCenter(new GLatLng(52.277611, 104.308662), 14);
			break;
			
		case "rostov":
			document.getElementById('ContactsRostovPointer').src = "images/contacts/red_pointer_big.png";
			document.getElementById('ContactsRostovPointer').style.marginTop = "-23px";
			document.getElementById('ContactsRostovPointer').style.marginLeft = "-23px";

			
			document.getElementById('ContactsCityTitle').innerHTML = "Ростов-на-Дону";

			document.getElementById('ContactsBody').innerHTML = rostovContactsHTML;
			
			map.setMapType(G_HYBRID_MAP);
			map.setCenter(new GLatLng(47.234723, 39.71489), 14);
			break;
            
        case "volgograd":
			document.getElementById('ContactsVolgogradPointer').src = "images/contacts/grey_pointer_big.png";
			document.getElementById('ContactsVolgogradPointer').style.marginTop = "-23px";
			document.getElementById('ContactsVolgogradPointer').style.marginLeft = "-23px";
            
			document.getElementById('ContactsCityTitle').innerHTML = "Волгоград";
            
			document.getElementById('ContactsBody').innerHTML = novosibContactsHTML;
			
			map.setMapType(G_NORMAL_MAP);
			map.setCenter(new GLatLng(55.056042,82.912745), 14);
			break;
            
        case "samara":
			document.getElementById('ContactsSamaraPointer').src = "images/contacts/grey_pointer_big.png";
			document.getElementById('ContactsSamaraPointer').style.marginTop = "-23px";
			document.getElementById('ContactsSamaraPointer').style.marginLeft = "-23px";
            
			document.getElementById('ContactsCityTitle').innerHTML = "Самара";
            
			document.getElementById('ContactsBody').innerHTML = novosibContactsHTML;
			
			map.setMapType(G_NORMAL_MAP);
			map.setCenter(new GLatLng(55.056042,82.912745), 14);
			break;
            
        case "nnovgorod":
			document.getElementById('ContactsNNovgorodPointer').src = "images/contacts/grey_pointer_big.png";
			document.getElementById('ContactsNNovgorodPointer').style.marginTop = "-23px";
			document.getElementById('ContactsNNovgorodPointer').style.marginLeft = "-23px";
            
			document.getElementById('ContactsCityTitle').innerHTML = "Нижний Новгород";
            
			document.getElementById('ContactsBody').innerHTML = novosibContactsHTML;
			
			map.setMapType(G_NORMAL_MAP);
			map.setCenter(new GLatLng(55.056042,82.912745), 14);
			break;
            
        case "kazan":
			document.getElementById('ContactsKazanPointer').src = "images/contacts/grey_pointer_big.png";
			document.getElementById('ContactsKazanPointer').style.marginTop = "-23px";
			document.getElementById('ContactsKazanPointer').style.marginLeft = "-23px";
            
			document.getElementById('ContactsCityTitle').innerHTML = "Казань";
            
			document.getElementById('ContactsBody').innerHTML = novosibContactsHTML;
			
			map.setMapType(G_NORMAL_MAP);
			map.setCenter(new GLatLng(55.056042,82.912745), 14);
			break;
            
        case "ufa":
			document.getElementById('ContactsUfaPointer').src = "images/contacts/grey_pointer_big.png";
			document.getElementById('ContactsUfaPointer').style.marginTop = "-23px";
			document.getElementById('ContactsUfaPointer').style.marginLeft = "-23px";
            
			document.getElementById('ContactsCityTitle').innerHTML = "Уфа";
            
			document.getElementById('ContactsBody').innerHTML = novosibContactsHTML;
			
			map.setMapType(G_NORMAL_MAP);
			map.setCenter(new GLatLng(55.056042,82.912745), 14);
			break;
            
        case "chelabinsk":
			document.getElementById('ContactsChelabinskPointer').src = "images/contacts/grey_pointer_big.png";
			document.getElementById('ContactsChelabinskPointer').style.marginTop = "-23px";
			document.getElementById('ContactsChelabinskPointer').style.marginLeft = "-23px";
            
			document.getElementById('ContactsCityTitle').innerHTML = "Челябинск";
            
			document.getElementById('ContactsBody').innerHTML = novosibContactsHTML;
			
			map.setMapType(G_NORMAL_MAP);
			map.setCenter(new GLatLng(55.056042,82.912745), 14);
			break;
            
        case "ekaterinburg":
			document.getElementById('ContactsEkaterinburgPointer').src = "images/contacts/grey_pointer_big.png";
			document.getElementById('ContactsEkaterinburgPointer').style.marginTop = "-23px";
			document.getElementById('ContactsEkaterinburgPointer').style.marginLeft = "-23px";
            
			document.getElementById('ContactsCityTitle').innerHTML = "Екатеринбург";
            
			document.getElementById('ContactsBody').innerHTML = novosibContactsHTML;
			
			map.setMapType(G_NORMAL_MAP);
			map.setCenter(new GLatLng(55.056042,82.912745), 14);
			break;
            
        case "omsk":
			document.getElementById('ContactsOmskPointer').src = "images/contacts/grey_pointer_big.png";
			document.getElementById('ContactsOmskPointer').style.marginTop = "-23px";
			document.getElementById('ContactsOmskPointer').style.marginLeft = "-23px";
            
			document.getElementById('ContactsCityTitle').innerHTML = "Омск";
            
			document.getElementById('ContactsBody').innerHTML = novosibContactsHTML;
			
			map.setMapType(G_NORMAL_MAP);
			map.setCenter(new GLatLng(55.056042,82.912745), 14);
			break;
            
        case "krasnoyarsk":
			document.getElementById('ContactsKrasnoyarskPointer').src = "images/contacts/red_pointer_big.png";
			document.getElementById('ContactsKrasnoyarskPointer').style.marginTop = "-23px";
			document.getElementById('ContactsKrasnoyarskPointer').style.marginLeft = "-23px";
            
			document.getElementById('ContactsCityTitle').innerHTML = "Красноярск";
            
			document.getElementById('ContactsBody').innerHTML = krasnoyarskContactsHTML;
			
			map.setMapType(G_NORMAL_MAP);
			map.setCenter(new GLatLng(56.058547,92.937984), 14);
			break;
			
		default: break;
	}

}

function loadGMap() 
{
	insideMap = document.getElementById("InsideMap");
	if (insideMap) {
		if (GBrowserIsCompatible()) {
			map = new GMap2(insideMap);
			
			switch (currentRegion) {
				case 1: map.setCenter(new GLatLng(55.680499, 37.589428), 14); break;
				case 2: map.setCenter(new GLatLng(59.94074, 30.253773), 14); break;
				case 3: map.setCenter(new GLatLng(55.056042,82.912745), 14); break;
				case 4: map.setCenter(new GLatLng(43.149835, 131.906238), 14); map.setMapType(G_HYBRID_MAP); break;
				case 5: map.setCenter(new GLatLng(52.277611, 104.308662), 14); map.setMapType(G_HYBRID_MAP); break;
				case 6: map.setCenter(new GLatLng(47.234723, 39.71489), 14); map.setMapType(G_HYBRID_MAP); break;
				default: map.setCenter(new GLatLng(55.680499, 37.589428), 14); break;
			}
			//map.enableScrollWheelZoom();
			map.addControl(new GSmallMapControl());
			//map.addControl(new GScaleControl());
			map.addControl(new GMapTypeControl());
			//map.setMapType(G_HYBRID_MAP);
			//map.addControl(new GOverviewMapControl());
			setMarker(55.680499, 37.589428);
			setMarker(59.94074,30.253773);
			setMarker(55.056042,82.912745);
			setMarker(43.149835, 131.906238);
			setMarker(52.277611, 104.308662);
			setMarker(47.234723, 39.71489);
            setMarker(56.058547,92.937984);
		}
	}
}



//-------------------------------------------------------------------------------
function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}

function PrepareSubmit() {
	if (isValidEmail(document.getElementById('QuestionMail').value)) {
		document.forms['QuestionForm'].submit();
	} else {
		document.getElementById('QuestionError').innerHTML = "<b>Некорректный Е-MAIL</b>";
	}
}

function PrepareReristerSubmit() {
	if (isValidEmail(document.getElementById('Email').value)) {
		document.forms['Register'].submit();
	} else {
		document.getElementById('RegisterError').innerHTML = "<b>Некорректный Е-MAIL</b>";
	}
}
//-----------------------------------------------------------------------------

function changeRegion(id)
{
	regionLabel = document.getElementById('CurrentRegion');
	regionLabel2 = document.getElementById('CurrentRegion2');
	regionPhone = document.getElementById('CurrentRegionPhone');
	
	
	switch (id) {
		case 1: 
			regionLabel.innerHTML = 'Москва'; 
			regionLabel2.innerHTML = 'Санкт-Петербург';
			regionPhone.innerHTML = '<nobr>(812) 313-2481</nobr>';
			if (document.getElementById("InsideMap")) SwitchContacts('moscow');
			break;
		
		case 2: 
			regionLabel.innerHTML = 'Санкт-Петербург'; 
			regionLabel2.innerHTML = 'Санкт-Петербург';
			regionPhone.innerHTML = '<nobr>(812) 313-2481</nobr>';
			if (document.getElementById("InsideMap")) SwitchContacts('piter');
			break;
			
		case 3: 
			regionLabel.innerHTML = 'Новосибирск'; 
			regionLabel2.innerHTML = 'Новосибирск';
			regionPhone.innerHTML = '<nobr></nobr>';
			if (document.getElementById("InsideMap")) SwitchContacts('novosib');
			break;
			
		case 4: 
			regionLabel.innerHTML = 'Владивосток'; 
			regionLabel2.innerHTML = 'Владивосток';
			regionPhone.innerHTML = '<nobr>(4232) 360-095</nobr>';
			if (document.getElementById("InsideMap")) SwitchContacts('vladik');
			break;
			
		case 5: 
			regionLabel.innerHTML = 'Иркутск'; 
			regionLabel2.innerHTML = 'Иркутск';
			regionPhone.innerHTML = '<nobr>(3952) 546-743</nobr>';
			if (document.getElementById("InsideMap")) SwitchContacts('irkutsk');
			break;
		
		default: 
			regionLabel.innerHTML = 'Москва'; 
			regionLabel2.innerHTML = 'Санкт-Петербург'; 
			regionPhone.innerHTML = '<nobr>(812) 313-2481</nobr>';
			if (document.getElementById("InsideMap")) SwitchContacts('moscow');
			break;
	}
	
	floatyHiddener('RegionsList', 0, 60);
	document.getElementById('RegionsListButton').src = 'images/content/map/right.gif';
	
	if (window.XMLHttpRequest) { 
		http_request = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		http_request = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	http_request.open('GET', "modules/changeRegion.html?ID="+id, true);
	//http_request.open('GET', "http://127.0.0.1/podborauto/modules/changeRegion.html?ID="+id, true);
	
	http_request.send(null);
	
	
}

//------------------------------------------------------------------------------

function lightComboListButton(id)
{
	buttonImg = document.getElementById(id);
	if ((buttonImg.src.indexOf("images/podbor/drop_on.png") != -1)  || (buttonImg.src.indexOf("images/podbor/drop_on_light.png") != -1)) buttonImg.src = "images/podbor/drop_on_light.png";
	else buttonImg.src = "images/podbor/drop_off_light.png";

}

function unlightComboListButton(id)
{
	buttonImg = document.getElementById(id);
	if ((buttonImg.src.indexOf("images/podbor/drop_on.png") != -1) || (buttonImg.src.indexOf("images/podbor/drop_on_light.png") != -1)) buttonImg.src = "images/podbor/drop_on.png";
	else buttonImg.src = "images/podbor/drop_off.png";

}



//------------------------------------------------------------------------------
function floatyDropAtWork(id, minHeight, maxHeight)
{
	if (document.getElementById("PodborComplete"+id).style.height == minHeight + "px") {

		document.getElementById("ImagePodborComplete"+id).src = "images/podbor/drop_off.png";
		document.getElementById("YearPodborComplete"+id).style.visibility = "hidden";
		document.getElementById("PricePodborComplete"+id).style.visibility = "hidden";
		document.getElementById("PodborComplete"+id).style.visibility = "visible";
		floatyDrop("PodborComplete"+id, minHeight, maxHeight);

	} else {
		document.getElementById("ImagePodborComplete"+id).src = "images/podbor/drop_on.png";
		document.getElementById("PodborComplete"+id).style.height = minHeight + "px";
		document.getElementById("YearPodborComplete"+id).style.visibility = "visible";
		document.getElementById("PricePodborComplete"+id).style.visibility = "visible";
		document.getElementById("PodborComplete"+id).style.visibility = "hidden";
	}
}

//------------------------------------------------------------------------------

function floatyDropPodbor(id, minHeight, maxHeight, type)
{
	if (document.getElementById("PodborComplete"+id).style.height == minHeight + "px") {
		
		if (window.XMLHttpRequest) { 
			http_request = new XMLHttpRequest();
		} else if (window.ActiveXObject) {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		http_request.open('GET', "modules/get_complete"+type+".html?ID="+id, true);
		
		http_request.onreadystatechange = function() {

			if (http_request.readyState == 4) {
				document.getElementById("PodborComplete"+id).innerHTML = http_request.responseText;
				
				document.getElementById("ImagePodborComplete"+id).src = "images/podbor/drop_off.png";
				document.getElementById("YearPodborComplete"+id).style.visibility = "hidden";
				document.getElementById("PricePodborComplete"+id).style.visibility = "hidden";
				document.getElementById("PodborComplete"+id).style.visibility = "visible";
				floatyDrop("PodborComplete"+id, minHeight, maxHeight);
			}
		};
		
		http_request.send(null);

	} else {
		document.getElementById("ImagePodborComplete"+id).src = "images/podbor/drop_on.png";
		document.getElementById("PodborComplete"+id).style.height = minHeight + "px";
		document.getElementById("YearPodborComplete"+id).style.visibility = "visible";
		document.getElementById("PricePodborComplete"+id).style.visibility = "visible";
		document.getElementById("PodborComplete"+id).style.visibility = "hidden";
	}
}

//------------------------------------------------------------------------------

function floatyHiddener(id, minHeight, maxHeight)
{
	if (document.getElementById(id).style.height == minHeight + "px") {
		document.getElementById(id).style.visibility = "visible";
		floatyDrop(id, minHeight, maxHeight);
	} else {
		floatyDrop(id, maxHeight, minHeight);
		document.getElementById(id).style.visibility = 'hidden';
	}
}

//------------------------------------------------------------------------------
function floatyDrop(id, curHeight, needHeight)
{
	if (curHeight < needHeight) {
		newHeight = curHeight + 20;
		
		if (newHeight >= needHeight) {
		document.getElementById(id).style.height = needHeight + "px";
		} else {
			document.getElementById(id).style.height = newHeight + "px";
			setTimeout("floatyDrop('"+id+"',"+newHeight+", "+needHeight+")", 1);
		}
	} else {
		newHeight = curHeight - 20;
		
		if (newHeight <= needHeight) {
		document.getElementById(id).style.height = needHeight + "px";
		} else {
			document.getElementById(id).style.height = newHeight + "px";
			setTimeout("floatyDrop('"+id+"',"+newHeight+", "+needHeight+")", 1);
		}
	}
	
	
}


//----------------------------------------------------------------------------
var curNewsMarg =0;
var newsBusy = 0;


function moveNewsUpStart()
{
	if (!newsBusy) {
		document.getElementById("ImgNewsUp").src="images/content/header_button_next_light.gif";
		newsBusy = 1;
		curNewsMarg = 0;
		moveNewsUp();
	}
	
}

function moveNewsUp()
{
	containers = document.getElementsByName("NewsContainer");
	curNewsMarg = curNewsMarg-20;
	
	if (containers.length != 0) {
	
		if (curNewsMarg < -310) curNewsMarg = -310;
	    containers[0].style.marginTop = curNewsMarg+"px";
	    
		if (curNewsMarg > -310) {
		    setTimeout("moveNewsUp()", 1);
	    } else {
	        //alert(containers[0].innerText)
		    par=containers[0].parentNode;
		    newContainer = par.removeChild(containers[0]);
		    newContainer.style.marginTop="0px";
		    par.appendChild(newContainer);
		    document.getElementById("ImgNewsUp").src="images/content/header_button_next.gif";
		    newsBusy = 0;
	    }
	}
}

function moveNewsDownStart()
{
	if (!newsBusy) {
		document.getElementById("ImgNewsDown").src="images/content/header_button_prev_light.gif";
		newsBusy = 1;
		curNewsMarg = -310;
		
		containers = document.getElementsByName("NewsContainer");
		par=containers[0].parentNode;
		newContainer = par.removeChild(containers[containers.length - 1]);
		newContainer.style.marginTop = curNewsMarg + "px";
		par.insertBefore(newContainer, containers[0]);
		//alert(containers[0].parentNode.innerHTML);
		
		moveNewsDown();
	}
	
}

function moveNewsDown()
{
	containers = document.getElementsByName("NewsContainer");
	curNewsMarg = curNewsMarg+20;
	
	if (curNewsMarg > 0) curNewsMarg = 0;
	containers[0].style.marginTop = curNewsMarg+"px";
	
	if (curNewsMarg < 0) {
		setTimeout("moveNewsDown()", 1);
	} else {
		document.getElementById("ImgNewsDown").src="images/content/header_button_prev.gif";
		newsBusy = 0;
	}
}

///////////////////////////////////////////////////////////////////////////



var curBannerMarg =0;
var bannerBusy = 0;
var bannerOpen = 0;


function rollBanner()
{
    if (!bannerBusy) {
        bannerBusy = 1;
        if (curBannerHeight > 10) closeBanner();
        if (curBannerHeight < 10) openBanner();
    }
}

function lightBannerButton()
{
	bannerButton = document.getElementById("BannerButton");
	if ((bannerButton.src.indexOf("images/banner/middle_on.png") != -1)  || (bannerButton.src.indexOf("images/banner/middle_on_light.png") != -1)) bannerButton.src = "images/banner/middle_on_light.png";
	else bannerButton.src = "images/banner/middle_off_light.png";

}

function unlightBannerButton()
{
	bannerButton = document.getElementById("BannerButton");
	if ((bannerButton.src.indexOf("images/banner/middle_on.png") != -1) || (bannerButton.src.indexOf("images/banner/middle_on_light.png") != -1)) bannerButton.src = "images/banner/middle_on.png";
	else bannerButton.src = "images/banner/middle_off.png";

}

function closeBanner()
{
    curBannerHeight = curBannerHeight - 20;
    if (curBannerHeight <=3 ) {
        curBannerHeight = 3;
        document.getElementById("BannerContainer1").style.height = (curBannerHeight + 39) + "px";
        document.getElementById("BannerContainer2").style.height = curBannerHeight + "px";
        document.getElementById("BannerButton").src = "images/banner/middle_on.png";
        bannerBusy = 0;
    
    } else {
        document.getElementById("BannerContainer1").style.height = (curBannerHeight + 39) + "px";
        document.getElementById("BannerContainer2").style.height = curBannerHeight + "px";
        setTimeout("closeBanner()", 1);
    }
}

function openBanner()
{
    curBannerHeight = curBannerHeight + 20;
    if (curBannerHeight >=345 ) {
        curBannerHeight = 345;
        document.getElementById("BannerContainer1").style.height = (curBannerHeight + 39) + "px";
        document.getElementById("BannerContainer2").style.height = curBannerHeight + "px";
        document.getElementById("BannerButton").src = "images/banner/middle_off.png";
        bannerBusy = 0;
    
    } else {
        document.getElementById("BannerContainer1").style.height = (curBannerHeight + 39) + "px";
        document.getElementById("BannerContainer2").style.height = curBannerHeight + "px";
        setTimeout("openBanner()", 1);
    }
}

function moveBannerLeftStart()
{
	if (!bannerBusy) {
		document.getElementById("ImgBannerRight").src="images/banner/button_right.gif";
		bannerBusy = 1;
		curBannerMarg = 0;
		moveBannerLeft();
	}
	
}

function moveBannerLeft()
{
	containers = document.getElementsByName("BannerImage");
	curBannerMarg = curBannerMarg-20;
	
	if (curBannerMarg < 955) curBannerMarg = -955;
	containers[0].style.marginLeft = curBannerMarg+"px";
	
	if (curBannerMarg > -955) {
		setTimeout("moveBannerLeft()", 1);
	} else {
		par=containers[0].parentNode;
		newContainer = par.removeChild(containers[0]);
		newContainer.style.marginLeft="0px";
		par.appendChild(newContainer);
		document.getElementById("ImgBannerRight").src="images/banner/button_right_p.gif";
		bannerBusy = 0;
	}
}


function moveBannerRightStart()
{
	if (!bannerBusy) {
		document.getElementById("ImgBannerLeft").src="images/banner/button_left.gif";
		bannerBusy = 1;
		curBannerMarg = -955;
		
		containers = document.getElementsByName("BannerImage");
		par=containers[0].parentNode;
		newContainer = par.removeChild(containers[containers.length - 1]);
		newContainer.style.marginLeft = curBannerMarg + "px";
		par.insertBefore(newContainer, containers[0]);
		//alert(containers[0].parentNode.innerHTML);
		
		moveBannerRight();
	}
	
}

function moveBannerRight()
{
	containers = document.getElementsByName("BannerImage");
	
	curBannerMarg = curBannerMarg+20;
	if (curBannerMarg > 0) curBannerMarg = 0;
	containers[0].style.marginLeft = curBannerMarg+"px";
	
	if (curBannerMarg < 0) {
		setTimeout("moveBannerRight()", 1);
	} else {
		document.getElementById("ImgBannerLeft").src="images/banner/button_left_p.gif";
		bannerBusy = 0;
	}
}


///////////////////////////////////////////////////////////////////////////

podborautoCursorIn0 = 0;
podborautoCursorIn1 = 0;
podborautoCursorIn2 = 0;
podborautoCursorIn3 = 0;

function showMenu(menuName, xt)
{
	
	document.getElementById(menuName).style.backgroundImage = "url(images/menu/" + menuName + "_p.gif)";
	document.getElementById(menuName+"_sub").style.visibility = "visible";
	
	if (xt == 0) podborautoCursorIn0 = 1;
	if (xt == 1) podborautoCursorIn1 = 1;
	if (xt == 2) podborautoCursorIn2 = 1;
	if (xt == 3) podborautoCursorIn3 = 1;
}

function outMenu(menuName, xt) {
	if (xt == 0) podborautoCursorIn0 = 0;
	if (xt == 1) podborautoCursorIn1 = 0;
	if (xt == 2) podborautoCursorIn2 = 0;
	if (xt == 3) podborautoCursorIn3 = 0;
	
	if ((podborautoCursorIn0 == 0) || (podborautoCursorIn1 == 0) || (podborautoCursorIn2 == 0) || (podborautoCursorIn3 == 0)) {
		document.getElementById(menuName).style.backgroundImage = "url(images/menu/" + menuName + ".gif)";
		document.getElementById(menuName+"_sub").style.visibility = "hidden";
	}
}

//////////////////////////////////////////////

calculatorCursorInBox = 0;
calculatorCursorInArrow = 0;
calculatorCursorInDrop = 0;

function dropCalculators(from)
{   
    document.getElementById("CalculatorContainer").style.visibility = "visible";
    document.getElementById("CalculatorDropButton").src = "images/content/calc/right_p.gif";
    
    if (from == "box") calculatorCursorInBox = 1;
    if (from == "arrow") calculatorCursorInArrow = 1;
}

function overCalculators(from)
{
    if (from == "box") calculatorCursorInBox = 1;
    if (from == "arrow") calculatorCursorInArrow = 1;
    if (from == "drop") calculatorCursorInDrop = 1;
    
}

function outCalculators(from)
{
    if (from == "box") calculatorCursorInBox = 0;
    if (from == "arrow") calculatorCursorInArrow = 0;
    if (from == "drop") calculatorCursorInDrop = 0;

    if ((calculatorCursorInBox == 0) && (calculatorCursorInArrow == 0) && (calculatorCursorInDrop == 0)) {
        document.getElementById("CalculatorDropButton").src = "images/content/calc/right.gif";
        document.getElementById("CalculatorContainer").style.visibility = "hidden";
        //alert(calculatorCursorInBox+" "+calculatorCursorInArrow+" "+calculatorCursorInDrop);
    }

}

////////////////////////////////////////////

function LightButton(num)
{
	document.getElementById('Button'+num+'MiddlePart').style.backgroundImage = "url(images/form/button_middle_on.gif)";
	document.getElementById('Button'+num+'LeftPart').src = "images/form/button_left_on.gif";
	document.getElementById('Button'+num+'RightPart').src = "images/form/button_right_on.gif";
}

function UnlightButton(num)
{
	document.getElementById('Button'+num+'MiddlePart').style.backgroundImage = "url(images/form/button_middle_off.gif)";
	document.getElementById('Button'+num+'LeftPart').src = "images/form/button_left_off.gif";
	document.getElementById('Button'+num+'RightPart').src = "images/form/button_right_off.gif";
}

function LightButton2(num)
{
	document.getElementById('Button'+num+'MiddlePart').style.backgroundImage = "url(images/form/button2_middle_on.gif)";
	document.getElementById('Button'+num+'LeftPart').src = "images/form/button2_left_on.gif";
	document.getElementById('Button'+num+'RightPart').src = "images/form/button2_right_on.gif";
}

function UnlightButton2(num)
{
	document.getElementById('Button'+num+'MiddlePart').style.backgroundImage = "url(images/form/button2_middle_off.gif)";
	document.getElementById('Button'+num+'LeftPart').src = "images/form/button2_left_off.gif";
	document.getElementById('Button'+num+'RightPart').src = "images/form/button2_right_off.gif";
}
				
