﻿var mmtoid = null;
function showvt(){ 
	if(typeof( WP('TWVtour').div )=='undefined'){ 
		WP('TWVtour').newwin().param({ storedrag:false, html:'<iframe id="helpIF" width="750" height="500" src="http://test44.webpokaz.ru/media/vtours/Project2/vtour.html" frameborder="no"></iframe>', background:'#ededf5' }).settitle('webPOKAZ.ru - Справочная информация');
	}; 
	WP('TWVtour').show(); 
};
function showvideo(path){ 
	if(typeof( WP('Videohelp').div )=='undefined'){ 
		WP('Videohelp').newwin().param({ storedrag:false, html:'<iframe id="video" width="801" height="506" src="" frameborder="no"></iframe>', background:'#ededf5' }).settitle('webPOKAZ.ru - Демонстрационное видео');
	}; 
	if(path!=$('#video').attr('src')){ $('#video').attr({ src:path }); };
	
	WP('Videohelp').show(); 
};
function showform(){ 
	if(typeof( WP('form').div )=='undefined'){ 
		WP('form').newwin().param({ storedrag:false, html:'<iframe width="750" height="500" src="http://autozigulya.ru/sendmail/" frameborder="no"></iframe>', background:'#ededf5' }).settitle('webPOKAZ.ru - Справочная информация');
		WP('form').bind('onhide',function(){ window.location.reload( true); });
		
	}; 
	WP('form').show();
};
function showhelp(){ 
	if(typeof( WP('Help').div )=='undefined'){ 
		WP('Help').newwin().param({ storedrag:false, html:'<iframe id="helpIF" width="801" height="506" src="/help/" frameborder="no"></iframe>', background:'#ededf5' }).settitle('webPOKAZ.ru - Справочная информация') 
	}; 
	WP('Help').show(); 
};
function menustay(){ 
	if($.cookie('webpokaz_menu_stay')=='stay'){ $.cookie('webpokaz_menu_stay', 'auto', { path: '/', expires: 999 }); 
		$.cookie('webpokaz_menu', 'show', { path: '/' });$('#headmenu').css({ 'margin-bottom':'-40px' });
		$('#stay').css({ background:'#333333' }); $('#staybtn').attr({ title:'Зафиксировать панель' }); 
	} else { $.cookie('webpokaz_menu_stay', 'stay', { path: '/', expires: 999 }); $('#headmenu').css({ 'margin-bottom':'0px' }); 
		$('#stay').css({ background:'#bbb' }); $('#staybtn').attr({ title:'Убирать панель автоматически' }); 
	};
};
function menuhide(s){ 
	if($.cookie('webpokaz_menu_stay')=='auto'){
		if(!s){ clearTimeout(mmtoid);
			mmtoid = setTimeout(function(){ $.cookie('webpokaz_menu', 'show', { path: '/' });
					$('#headmenu, .mmtr').stop(); $('#headmenu').animate({ top:'0px' },'fast'); $('.mmtr').css({ opacity:'1' }); }, 150 );
		} else { clearTimeout(mmtoid);
			var hs=(typeof($.cookie('webpokaz_menu'))!='string')?2000:'slow';
			mmtoid = setTimeout(function(){ $.cookie('webpokaz_menu', 'hide', { path: '/' });
					$('#headmenu').animate({ top:menuhidetop },hs); $('.mmtr').animate({ opacity:'0' },hs); },s );
		}
	}
};

var menuhidetop=($.browser.msie)?'-37px':'-36px'; 
if($.cookie('webpokaz_menu_stay')!='auto'){ $.cookie('webpokaz_menu_stay', 'stay', { path: '/', expires: 999 }); 
	$('#headmenu').css({ 'margin-bottom':'0px' }); $('#stay').css({ background:'#bbb' }); $('#staybtn').attr({ title:'Убирать панель автоматически' });
} else { 
	$('#headmenu').css({ 'margin-bottom':'-40px' }); $('#staybtn').attr({ title:'Зафиксировать панель' });
};
	if($.cookie('webpokaz_menu')=='hide'){ 
		$('#headmenu').css({ top:menuhidetop }); $('.mmtr').css({ 'opacity':0 });
	} else { menuhide(1000); }
$('#headmenu').hover(function(){ menuhide(); }, function(){ menuhide(700); });
