//var idf_prev;
//var idf;
//var src_over;
//jQuery(document).ready(function($){
$(function(){
//var $ = jQuery;
//$(document).ready(function(){

/*
	if(location.href.indexOf('giloy')!=-1){$('li#giloy').addClass('active');}
	if(location.href.indexOf('infra')!=-1){$('li#infra').addClass('active');src_data='/la/content/images/plan1.jpg';}//$('.inner img').attr({'id':'plan1'});
	if(location.href.indexOf('plan')!=-1){$('li#plan').addClass('active');}
	if(location.href.indexOf('object')!=-1){$('li#object').addClass('active');src_data='/la/content/images/plan3.jpg';}//*$('.inner img').attr({'id':'plan3'});
	if(location.href.indexOf('doc')!=-1){$('li#doc').addClass('active');}
	if(location.href.indexOf('gal')!=-1){$('li#gal').addClass('active');}
	if(location.href.indexOf('new')!=-1){$('li#new').addClass('active');}
	if(location.href.indexOf('faq')!=-1){$('li#faq').addClass('active');}
	if(location.href.indexOf('contact')!=-1){$('li#contact').addClass('active');}
*/	
    $('#sub').click(function(){
		mes=$('#mes').val();
        email=$('#email').val();
		//myre=/^[0-9-()]+$/i;
		myre=/^[a-zA-Z_0.-9-]+@[a-zA-Z_0-9-]+.[a-zA-Z]{2,3}$/i;
        proof=myre.exec(email);//console.log(mes,email,proof);
        if(mes!='' && email!='' && proof!=null){return true;}
        else{
			$('#mes_faq').appendTo('#content').css({'color':'#e65533'}).html('не все поля заполнены и/или ошибка ввода данных');
			return false;
		}
    });
/*	
                  var iv2 = $("#viewer2").iviewer(
                  {
                      //src: "/la/content/images/plan1.jpg"
                      src: src_data
                  });	
*/				  
/*	
  $("#infra_script img").draggable({
  	cursor: "move"
  });
  */
/*
	$('.inner img#plan1').addimagezoom({
		zoomrange: [1, 7],
		magnifiersize: [300,380],
		magnifierpos: 'left',
		cursorshade: true,
		largeimage: '/la/content/images/plan1.jpg' //<-- No comma after last option!
	}) 
	$('.inner img#plan3').addimagezoom({
		zoomrange: [1, 7],
		magnifiersize: [300,380],
		magnifierpos: 'left',
		cursorshade: true,
		largeimage: '/la/content/images/plan3.jpg' //<-- No comma after last option!
	})	
*/
})
function gal_click(ob){
	src_1=$(ob).attr('src');
	src_2=$(ob).next('.over').attr('src');//console.log(src_1,src_2);
	$(ob).attr({'src':src_2});
	$(ob).next('.over').attr({'src':src_1});
	if(src_2.indexOf('gal_over')!=-1){src_2=src_1;}
	dot=src_2.indexOf('.');
	src_b=src_2.substr(0,dot)+'_b.jpg';
	$('#gal_img').attr({'src':src_b});//console.log($(ob).hasClass('active'),dot,src_1,src_2,src_b);
}
function gal_over(ob){
	//$(ob).addClass('active');
	src_1=$(ob).attr('src');
	src_2=$(ob).next('.over').attr('src');
	$(ob).attr({'src':src_2});
	$(ob).next('.over').attr({'src':src_1});
}
function gal_out(ob){
	src_1=$(ob).attr('src');
	src_2=$(ob).next('.over').attr('src');
	$(ob).attr({'src':src_2});
	$(ob).next('.over').attr({'src':src_1});
}
//var cl=0;
/*
function zoom(ob){
	//cl++;
	id=$(ob).attr('id');
	width_t=$('#infra_script img').width()+'px';
	console.log(id,width_t);
	if(width_t=='780px' && id=='plus'){setz=2;}
	if(width_t=='985px' && id=='plus'){setz=3;}
	if(width_t=='1190px' && id=='plus'){setz=4;}
	if(width_t=='1395px' && id=='plus'){setz=5;}
	if(width_t=='985px' && id=='minus'){setz=1;}
	if(width_t=='1190px' && id=='minus'){setz=2;}
	if(width_t=='1395px' && id=='minus'){setz=3;}
	if(width_t=='1600px' && id=='minus'){setz=4;}
	
	if(setz==1){img_width='780px';img_height='380px';w=780;h=380;}
	if(setz==2){img_width='985px';img_height='585px';w=985;h=585;}
	if(setz==3){img_width='1190px';img_height='790px';w=1190;h=790;}
	if(setz==4){img_width='1395px';img_height='995px';w=1395;h=995;}
	if(setz==5){img_width='1600px';img_height='1200px';w=1600;h=1200;}
	margin_left=-w/2;
	margin_top=-h/2;
	//$('#infra_script img').css({'width':img_width,'height':img_height,'left':img_left,'top':img_top});
	$('#infra_script img').css({'left':'50%','top':'50%','width':img_width,'height':img_height,'marginLeft':margin_left,'marginTop':margin_top});
}*/
