function CreditEnable()
{
	InputEnable('other_summ', true);
	InputEnable('other_month', true);
	InputEnable('other_term', true);
}

function CreditDisable()
{
	InputEnable('other_summ', false);
	InputEnable('other_month', false);
	InputEnable('other_term', false);
}

function InputEnable (id, flag)
{
	var el = document.getElementById(id);
	if (flag)
		el.disabled = false;
	else
		el.disabled = true;
}


function wo(id, _ww,_wh,_wscrl)
{
/***************
	Функция создает новое окно, и записывает в него содержимое
	переменной WindowText.

	wurl: window URL
	wh: window height
	ww: window width
	wsr: scrollbars 1 - yes, 0 - no
***************/
 if(screen.width){
  wpos_x = (screen.width-_ww)/2;
  if (wpos_x < 0){ wpos_x = 0;}
  wpos_y = (screen.height-_wh)/2;
  if (wpos_y < 0){ wpos_y = 0;}
 }else{
  wpos_x = 0;
  wpos_y = 0;
 }
 if(_wscrl==undefined){ _wscrl = 0;} 
 
	wind_desc = window.open("/upload/ToyotaSiteText/"+id+".php?popup=1", "va", "alwaysRaised=0,top="+wpos_y+",left="+wpos_x+",height="+_wh+",width="+_ww+",menubar=0,resizable=1,scrollbars="+_wscrl+",status=1");
//	wind_desc.document.write(WindowText[""+id+""]);
	wind_desc.document.close();
	wind_desc.focus();
}


function models(name,number) {
document.getElementById(name).src='/bitrix/templates/toyota_inside/images/models/'+name+'/'+number+'.jpg';
}

/* auto consultant - reload pages in parent window when clicking links in pop-up */
var NW=null;
function choose_model(url) {
	if (window.opener){
		if (window.opener.closed){
			if (NW){
				NW.location.href=url;
				}
				else {				
				NW=window.open(url,"","");
			}
		self.focus();
		}
		else {
		window.opener.location.href=url;
		}
	}
	else {
		if (NW){
			NW.location.href=url;
			}
			else {				
			NW=window.open(url,"","");
			}
	self.focus();
	}
}
/* /auto consultant */

function size(){
	//alert(document.body.clientWidth);
	var W = document.body.clientWidth;
	var nWidth = "988";
	if(W > nWidth){
		document.getElementById('base').style.width = nWidth + "px";
	}else{
		document.getElementById('base').style.width = "100%";
	}
	//window.status = document.body.clientWidth + "x" + document.body.clientHeight + " | " + document.getElementById('base').style.width;
}

function PrintVersion(){
	if (document.print_form){
		PR=window.open("","wndPrint","alwaysRaised=yes,left=0,top=0,height=500,width=800,menubar=yes,toolbar=yes,resizable=yes,status=yes,scrollbars=yes");
		document.print_form.submit();

	}else{
		alert("No print version for this page!");
	}

}

function sendsms(){
	window.open("sendsms.php", "sendSMS", "menubar=0,scrollbars=1,resizable=1,status=0,width=605,height=550").focus();
}

// Atention!!! Link on this function insert into FCk-editor!!!--------------------------
/*
function wo(_wurl,_ww,_wh,_wscrl){
alert ("1");
/***************
	wurl: window URL
	wh: window height
	ww: window width
	wsr: scrollbars 1 - yes, 0 - no
***************/
/*
 if(screen.width){
  wpos_x = (screen.width-_ww)/2;
  if (wpos_x < 0){ wpos_x = 0;}
  wpos_y = (screen.height-_wh)/2;
  if (wpos_y < 0){ wpos_y = 0;}
 }else{
  wpos_x = 0;
  wpos_y = 0;
 }
// if(_wscrl==undefined){ _wscrl = 0;}
 wind_desc = window.open("/upload/Toyota/"+_wurl,"","alwaysRaised=0,top="+wpos_y+",left="+wpos_x+",height="+_wh+",width="+_ww+",menubar=0,resizable=1,scrollbars="+_wscrl+",status=1");
 wind_desc.focus();
}
///-------------------------------------------------------------------------------------
*/

// popup  without resize
function wo_(_wurl,_ww,_wh,_wscrl){

/***************
	wurl: window URL
	wh: window height
	ww: window width
	wsr: scrollbars 1 - yes, 0 - no
***************/
 if(screen.width){
  wpos_x = (screen.width-_ww)/2;
  if (wpos_x < 0){ wpos_x = 0;}
  wpos_y = (screen.height-_wh)/2;
  if (wpos_y < 0){ wpos_y = 0;}
 }else{
  wpos_x = 0;
  wpos_y = 0;
 }
// if(_wscrl==undefined){ _wscrl = 0;}
 wind_desc = window.open("/upload/ToyotaFiles/"+_wurl,"","alwaysRaised=0,top=100,left="+wpos_x+",height="+_wh+",width="+_ww+",menubar=0,resizable=0,scrollbars="+_wscrl+",status=1");
 wind_desc.focus();
}
///-------------------------------------------------------------------------------------


function wopen(_wurl,_wn,_ww,_wh,_wscrl){

/***************
	wurl: window URL
	wh: window height
	ww: window width
	wsr: scrollbars 1 - yes, 0 - no
***************/
 if(screen.width){
  wpos_x = (screen.width-_ww)/2;
  if (wpos_x < 0){ wpos_x = 0;}
  wpos_y = (screen.height-_wh)/2;
  if (wpos_y < 0){ wpos_y = 0;}
 }else{
  wpos_x = 0;
  wpos_y = 0;
 }
// if(_wscrl==undefined){ _wscrl = 0;}
 if(_wn==""){ _wn = "w_test";}
 wind_desc = window.open(_wurl,_wn,"alwaysRaised=0,top=0,left="+wpos_x+",height="+_wh+",width="+_ww+",menubar=0,resizable=0,scrollbars="+_wscrl+",status=0");
 wind_desc.focus();
}

/* ---------------Copyrights---------------------*/
//var TEXT = Array(2,15,25,1,14);
var TEXT = Array(9,14,6,15);
var NUM = 0;
function copy(letter){
	//alert(letter)	
	if(letter == TEXT[NUM]){
		NUM++;
		if(NUM == TEXT.length){
			//alert('Coding and scripting by Boyan!\nin WorldWebStudio\n :)))')
			alert('Разработано и склепано мужественными трудягами из "World Web Studio":\n\nМаксим Гаев (директор)\n---\nНаталья Будкевич (руководитель отдела по работе с клиентами)\n   Ольга Коваленко (проджект менеджер)\n---\nАлександрс Изотовс (Арт-директор)\n---\nАлексей Пилипенко (начальник IT-отдела)\n   Святослав Маньковский\n   Аркадий Смирнов\n---\n Андрей Бойко (начальник отдела верстки)\n   Светлана Морозова\n\n---------=======Да прибудет с нами "СИЛА"!!!=======---------\n\n\nКомпания "World Web Studio" благодарит UMC за сотрудничество.');
		}
	}else{
		NUM = 0;
	}
}
/*-----------------------------------------------*/

/*----------ROLLOVER------------------------------*/
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/*----------ROLLOVER------------------------------*/