pictures = new Array();
for(im=0;im<3;im++)
   {
    pictures[im] = new Image();
    if(im==0) pictures[im].src = '/grafiki-2010/marins_park_hotel.png';
    if(im==1) pictures[im].src = '/grafiki-2010/magnoliya.png';
    if(im==2) pictures[im].src = '/grafiki-2010/mayak.png';
   }

 pictures_room = new Array();

	for (r=0; r<11;r++){
    pictures_room[r] = new Image();
    if(r==0) pictures_room[r].src = '/grafiki-2010/marins_park_hotel_junior.png';
    if(r==1) pictures_room[r].src = '/grafiki-2010/marins_park_hotel_standart.png';
    if(r==2) pictures_room[r].src = '/grafiki-2010/marins_park_hotel_predst.png';
	if(r==3) pictures_room[r].src = '/grafiki-2010/marins_park_hotel_lux_studio.png';
    if(r==4) pictures_room[r].src = '/grafiki-2010/marins_park_hotel_lux_senior.png';
    if(r==5) pictures_room[r].src = '/grafiki-2010/marins_park_hotel_lux_premium.png';
	if(r==6) pictures_room[r].src = '/grafiki-2010/magnoliya_stand.png';
    if(r==7) pictures_room[r].src = '/grafiki-2010/magnoliya_stand_up.png';
    if(r==8) pictures_room[r].src = '/grafiki-2010/magnoliya_lux_2r.png';
	if(r==9) pictures_room[r].src = '/grafiki-2010/mayak_studio.png';
    if(r==10) pictures_room[r].src = '/grafiki-2010/mayak_lux.png';
   }   

function h_image()
   {   
    document.hotel.src = pictures[document.form_zakaz.select1.selectedIndex].src;	
	hh=document.form_zakaz.select1.selectedIndex;
	rr=document.form_zakaz.select2.selectedIndex;
	if (hh==0){r=rr};
	if (hh==1){r=rr+6};
	if (hh==2){r=rr+9}
	document.room.src = pictures_room[r].src;	
   }

function load_elements()
   {   
    document.hotel.src = pictures[document.form_zakaz.select1.selectedIndex].src;
	hh=document.form_zakaz.select1.selectedIndex;
	rr=document.form_zakaz.select2.selectedIndex;
	if (hh==0){r=rr};
	if (hh==1){r=rr+6};
	if (hh==2){r=rr+9}
	document.room.src = pictures_room[r].src;
	
   }   
   
 function f_datagost(){
	
	m=document.form_zakaz.select1.selectedIndex;

	switch(m){
		case 0: 
		
		document.form_zakaz.select_data.length=3;
		document.form_zakaz.select_data.options[0].value='C 15.09 по 19.09'; 
		document.form_zakaz.select_data.options[0].text='C 15.09 по 19.09';
		document.form_zakaz.select_data.options[1].value='C 16.09 по 20.09';
		document.form_zakaz.select_data.options[1].text='C 16.09 по 20.09'; 
		document.form_zakaz.select_data.options[2].value='Другие даты';
		document.form_zakaz.select_data.options[2].text='Другие даты';
		break;
		
		case 1:
		document.form_zakaz.select_data.length=2; 
		document.form_zakaz.select_data.options[0].value='C 16.09 по 19.09';
		document.form_zakaz.select_data.options[0].text='C 16.09 по 19.09';
		document.form_zakaz.select_data.options[1].value='Другие даты';
		document.form_zakaz.select_data.options[1].text='Другие даты';
		break;
		
		case 2:
		document.form_zakaz.select_data.length=2; 
		document.form_zakaz.select_data.options[0].value='C 16.09 по 19.09';
		document.form_zakaz.select_data.options[0].text='C 16.09 по 19.09';
		document.form_zakaz.select_data.options[1].value='Другие даты';
		document.form_zakaz.select_data.options[1].text='Другие даты';
		break;
				
		default:
		
		document.form_zakaz.select_data.length=4;
		document.form_zakaz.select_data.options[0].value='C 15.09 по 19.09';
		document.form_zakaz.select_data.options[0].text='C 15.09 по 19.09';
		document.form_zakaz.select_data.options[1].value='C 16.09 по 19.09';
		document.form_zakaz.select_data.options[1].text='C 16.09 по 19.09'; 
		document.form_zakaz.select_data.options[2].value='C 16.09 по 20.09';
		document.form_zakaz.select_data.options[2].text='C 16.09 по 20.09';
		document.form_zakaz.select_data.options[3].value='Другие даты';
		document.form_zakaz.select_data.options[3].text='Другие даты';
		break;

}
}

