//для выпадающего меню
function menuDropEnable(id){

//get effect type from 
var childDrop = jQuery.noConflict();
	
childDrop('#parent_'+id).attr('style','position:relative; background-image: url(/img/menu_selected.jpg); background-repeat:no-repeat; float:left; padding-top:12px; height:30px; padding-left:25px; padding-right:25px;');
childDrop('#childDrop_'+id).attr('style','width:130px; position:absolute; left:0px; z-index:10000; top:39px; display:block; background:#404040; text-align:left; padding-left:20px;');

	for(i=1;i<=100;i++){
		if(i!=id){
			childDrop('#parent_'+i).attr('style','float:left; padding-top:12px; height:28px; padding-left:25px; padding-right:25px;');
			childDrop('#childDrop_'+i).attr('style','display:none;');
		}	
	}

}
function menuDropDisable(id){
	
//get effect type from 
var childDrop = jQuery.noConflict();
	
childDrop('#parent_'+id).attr('style','float:left; padding-top:12px; height:28px; padding-left:25px; padding-right:25px;');
childDrop('#childDrop_'+id).attr('style','display:none;');
}

//скроем алерты
function hide_thanks(){

//get effect type from 
var child = jQuery.noConflict();
//run the effect

child('#thanks').attr('style','position:absolute; display:none; width:705px; padding:0px; text-align:center; background-color:#ffffff;');
				
}

//установим высоту окна контента в браузере
function getClientHeight() {
return document.compatMode=='CSS1Compat' || !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}
function setTrueHeight() {
trueheight = getClientHeight(); 
// здесь можно вставить любую функцию рассчитывающую высоту блока
document.getElementById("box").style.height = (trueheight) + "px";
}

//откроем по клику подразделы каталога
function toggle(id){

	//get effect type from 
	var child = jQuery.noConflict();
	var parent = jQuery.noConflict();
	var sh = jQuery.noConflict();
	var plug = jQuery.noConflict();
	//run the effect
	if ( child('#child_'+(id)).is(':visible') ){  
	child('#child_'+(id)).attr('style','position:absolute; top:41px; left:20px; display:none;');
	parent('#parent_'+(id)).attr('style','float:left; padding-top:12px; height:28px; padding-left:25px; padding-right:25px;');
	plug('#plug').attr('style','position: absolute; top:39px; left:0px; width:934px; height:31px; background-color:#ffffff; display:block;');
	}else{
	child('#child_'+(id)).attr('style','position:absolute; top:41px; left:20px; display:block;');
	parent('#parent_'+(id)).attr('style',' background-image: url(/img/menu_selected.jpg); background-repeat:no-repeat; float:left; padding-top:12px; height:30px; padding-left:25px; padding-right:25px; color:#ffffff; font-size:13px; font-family:Tahoma; outline-width:0;');
	if(id!==6){
	plug('#plug').attr('style','position: absolute; top:39px; left:0px; width:934px; height:31px; background-color:#ffffff; display:none;');
	}else{
	plug('#plug').attr('style','position: absolute; top:39px; left:0px; width:934px; height:31px; background-color:#ffffff; display:block;');
	}
		for(var i=1;i<=7;i++){
		
			if(i!==id){
			child('#child_'+(i)).attr('style','position:absolute; top:41px; left:20px; display:none;');
			parent('#parent_'+(i)).attr('style','float:left; padding-top:12px; height:28px; padding-left:25px; padding-right:25px; outline-width:0;');
			} 
			
		}
	
	}
	
}

//заявка для подписки

