              var mas1=new Array();
              var type;
              var CM2;
function menu(b,i) {
var o,oh;
o=document.getElementById(b+'a');
if (o!=null) return;
o=document.getElementById(b);
oh=document.getElementById(b+'h');
o.style.display='none';
oh.style.display='none';
if (i) oh.style.display='inline';
else o.style.display='inline';
}
function gete(id) {
return document.getElementById(id);
}
function wizard(i){
    //i  = "0";
	var n11 = gete("n11");
	var n12 = gete("n12");
	var n13 = gete("n13");
	var n14 = gete("n14");

	var n21 = gete("n21");
	var n22 = gete("n22");
	var n23 = gete("n23");
	var n24 = gete("n24");

	var n31 = gete("n31");
	var n32 = gete("n32");
	var n33 = gete("n33");
	var n34 = gete("n34");

	var n41 = gete("n41");
	var n42 = gete("n42");
	var n43 = gete("n43");
	var n44 = gete("n44");

	var url_ = gete("url_");
	var id = gete("form10");
	if(i==1) { url= "mortgage.php";	text="Сравнить условия";}
	if(i==2) { url= "auto.php";		text="Сравнить кредиты";}
	if(i==3) { url= "deposit.php"; 	text="Сравнить вклады";}
	if(i==4) { url= "personal_finance.php";text="Сравнить кредиты";}
		url_.innerHTML='<a href="'+CM2+url+'">'+text+'</a>';
	id.action = "http://www.bankprice.ru/pages_m1/compare_m2/"+url;

	n11.innerHTML='1. <a class="avgLink" href="#" onclick="document.getElementById(\'form10\').submit();">'+mas1[i-1][0][3]+' - '+mas1[i-1][0][4]+'</a>';
	n12.innerHTML=mas1[i-1][0][5]+'%';
	n13.innerHTML=mas1[i-1][0][6]+'%';
	n14.innerHTML=mas1[i-1][0][7]+'%';

	n21.innerHTML='2. <a class="avgLink" href="#" onclick="document.getElementById(\'form10\').submit();">'+mas1[i-1][1][3]+' - '+mas1[i-1][1][4]+'</a>';
	n22.innerHTML=mas1[i-1][1][5]+"%";
	n23.innerHTML=mas1[i-1][1][6]+'%';
	n24.innerHTML=mas1[i-1][1][7]+'%';

	n31.innerHTML='3. <a class="avgLink" href="#" onclick="document.getElementById(\'form10\').submit();">'+mas1[i-1][2][3]+' - '+mas1[i-1][2][4]+'</a>';
	n32.innerHTML=mas1[i-1][2][5]+"%";
	n33.innerHTML=mas1[i-1][2][6]+'%';
	n34.innerHTML=mas1[i-1][2][7]+'%';

	n41.innerHTML='4. <a class="avgLink" href="#" onclick="document.getElementById(\'form10\').submit();">'+mas1[i-1][3][3]+' - '+mas1[i-1][3][4]+'</a>';
	n42.innerHTML=mas1[i-1][3][5]+"%";
	n43.innerHTML=mas1[i-1][3][6]+'%';
	n44.innerHTML=mas1[i-1][3][7]+'%';

//	n1.innerHTML=mas1[1][3]+" - ";
//	n1.innerHTML+=mas1[1][4];
	}