function f_data(){
v=document.form_zakaz.select1.options.selectedIndex;	
switch(v) {
	case 0:
		if (document.form_zakaz.select_data.options.selectedIndex==2){
			document.getElementById('id_1').style.display='inline';
			document.getElementById('id_2').style.display='inline';
			document.getElementById('id_3').style.display='inline';
		
			} else {
			document.getElementById('id_1').style.display='none';
			document.getElementById('id_2').style.display='none';
			document.getElementById('id_3').style.display='none';
		
			};
		break;
	case 1:
		if (document.form_zakaz.select_data.options.selectedIndex==1){
			document.getElementById('id_1').style.display='inline';
			document.getElementById('id_2').style.display='inline';
			document.getElementById('id_3').style.display='inline';
		
			} else {
			document.getElementById('id_1').style.display='none';
			document.getElementById('id_2').style.display='none';
			document.getElementById('id_3').style.display='none';
		
			};
		break;	
	case 2:
		if (document.form_zakaz.select_data.options.selectedIndex==1){
			document.getElementById('id_1').style.display='inline';
			document.getElementById('id_2').style.display='inline';
			document.getElementById('id_3').style.display='inline';
		
			} else {
			document.getElementById('id_1').style.display='none';
			document.getElementById('id_2').style.display='none';
			document.getElementById('id_3').style.display='none';
		
			};
		break;	
}
} 


function f_form_submit(){
	var m_text1=document.form_zakaz.zakaz_company.value;
	var m_text2=document.form_zakaz.zakaz_f_i_o.value;
	var m_text3=document.form_zakaz.zakaz_phone.value;
	var m_text4=document.form_zakaz.zakaz_mail.value;
	
	if(m_text4 == ""){window.alert('Заполните поле : Ваш E-mail');}
	if(m_text3 == ""){window.alert('Заполните поле : Телефон');}
	if(m_text2 == ""){window.alert('Заполните поле : ФИО контактного лица');}
	if(m_text1 == ""){window.alert('Заполните поле : Наименование компании');}
	if(m_text1!='' & m_text2!=''& m_text3!='' & m_text4!=''){
		
		document.form_zakaz.submit();
		
	}
	
}

m_Mass=new Array();
m_Mass["marins_park_hotel"]=new Array("«Джуниор» стандарт", "«Стандарт» стандарт", "«Представительский»", "«Люкс студио»", "«Люкс Сениор»", "«Люкс Премиум»");
m_Mass["magnoliya"]=new Array("Стандарт", "Стандарт УП", "Люкс двухкомнатный");
m_Mass["mayak"]=new Array("Студио", "Люкс");

function f_change(){
	m_index=document.form_zakaz.select1.value;
	
	switch (m_index){
		   
        default: document.form_zakaz.select2.length=m_Mass[m_index].length;
	                           
		                for(i=0; i<m_Mass[m_index].length; i++) {
		
		                  document.form_zakaz.select2.options[i].value=m_Mass[m_index][i];
		                  document.form_zakaz.select2.options[i].text=m_Mass[m_index][i];
		                  document.form_zakaz.select2.options[i].setAttribute('title', m_Mass[m_index][i]);
						  }
	                      document.form_zakaz.select2.removeAttribute('disabled'); 
						  document.getElementById('id_1').style.display='none';
						  document.getElementById('id_2').style.display='none';
						  document.getElementById('id_3').style.display='none';break; 
	}	
}



function f_change_1(){
	
	hh=document.form_zakaz.select1.selectedIndex;
	rr=document.form_zakaz.select2.selectedIndex;
	if (hh==0){r=rr};
	if (hh==1){r=rr+6};
	if (hh==2){r=rr+9}
	document.room.src = pictures_room[r].src;	
	      
}