function validator_s(){
	
var sf = jQuery.noConflict();

							
	if(sf('#email_s').val() !== ''){
	sf('#email_warn_s').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:127px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
	
	
		//ajax
		
		var cap = sf('#captcha_s').val();
		sf.get("/core/includes/validate.php", { captcha: cap },
		  function(data){
											
					if(data=='ok'){
					sf('#captcha_warn_s').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
					sf('#form_subscription').submit();
					}else{
						
					sf('#captcha_warn_s').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
					return false;
					}
	
	
		  });
	
	}else{
	sf('#email_warn_s').attr('style','position:absolute; width:20px; height:20px; left: 600px; top:20px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
	return false;
	}
						
							
		

}

//заявка для конструктора

function validator_k(){
	
var sf = jQuery.noConflict();

		if(sf('#fio_k1').val() !== ''){
		sf('#fio_warn_k1').attr('style','position:absolute; width:20px; height:20px; left: 551px; top:28px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				
				if(sf('#fio_k2').val() !== ''){
				sf('#fio_warn_k2').attr('style','position:absolute; width:20px; height:20px; left: 443px; top:28px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				
					if(sf('#fio_k3').val() !== ''){
					sf('#fio_warn_k3').attr('style','position:absolute; width:20px; height:20px; left: 365px; top:28px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
							
							if(sf('#phone_k').val() !== ''){
							sf('#phone_warn_k').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:78px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
							
							
								if(sf('#email_k').val() !== ''){
								sf('#email_warn_k').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:127px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
								
								
									//ajax
									
									var cap = sf('#captcha_k').val();
									sf.get("/core/includes/validate.php", { captcha: cap },
									  function(data){
																		
												if(data=='ok'){
												sf('#captcha_warn_k').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
												sf('#form_konstruktor').submit();
												}else{
													
												sf('#captcha_warn_k').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
												return false;
												}
								
								
									  });
								
								}else{
								sf('#email_warn_k').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:127px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
								return false;
								}
						
							}else{
							sf('#phone_warn_k').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:78px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
							return false;
							}
							
							
						}else{
						sf('#fio_warn_k3').attr('style','position:absolute; width:20px; height:20px; left: 365px; top:28px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');	
						return false;	
						}

				}else{
				sf('#fio_warn_k2').attr('style','position:absolute; width:20px; height:20px; left: 443px; top:28px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');	
				return false;	
				}
		}else{
		sf('#fio_warn_k1').attr('style','position:absolute; width:20px; height:20px; left: 551px; top:28px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');	
		return false;	
		}
		

}

//работаем с заявкой с сайта

function validator(){

var sf = jQuery.noConflict();
var disk_check=0;
var check_main=0;
var quest_check=0;
	//проверим если открыт раздел заказать диск
	if(sf('#disk').is(':checked')==true){
	
		//city
		if(sf('#city').val() !== ''){
		sf('#city_warn').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:28px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
		
			//index
			if(sf('#index').val() !== ''){
			sf('#index_warn').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:76px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
			
				//address
				if(sf('#address').val() !== ''){
				sf('#address_warn').attr('style','position:absolute; width:20px; height:20px; left: 524px; top:125px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				disk_check=1;				
				}else{
				sf('#address_warn').attr('style','position:absolute; width:20px; height:20px; left: 524px; top:125px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
				
				}
			
			}else{
			sf('#index_warn').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:76px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
			
			}
		
		}else{
		sf('#city_warn').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:28px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
		
		}
			
	
	}
	
	//проверим если открыт раздел вопрос
	
	if(sf('#quest').is(':checked')==true){
	
		//quest_text
		if(sf('#quest_text').val() !== ''){
		sf('#quest_text_warn').attr('style','position:absolute; width:20px; height:20px; left: 524px; top:29px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
		quest_check=1;
		}else{
		sf('#quest_text_warn').attr('style','position:absolute; width:20px; height:20px; left: 524px; top:29px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
		}
	
	}
	
	//проверим чекбоксы
	if(sf('#disk').is(':checked')==false && sf('#call').is(':checked')==false && sf('#quest').is(':checked')==false){
    sf('#checks_warn').attr('style','position:absolute; width:20px; height:20px; left: 197px; top:216px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
	}else{
	sf('#checks_warn').attr('style','position:absolute; width:20px; height:20px; left: 197px; top:216px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
	
		//fio
		if(sf('#fio1').val() !== ''){
		sf('#fio_warn1').attr('style','position:absolute; width:20px; height:20px; left: 365px; top:35px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
			
			if(sf('#fio2').val() !== ''){
			sf('#fio_warn2').attr('style','position:absolute; width:20px; height:20px; left: 443px; top:35px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				
				if(sf('#fio3').val() !== ''){
				sf('#fio_warn3').attr('style','position:absolute; width:20px; height:20px; left: 551px; top:35px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
		
					//phone
					if(sf('#phone').val() !== ''){
					sf('#phone_warn').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:80px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
					check_main=1;
					
					}else{
					sf('#phone_warn').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:80px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
					}
					
				}else{
				sf('#fio_warn3').attr('style','position:absolute; width:20px; height:20px; left: 551px; top:35px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
				}
				
			}else{
			sf('#fio_warn2').attr('style','position:absolute; width:20px; height:20px; left: 443px; top:35px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
			}
		
		}else{
		sf('#fio_warn1').attr('style','position:absolute; width:20px; height:20px; left: 365px; top:35px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
		}
		
	
	}
	

	//final
	
	if(check_main==1 && quest_check==1 && sf('#quest').is(':checked')==true && disk_check==1 && sf('#disk').is(':checked')==true){

     //ajax
	var cap = sf('#captcha').val();
	sf.get("/core/includes/validate.php", { captcha: cap },
	  function(data){
	    
				
				if(data=='ok'){
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				sf('#form_send').submit();
				}else{
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
				}


	  });           
	
	}else if(check_main==1 && quest_check==1 && sf('#quest').is(':checked')==true && sf('#disk').is(':checked')==false){

	//ajax
	var cap = sf('#captcha').val();
	sf.get("/core/includes/validate.php", { captcha: cap },
	  function(data){
	    
				
				if(data=='ok'){
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				sf('#form_send').submit();
				}else{
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
				}


	  });
	  
	}else if(check_main==1 && sf('#quest').is(':checked')==false && disk_check==1 && sf('#disk').is(':checked')==true){

	//ajax
	var cap = sf('#captcha').val();
	sf.get("/core/includes/validate.php", { captcha: cap },
	  function(data){
	    
				
				if(data=='ok'){
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				sf('#form_send').submit();
				}else{
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
				}


	  });
	  
	}else if(check_main==1 && sf('#quest').is(':checked')==false && sf('#disk').is(':checked')==false){

	//ajax
	var cap = sf('#captcha').val();
	sf.get("/core/includes/validate.php", { captcha: cap },
	  function(data){
	    
				
				if(data=='ok'){
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				sf('#form_send').submit();
				}else{
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
				}


	  });

	
	}

};


//работаем с заявкой с сайта

function validator_i(){

var sf = jQuery.noConflict();
var disk_check=0;
var check_main=0;
var quest_check=0;
	//проверим если открыт раздел заказать диск
	if(sf('#disk').is(':checked')==true){
	
		//city
		if(sf('#city').val() !== ''){
		sf('#city_warn').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:28px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
		
			//index
			if(sf('#index').val() !== ''){
			sf('#index_warn').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:76px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
			
				//address
				if(sf('#address').val() !== ''){
				sf('#address_warn').attr('style','position:absolute; width:20px; height:20px; left: 524px; top:125px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				disk_check=1;				
				}else{
				sf('#address_warn').attr('style','position:absolute; width:20px; height:20px; left: 524px; top:125px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
				
				}
			
			}else{
			sf('#index_warn').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:76px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
			
			}
		
		}else{
		sf('#city_warn').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:28px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
		
		}
			
	
	}
	
	//проверим если открыт раздел вопрос
	
	if(sf('#quest').is(':checked')==true){
	
		//quest_text
		if(sf('#quest_text').val() !== ''){
		sf('#quest_text_warn').attr('style','position:absolute; width:20px; height:20px; left: 524px; top:29px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
		quest_check=1;
		}else{
		sf('#quest_text_warn').attr('style','position:absolute; width:20px; height:20px; left: 524px; top:29px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
		}
	
	}
	
	//проверим чекбоксы
	if(sf('#disk').is(':checked')==false && sf('#call').is(':checked')==false && sf('#quest').is(':checked')==false){
    sf('#checks_warn').attr('style','position:absolute; width:20px; height:20px; left: 197px; top:216px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
	}else{
	sf('#checks_warn').attr('style','position:absolute; width:20px; height:20px; left: 197px; top:216px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
	
		//fio
		if(sf('#fio1').val() !== ''){
		sf('#fio_warn1').attr('style','position:absolute; width:20px; height:20px; left: 365px; top:35px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
			
			if(sf('#fio2').val() !== ''){
			sf('#fio_warn2').attr('style','position:absolute; width:20px; height:20px; left: 443px; top:35px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				
				if(sf('#fio3').val() !== ''){
				sf('#fio_warn3').attr('style','position:absolute; width:20px; height:20px; left: 551px; top:35px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
		
					//phone
					if(sf('#phone').val() !== ''){
					sf('#phone_warn').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:80px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
					check_main=1;
					
					}else{
					sf('#phone_warn').attr('style','position:absolute; width:20px; height:20px; left: 472px; top:80px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
					}
					
				}else{
				sf('#fio_warn3').attr('style','position:absolute; width:20px; height:20px; left: 551px; top:35px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
				}
				
			}else{
			sf('#fio_warn2').attr('style','position:absolute; width:20px; height:20px; left: 443px; top:35px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
			}
		
		}else{
		sf('#fio_warn1').attr('style','position:absolute; width:20px; height:20px; left: 365px; top:35px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
		}
		
	
	}
	

	//final
	
	if(check_main==1 && quest_check==1 && sf('#quest').is(':checked')==true && disk_check==1 && sf('#disk').is(':checked')==true){

     //ajax
	var cap = sf('#captcha_i').val();
	sf.get("/core/includes/validate.php", { captcha: cap },
	  function(data){
	    
				
				if(data=='ok'){
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				sf('#form_send').submit();
				}else{
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
				}


	  });           
	
	}else if(check_main==1 && quest_check==1 && sf('#quest').is(':checked')==true && sf('#disk').is(':checked')==false){

	//ajax
	var cap = sf('#captcha').val();
	sf.get("/core/includes/validate.php", { captcha: cap },
	  function(data){
	    
				
				if(data=='ok'){
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				sf('#form_send').submit();
				}else{
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
				}


	  });
	  
	}else if(check_main==1 && sf('#quest').is(':checked')==false && disk_check==1 && sf('#disk').is(':checked')==true){

	//ajax
	var cap = sf('#captcha').val();
	sf.get("/core/includes/validate.php", { captcha: cap },
	  function(data){
	    
				
				if(data=='ok'){
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				sf('#form_send').submit();
				}else{
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
				}


	  });
	  
	}else if(check_main==1 && sf('#quest').is(':checked')==false && sf('#disk').is(':checked')==false){

	//ajax
	var cap = sf('#captcha').val();
	sf.get("/core/includes/validate.php", { captcha: cap },
	  function(data){
	    
				
				if(data=='ok'){
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/checked.gif") no-repeat 0px 0px;');
				sf('#form_send').submit();
				}else{
				sf('#captcha_warn').attr('style','position:absolute; width:20px; height:20px; left: 320px; top:29px; display:block; background:url("/img/unchecked.gif") no-repeat 0px 0px;');
				}


	  });

	
	}

};
//откроем по клику  сегменты заявки

function show_request(){

	//get effect type from 
	var child = jQuery.noConflict();
	
	//run the effect
	if ( child('#added_request').is(':visible') ){  
	child('#added_request').attr('style','display:none; position:relative; width:591px; height:267px; background-color:#e6e6e6; margin-top:15px;');
	}else{
	child('#added_request').attr('style','display:block; position:relative; width:591px; height:267px; background-color:#e6e6e6; margin-top:15px;');
	}
	
}
function show_question(){

	//get effect type from 
	var child = jQuery.noConflict();
	
	//run the effect
	if ( child('#added_question').is(':visible') ){  
	child('#added_question').attr('style','display:none; position:relative; width:591px; height:115px; background-color:#e6e6e6; margin-top:15px;');
	}else{
	child('#added_question').attr('style','display:block; position:relative; width:591px; height:115px; background-color:#e6e6e6; margin-top:15px;');
	}
	
}
//////////////////////////
//конец работы с заявкой//
//////////////////////////