function menus(wind)
{
var winone	=gete("ones");
var wintwo	=gete("twos");
var winthree=gete("threes");
var winfour	=gete("fours");
var winoneh	=gete("oneh");
var wintwoh	=gete("twoh");
var winthreeh=gete("threeh");
var winfourh=gete("fourh");
var im11	=gete("im11");
var im12	=gete("im12");
var im21	=gete("im21");
var im22	=gete("im22");
var im31	=gete("im31");
var im32	=gete("im32");
var im41	=gete("im41");
var im42	=gete("im42");
var winwrite=gete("write");

if (wind == 1)
{
winone.className = "fra-psv";
wintwo.className = "fra-act";
winthree.className = "fra-psv";
winfour.className = "fra-psv";

winoneh.className = "avgmn";
wintwoh.className = "avgmna";
winthreeh.className = "avgmn";
winfourh.className = "avgmn";

im11.src = 'http://www.bankprice.ru/img/bnaleft.gif';
im12.src = 'http://www.bankprice.ru/img/bnaright.gif';
im21.src = 'http://www.bankprice.ru/img/bnalefta.gif';
im22.src = 'http://www.bankprice.ru/img/bnarighta.gif';
im31.src = 'http://www.bankprice.ru/img/bnaleft.gif';
im32.src = 'http://www.bankprice.ru/img/bnaright.gif';
im41.src = 'http://www.bankprice.ru/img/bnaleft.gif';
im42.src = 'http://www.bankprice.ru/img/bnaright.gif';

wizard(wind+1);
}
if (wind == 2)
{
winone.className = "fra-psv";
wintwo.className = "fra-psv";
winthree.className = "fra-act";
winfour.className = "fra-psv";

winoneh.className = "avgmn";
wintwoh.className = "avgmn";
winthreeh.className = "avgmna";
winfourh.className = "avgmn";

im11.src = 'http://www.bankprice.ru/img/bnaleft.gif';
im12.src = 'http://www.bankprice.ru/img/bnaright.gif';
im21.src = 'http://www.bankprice.ru/img/bnaleft.gif';
im22.src = 'http://www.bankprice.ru/img/bnaright.gif';
im31.src = 'http://www.bankprice.ru/img/bnalefta.gif';
im32.src = 'http://www.bankprice.ru/img/bnarighta.gif';
im41.src = 'http://www.bankprice.ru/img/bnaleft.gif';
im42.src = 'http://www.bankprice.ru/img/bnaright.gif';
wizard(wind+1);
}
if (wind == 3)
{
winone.className = "fra-psv";
wintwo.className = "fra-psv";
winthree.className = "fra-psv";
winfour.className = "fra-act";

winoneh.className = "avgmn";
wintwoh.className = "avgmn";
winthreeh.className = "avgmn";
winfourh.className = "avgmna";

im11.src = 'http://www.bankprice.ru/img/bnaleft.gif';
im12.src = 'http://www.bankprice.ru/img/bnaright.gif';
im21.src = 'http://www.bankprice.ru/img/bnaleft.gif';
im22.src = 'http://www.bankprice.ru/img/bnaright.gif';
im31.src = 'http://www.bankprice.ru/img/bnaleft.gif';
im32.src = 'http://www.bankprice.ru/img/bnaright.gif';
im41.src = 'http://www.bankprice.ru/img/bnalefta.gif';
im42.src = 'http://www.bankprice.ru/img/bnarighta.gif';
wizard(wind+1);
}
if (wind == 0)
{
winone.className = "fra-act";
wintwo.className = "fra-psv";
winthree.className = "fra-psv";
winfour.className = "fra-psv";

winoneh.className = "avgmna";
wintwoh.className = "avgmn";
winthreeh.className = "avgmn";
winfourh.className = "avgmn";

im11.src = 'http://www.bankprice.ru/img/bnalefta.gif';
im12.src = 'http://www.bankprice.ru/img/bnarighta.gif';
im21.src = 'http://www.bankprice.ru/img/bnaleft.gif';
im22.src = 'http://www.bankprice.ru/img/bnaright.gif';
im31.src = 'http://www.bankprice.ru/img/bnaleft.gif';
im32.src = 'http://www.bankprice.ru/img/bnaright.gif';
im41.src = 'http://www.bankprice.ru/img/bnaleft.gif';
im42.src = 'http://www.bankprice.ru/img/bnaright.gif';
wizard(wind+1);
}
}

function popWindow(url,sx,sy){
if(typeof sx=="undefined")sx=780;
if(typeof sy=="undefined")sy=400;
wnd = window.open(url, "lookup", "toolbar=no,location=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, width="+sx+", height="+sy+", top=0");
wnd.focus();
return false;
}

function provc(){
var one = document.getElementById("one").value;
var three = document.getElementById("three").value;
var four = document.getElementById("four").value;
var five = document.getElementById("five").value;
var str = 0;
var ht = "Повторите ввод: ";

if ((one==0) || (one=="")) { ht += "суммы кредита; "; str=1;}
if ((three==0) || (three=="")) { ht += "срока; "; str=1;}
if ((four==0) || (four=="")) { ht += "ставки; "; str=1;}
if (five=="") { ht += "первого взноса от суммы; "; str=1;}

if (str==0)document.getElementById("form1").submit();
else alert(ht);
}

function provcard(){
var one = document.getElementById("one").value;
var three = document.getElementById("three").value;
var four = document.getElementById("four").value;
var five = document.getElementById("five").value;
var str = 0;
var ht = "Повторите ввод: ";

if ((one==0) || (one=="")) { ht += "cуммы долга по карте; "; str=1;}
if ((three==0) || (three=="")) { ht += "ставки; "; str=1;}
if (((four==0) || (four=="")) && ((five==0) || (five==""))) {
	ht += "ежемесячного платежа по кредиту; ";
	ht += "месяцев для погашения кредита: ;";
	str=1;
}
//if ((four==0) || (four=="")) { ht += "ежемесячного платежа по кредиту; "; str=1;}
//if ((five==0) || (five=="")) { ht += "месяцев для погашения кредита;"; str=1;}

if (str==0)document.getElementById("form1").submit();
else alert(ht);
}

function provdep(){
var one = document.getElementById("one").value;
var three = document.getElementById("three").value;
var four = document.getElementById("four").value;
var five = document.getElementById("five").value;
var str = 0;
var ht = "Повторите ввод: ";

if ((one==0) || (one=="")) { ht += "суммы вклада; "; str=1;}
if ((three==0) || (three=="")) { ht += " срока вклада; "; str=1;}
if ((four==0) || (four=="")) { ht += "ставки; "; str=1;}
if ((five==0) || (five=="")) { ht += "начислений;"; str=1;}

if (str==0)document.getElementById("form1").submit();
else alert(ht);
}

function prov(){
var a = document.getElementById("first").value;
if ((a==0) || (a=="")) alert('Введенная сумма не допустима');
else document.getElementById("second").submit();
}

function setAction(o,i){
if (i==1) o.action+="mortgage.php";
if (i==2) o.action+="auto.php";
if (i==3) o.action+="invest.php";
if (i==4) o.action+="card.php";
if (i==5) o.action+="deposit.php";
if (i==6) o.action+="education.php";
if (i==7) o.action+="personal_finance.php";
if (i==8) o.action+="insurance.php";
}

function pro(chooser){
var i=chooser.options[chooser.selectedIndex].value;
var o=document.getElementById("second");
o.action="http://www.bankprice.ru/pages_m1/compare_m2/";
setAction(o,i);
}

function pro1(chooser){
var i=chooser.options[chooser.selectedIndex].value;
var o=document.getElementById("odin");
o.action = "http://www.bankprice.ru/pages_m1/compare_m2/";
setAction(o,i);
}

function pro2(chooser){
var i=chooser.options[chooser.selectedIndex].value;
var o=document.getElementById("tri");
o.action = "http://www.bankprice.ru/pages_m1/compare_m2/";
setAction(o,i);
}

function proc(chooser){
var i=chooser.options[chooser.selectedIndex].value;
var o=document.getElementById("second");
o.action = "http://www.bankprice.ru/pages_m1/calc_m2/";
if (i==1) o.action+="mortgage.php";
if (i==2) o.action+="auto.php";
if (i==3) o.action+="card.php";
if (i==4) o.action+="deposit.php";
if (i==5) o.action+="education.php";
if (i==6) o.action+="personal_finance.php";
}

var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip
