// JavaScript Document


/*

	::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
	::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
	::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
	
		initiated by tomyccc 2011
		thank you for viewing here, but rush and dirty code here is due to vary issues.
		

	::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
	::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
	::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
	
	
*/

	
	

	function section_img_resize_position(){
		
		
		var sections = $('#content').find("section");
				var wtop = $(window).scrollTop();
				var wh = $(window).height();
				
				sections.each(function(){
		
					if(!anScrollTopBoo && !innerBoo){
						
						switch($(this).attr("id")){
							
							case 'home':
								if(wtop >= $(this).offset().top && wtop < $(this).offset().top+$(window).height() && !homeLayerBoo){
									
									var t = $(window).height()-($(window).scrollTop()-($(this).offset().top-$(window).height()));
									t = $(this).offset().top + t;
									
									if(location.hash == '#/home'){
										t = $(this).offset().top;
									}
									
									if(!$('#home').find("img").is(":visible")){
										$('#home').find("img").show();
									}
									
									if(!$('#home').find("div").is(":visible")){
										$('#home').find("div").show();
									}
									
									var no = $('#home').find("img").length;
									$('#home').find("img").each(function(){
										$(this).stop().animate({opacity: 1, "top":t+"px"}, no*300+200,'easeOutExpo', function(){
											  if(jQuery.browser.msie){
												this.style.removeAttribute('filter');
											  }
										});
										no--;
									});	
									
									var nos = $('#home').find("div").length;
									$('#home').find("div").each(function(){
										$(this).stop().animate({opacity: 1, "top":t+"px"}, nos*300+200,'easeOutExpo', function(){
											  if(jQuery.browser.msie){
												this.style.removeAttribute('filter');
											  }
										});
										nos--;
									});	
									
									
								}
							break;
							
							case 'awards':
							
								if(wtop+wh >= $(this).offset().top && wtop < $(this).offset().top+$(window).height() && !awardsLayerBoo){
									var t = $(window).height()-($(window).scrollTop()-($(this).offset().top-$(window).height()));
									t = $(this).offset().top + t;
									
									if(location.hash == '#/awards'){
										t = $(this).offset().top;
									}
									
									if(!$('#awards').find("img").is(":visible")){
										$('#awards').find("img").show();
									}
									
									if(!$('#awards').find("div").is(":visible")){
										$('#awards').find("div").show();
									}
									
									var no = $('#awards').find("img").length;
									$('#awards').find("img").each(function(){
										$(this).stop().animate({opacity: 1, "top":t+"px"}, no*300+200,'easeOutExpo', function(){
											  if(jQuery.browser.msie){
												this.style.removeAttribute('filter');
											  }
										});
										no--;
									});	
									
									var nos = $('#awards').find("div").length;
									$('#awards').find("div").each(function(){
										$(this).stop().animate({opacity: 1, "top":t+"px"}, nos*300+200,'easeOutExpo', function(){
											  if(jQuery.browser.msie){
												this.style.removeAttribute('filter');
											  }
										});
										nos--;
									});	
									
								}
							break;
								
							case 'festival':
								if(wtop+wh >= $(this).offset().top && wtop < $(this).offset().top+$(window).height() && !festivalLayerBoo){
									var t = $(window).height()-($(window).scrollTop()-($(this).offset().top-$(window).height()));
									t = $(this).offset().top + t;
									
									if(location.hash == '#/festival'){
										t = $(this).offset().top;
									}
									
									if(!$('#festival').find("img").is(":visible")){
										$('#festival').find("img").show();
									}
									
									if(!$('#festival').find("div").is(":visible")){
										$('#festival').find("div").show();
									}
									
									var no = $('#festival').find("img").length;
									$('#festival').find("img").each(function(){
										$(this).stop().animate({opacity: 1, "top":t+"px"}, no*300+200,'easeOutExpo', function(){
											  if(jQuery.browser.msie){
												this.style.removeAttribute('filter');
											  }
										});
										no--;
									});	
									
									var nos = $('#festival').find("div").length;
									$('#festival').find("div").each(function(){
										$(this).stop().animate({opacity: 1, "top":t+"px"}, nos*300+200,'easeOutExpo', function(){
											  if(jQuery.browser.msie){
												this.style.removeAttribute('filter');
											  }
										});
										nos--;
									});	
								}
							break;
							
							case 'cultivation':
								if(wtop+wh >= $(this).offset().top && wtop < $(this).offset().top+$(window).height() && !cultivationLayerBoo){
									var t = $(window).height()-($(window).scrollTop()-($(this).offset().top-$(window).height()));
									t = $(this).offset().top + t;
									
									if(location.hash == '#/cultivation'){
										//t = $(this).offset().top;
									}
									
									if(!$('#cultivation').find("img").is(":visible")){
										$('#cultivation').find("img").show();
									}
									
									if(!$('#cultivation').find("div").is(":visible")){
										$('#cultivation').find("div").show();
									}
									
									var no = $('#cultivation').find("img").length;
									$('#cultivation').find("img").each(function(){
										$(this).stop().animate({opacity: 1, "top":t+"px"}, no*300+100,'easeOutExpo', function(){
											  if(jQuery.browser.msie){
												this.style.removeAttribute('filter');
											  }
										});
										no--;
									});	
									
									var nos = $('#cultivation').find("div").length;
									$('#cultivation').find("div").each(function(){
										$(this).stop().animate({opacity: 1, "top":t+"px"}, nos*300+100,'easeOutExpo', function(){
											  if(jQuery.browser.msie){
												this.style.removeAttribute('filter');
											  }
										});
										nos--;
									});	
								}
							break;
							
							case 'engagement':
								if(wtop+wh >= $(this).offset().top && wtop < $(this).offset().top+$(window).height() && !engagementLayerBoo){
									var t = $(window).height()-($(window).scrollTop()-($(this).offset().top-$(window).height()));
									t = $(this).offset().top + t;
									
									if(location.hash == '#/engagement'){
										t = $(this).offset().top;
									}
									
									if(!$('#engagement').find("img").is(":visible")){
										$('#engagement').find("img").show();
									}
									
									if(!$('#engagement').find("div").is(":visible")){
										$('#engagement').find("div").show();
									}
									
									var no = $('#engagement').find("img").length;
									$('#engagement').find("img").each(function(){
										$(this).stop().animate({opacity: 1, "top":t+"px"}, no*300+100,'easeOutExpo', function(){
											  if(jQuery.browser.msie){
												this.style.removeAttribute('filter');
											  }
										});
										no--;
									});	
									
									var nos = $('#engagement').find("div").length;
									$('#engagement').find("div").each(function(){
										$(this).stop().animate({opacity: 1, "top":t+"px"}, nos*300+100,'easeOutExpo', function(){
											  if(jQuery.browser.msie){
												this.style.removeAttribute('filter');
											  }
										});
										nos--;
									});	
								}
							break;
						
						
						}
						
					
					}
					
				});
					
					
					
	}
	
	
	

	function mm_wrapper_scroll_to_section_update(){
		
						   				   
				var sections = $('#content').find("section");
				var wtop = $(window).scrollTop();
				var wh = $(window).height();
				
				sections.each(function(){
					
					if(!innerBoo && !anScrollTopBoo && !location.hash.match('page')){
						
						if($(this).attr("id") == 'home' && !location.hash.match('home') && wtop  >= $(this).offset().top && wtop < $(this).offset().top+wh){
							location.hash = '#/home';
							mm_wrapper_scroll_to_section(0);
						} else if($(this).attr("id") == 'awards' && !location.hash.match('awards') && wtop  >= $(this).offset().top && wtop < $(this).offset().top+wh){
							location.hash = '#/awards';
							mm_wrapper_scroll_to_section(0);
							
						}  else if($(this).attr("id") == 'festival' && !location.hash.match('festival') && wtop  >= $(this).offset().top && wtop < $(this).offset().top+wh){
							location.hash = '#/festival';
							mm_wrapper_scroll_to_section(1);
						}  else if($(this).attr("id") == 'cultivation' && !location.hash.match('cultivation') && wtop  >= $(this).offset().top && wtop < $(this).offset().top+wh){
							location.hash = '#/cultivation';
							mm_wrapper_scroll_to_section(2);
						}  else if($(this).attr("id") == 'engagement' && !location.hash.match('engagement') && wtop  >= $(this).offset().top && wtop < $(this).offset().top+wh){
							location.hash = '#/engagement';
							mm_wrapper_scroll_to_section(3);
						}
						
					}
					
    			});
				
				
				
	}
	
	
	function arrangement_layer_in(no){
		
		switch(no){
			
			case 0:
				engagement_layer_in(false);
				cultivation_layer_in(false);
				festival_layer_in(false);
				awards_layer_in(false);
				//home_layer_in(false);
					
				$('#home').find("img").css({"top":$(document).height()+"px"});
				$('#home').find("div").css({"top":$(document).height()+"px"});
			
				home_layer_in(true);
			break;
			case 1:
				engagement_layer_in(false);
				cultivation_layer_in(false);
				festival_layer_in(false);
				//awards_layer_in(false);
				home_layer_in(false);
				
				$('#awards').find("img").css({"top":$(document).height()+"px"});
				$('#awards').find("div").css({"top":$(document).height()+"px"});
			
				awards_layer_in(true);
			break;
			case 2:
				engagement_layer_in(false);
				cultivation_layer_in(false);
				//festival_layer_in(false);
				awards_layer_in(false);
				home_layer_in(false);
				
				$('#festival').find("img").css({"top":$(document).height()+"px"});
				$('#festival').find("div").css({"top":$(document).height()+"px"});
			
				festival_layer_in(true);
			break;
			case 3:
				engagement_layer_in(false);
				//cultivation_layer_in(false);
				festival_layer_in(false);
				awards_layer_in(false);
				home_layer_in(false);
				
				$('#cultivation').find("img").css({"top":$(document).height()+"px"});
				$('#cultivation').find("div").css({"top":$(document).height()+"px"});
			
				cultivation_layer_in(true);
			break;
			case 4:
				//engagement_layer_in(false);
				cultivation_layer_in(false);
				festival_layer_in(false);
				awards_layer_in(false);
				home_layer_in(false);
				
				$('#engagement').find("img").css({"top":$(document).height()+"px"});
				$('#engagement').find("div").css({"top":$(document).height()+"px"});
			
				engagement_layer_in(true);
			break;
			
			
		}
		
	}
	
	function mm_wrapper_scroll_to_section(no){
		mm_mdoBoo = true;
		 $('#mm_wrapper').stop().animate({scrollTop:(57+23*no)}, 800, 'easeInOutExpo', function(){
			mm_mdoBoo = false;
		 });
	}

	function scroll_to_section(){
		anScrollTopBoo = true;
		$('html,body').stop().animate({scrollTop: $(location.hash.replace('#/', '#')).offset().top}, 600,'easeInOutExpo', function() {
			anScrollTopBoo = false;
			}
		);
	}
	
	function scroll_to_section_from_innerpage(){
		anScrollTopBoo = true;
		$('html,body').stop().animate({scrollTop: $(location.hash.replace('#/', '#')).offset().top}, 20,'easeInOutExpo', function() {
			anScrollTopBoo = false;
			}
		);
	}
	
	function init_arrangement_layer_in_innerpage(){
		if(location.hash.match('home')){
				engagement_layer_in(false);
				cultivation_layer_in(false);
				festival_layer_in(false);
				awards_layer_in(false);
				//home_layer_in(false);
					
				if(!$('#home').find("img").is(":visible")){
					$('#home').find("img").stop().fadeIn(200);
				}
				
				if(!$('#home').find("div").is(":visible")){
					$('#home').find("div").stop().fadeIn(200);
				}
				
				$('#home').find("img").each(function(){
					$(this).css({opacity: 1, "top":$('#home').offset().top+"px"});
				});			
				
				$('#home').find("div").each(function(){
					$(this).css({opacity: 1, "top":$('#home').offset().top+"px"});
				});
		} else if(location.hash.match('awards')){
				engagement_layer_in(false);
				cultivation_layer_in(false);
				festival_layer_in(false);
				//awards_layer_in(false);
				home_layer_in(false);
					
				if(!$('#awards').find("img").is(":visible")){
					$('#awards').find("img").stop().fadeIn(200);
				}
				
				if(!$('#awards').find("div").is(":visible")){
					$('#awards').find("div").stop().fadeIn(200);
				}
				
				$('#awards').find("img").each(function(){
					$(this).css({opacity: 1, "top":$('#awards').offset().top+"px"});
				});			
				
				$('#awards').find("div").each(function(){
					$(this).css({opacity: 1, "top":$('#awards').offset().top+"px"});
				});
		} else if(location.hash.match('festival')){
			engagement_layer_in(false);
				cultivation_layer_in(false);
				//festival_layer_in(false);
				awards_layer_in(false);
				home_layer_in(false);
					
				if(!$('#festival').find("img").is(":visible")){
					$('#festival').find("img").stop().fadeIn(200);
				}
				
				if(!$('#festival').find("div").is(":visible")){
					$('#festival').find("div").stop().fadeIn(200);
				}
				
				$('#festival').find("img").each(function(){
					$(this).css({opacity: 1, "top":$('#festival').offset().top+"px"});
				});			
				
				$('#festival').find("div").each(function(){
					$(this).css({opacity: 1, "top":$('#festival').offset().top+"px"});
				});
		} else if(location.hash.match('cultivation')){
				engagement_layer_in(false);
				//cultivation_layer_in(false);
				festival_layer_in(false);
				awards_layer_in(false);
				home_layer_in(false);
					
				if(!$('#cultivation').find("img").is(":visible")){
					$('#cultivation').find("img").stop().fadeIn(200);
				}
				
				if(!$('#cultivation').find("div").is(":visible")){
					$('#cultivation').find("div").stop().fadeIn(200);
				}
				
				$('#cultivation').find("img").each(function(){
					$(this).css({opacity: 1, "top":$('#cultivation').offset().top+"px"});
				});			
				
				$('#cultivation').find("div").each(function(){
					$(this).css({opacity: 1, "top":$('#cultivation').offset().top+"px"});
				});
		} else if(location.hash.match('engagement')){
				//engagement_layer_in(false);
				cultivation_layer_in(false);
				festival_layer_in(false);
				awards_layer_in(false);
				home_layer_in(false);
					
				if(!$('#engagement').find("img").is(":visible")){
					$('#engagement').find("img").stop().fadeIn(200);
				}
				
				if(!$('#engagement').find("div").is(":visible")){
					$('#engagement').find("div").stop().fadeIn(200);
				}
				
				$('#engagement').find("img").each(function(){
					$(this).css({opacity: 1, "top":$('#engagement').offset().top+"px"});
				});			
				
				$('#engagement').find("div").each(function(){
					$(this).css({opacity: 1, "top":$('#engagement').offset().top+"px"});
				});
		}
	}
	
	function init_arrangement_layer_in(){
		if(location.hash.match('home')){
			arrangement_layer_in(0);
		} else if(location.hash.match('awards')){
			arrangement_layer_in(1);
		} else if(location.hash.match('festival')){
			arrangement_layer_in(2);
		} else if(location.hash.match('cultivation')){
			arrangement_layer_in(3);
		} else if(location.hash.match('engagement')){
			arrangement_layer_in(4);
		}
	}

	function mm_in(str){
		
			var isMainP = false;
		
			$('div.mainNavGroup').hide();
			
			
			var div_htmlContent = '';
			
			switch(str){
				default:
				case '#/home':
					isMainP = true;
					
					switch(lajq){
						default:
						case 0:
							div_htmlContent = '<ul class="navSection"><li><a href="#/others/page/about/">About ifva</a></li><li><a href="#/others/page/press/">Press</a></li><li><a href="#/others/page/publication/">Publication</a></li><li><a href="#/others/page/sponsorship/">Sponsorship</a></li><li><a href="#/others/page/faq/">FAQ</a></li><li><a href="#/others/page/links/">Links</a></li>';
						break;
						case 1:
							div_htmlContent = '<ul class="navSection"><li><a href="#/others/page/about/">關於 ifva</a></li><li><a href="#/others/page/press/">新聞發佈</a></li><li><a href="#/others/page/publication/">出版</a></li><li><a href="#/others/page/sponsorship/">贊助及合作</a></li><li><a href="#/others/page/faq/">常見問題</a></li><li><a href="#/others/page/links/">連結</a></li>';
							break;
						case 2:
							div_htmlContent = '<ul class="navSection"><li><a href="#/others/page/about/">关于 ifva</a></li><li><a href="#/others/page/press/">新闻发布</a></li><li><a href="#/others/page/publication/">出版</a></li><li><a href="#/others/page/sponsorship/">赞助及合作</a></li><li><a href="#/others/page/faq/">常见问题</a></li><li><a href="#/others/page/links/">连结</a></li>';
							break;
					}
					break;
				case '#/others_inner':
					
						
						
						switch(lajq){
							default:
							case 0:
								if(location.hash.match('about')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/others/page/about/">About ifva</a></li><li><a href="#/others/page/about/contact/">&nbsp;&nbsp;- Contact</a></li><li><a href="#/others/page/about/volunteer/">&nbsp;&nbsp;- Volunteer</a></li><li><a href="#/others/page/press/">Press</a></li><li><a href="#/others/page/publication/">Publication</a></li><li><a href="#/others/page/sponsorship/">Sponsorship</a></li><li><a href="#/others/page/faq/">FAQ</a></li><li><a href="#/others/page/links/">Links</a></li>';
								} else {
									div_htmlContent = '<ul class="navSection"><li><a href="#/others/page/about/">About ifva</a></li><li><a href="#/others/page/press/">Press</a></li><li><a href="#/others/page/publication/">Publication</a></li><li><a href="#/others/page/sponsorship/">Sponsorship</a></li><li><a href="#/others/page/faq/">FAQ</a></li><li><a href="#/others/page/links/">Links</a></li>';
								}
							break;
							case 1:
								if(location.hash.match('about')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/others/page/about/">關於 ifva</a></li><li><a href="#/others/page/about/contact/">&nbsp;&nbsp;- 聯絡我們</a></li><li><a href="#/others/page/about/volunteer/">&nbsp;&nbsp;- 志願團</a></li><li><a href="#/others/page/press/">新聞發佈</a></li><li><a href="#/others/page/publication/">出版</a></li><li><a href="#/others/page/sponsorship/">贊助及合作</a></li><li><a href="#/others/page/faq常見問題</a></li><li><a href="#/others/page/links/">連結</a></li>';
								} else {
									div_htmlContent = '<ul class="navSection"><li><a href="#/others/page/about/">關於 ifva</a></li><li><a href="#/others/page/press/">新聞發佈</a></li><li><a href="#/others/page/publication/">出版</a></li><li><a href="#/others/page/sponsorship/">贊助及合作</a></li><li><a href="#/others/page/faq/">常見問題</a></li><li><a href="#/others/page/links/">連結</a></li>';
								}
							break;
							case 2:
								if(location.hash.match('about')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/others/page/about/">关于 ifva</a></li><li><a href="#/others/page/about/contact/">&nbsp;&nbsp;- 联络我们</a></li><li><a href="#/others/page/about/volunteer/">&nbsp;&nbsp;- 志愿团</a></li><li><a href="#/others/page/press/">新闻发布</a></li><li><a href="#/others/page/publication/">出版</a></li><li><a href="#/others/page/sponsorship/">赞助及合作</a></li><li><a href="#/others/page/faq常见问题</a></li><li><a href="#/others/page/links/">连结</a></li>';
								} else {
									div_htmlContent = '<ul class="navSection"><li><a href="#/others/page/about/">关于 ifva</a></li><li><a href="#/others/page/press/">新闻发布</a></li><li><a href="#/others/page/publication/">出版</a></li><li><a href="#/others/page/sponsorship/">赞助及合作</a></li><li><a href="#/others/page/faq/">常见问题</a></li><li><a href="#/others/page/links/">连结</a></li>';
								}
							break;
						}
						
						
						
					
					break;
					
				case '#/awards':
					isMainP = true;
					
					switch(lajq){
						default:
						case 0:
							div_htmlContent = '<ul class="navSection_w"><li><a href="#/awards/page/the17th/">17th ifva Awards</a></li><li><a href="#/awards/page/jury/">Past Jury Panel</a></li><li><a href="#/awards/page/titles/">Past Award Winning Titles</a></li><li><a href="#/awards/page/transcript/">Past Jury Meeting Transcript</a></li>';
						break;
						case 1:
							div_htmlContent = '<ul class="navSection_w"><li><a href="#/awards/page/the17th/">第十七屆ifva比賽</a></li><li><a href="#/awards/page/jury/">歷屆評審團名單</a></li><li><a href="#/awards/page/titles/">歷屆得獎名單</a></li><li><a href="#/awards/page/transcript/">歷屆評審小組會議紀錄</a></li>';
						break;
						case 2:
							div_htmlContent = '<ul class="navSection_w"><li><a href="#/awards/page/the17th/">第十七届ifva比赛</a></li><li><a href="#/awards/page/jury/">历届评审团名单</a></li><li><a href="#/awards/page/titles/">历届得奖名单</a></li><li><a href="#/awards/page/transcript/">历届评审小组会议纪录</a></li>';
						break;
					}
					
					
					break;
				case '#/awards_inner':
				
					switch(lajq){
							default:
							case 0:
								if(location.hash.match('the17th')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/awards/page/the17th/">17th ifva Awards</a></li><li><a href="#/awards/page/the17th/details">&nbsp;&nbsp;- Regulation & Details</a></li><li><a href="#/awards/page/the17th/jury">&nbsp;&nbsp;- Jury Panel</a></li><li><a href="#/awards/page/the17th/finalist">&nbsp;&nbsp;- Finalist</a></li><li><a href="#/awards/page/the17th/partners">&nbsp;&nbsp;- Partners</a></li><li><a href="#/awards/page/jury/">Past Jury Panel</a></li><a href="#/awards/page/titles/">Past Award Winning Titles</a></li><li><a href="#/awards/page/transcript/">Past Jury Meeting Transcript</a></li>';
								} else {
								div_htmlContent = '<ul class="navSection"><li><a href="#/awards/page/the17th/">17th ifva Awards</a><li><a href="#/awards/page/jury/">Past Jury Panel</a></li><a href="#/awards/page/titles/">Past Award Winning Titles</a></li><li><a href="#/awards/page/transcript/">Past Jury Meeting Transcript</a></li>';
								}
								break;
							case 1:
								if(location.hash.match('the17th')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/awards/page/the17th/">第十七屆ifva比賽</a></li><li><a href="#/awards/page/the17th/details">&nbsp;&nbsp;- 參賽詳情及規則</a></li><li><a href="#/awards/page/the17th/jury">&nbsp;&nbsp;- 評審團名單</a></li><li><a href="#/awards/page/the17th/finalist">&nbsp;&nbsp;- 入圍名單</a></li><li><a href="#/awards/page/the17th/partners">&nbsp;&nbsp;- 合作夥伴</a></li><li><a href="#/awards/page/jury/">歷屆評審團名單</a></li><a href="#/awards/page/titles/">歷屆得獎名單</a></li><li><a href="#/awards/page/transcript/">歷屆評審小組會議紀錄</a></li>';
								} else {
								div_htmlContent = '<ul class="navSection"><li><a href="#/awards/page/the17th/">第十七屆ifva比賽</a><li><a href="#/awards/page/jury/">歷屆評審團名單</a></li><a href="#/awards/page/titles/">歷屆得獎名單</a></li><li><a href="#/awards/page/transcript/">歷屆評審小組會議紀錄</a></li>';
								}
							break;
							case 2:
								if(location.hash.match('the17th')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/awards/page/the17th/">第十七届ifva比赛</a></li><li><a href="#/awards/page/the17th/details">&nbsp;&nbsp;- 参赛详情及规则</a></li><li><a href="#/awards/page/the17th/jury">&nbsp;&nbsp;- 评审团名单</a></li><li><a href="#/awards/page/the17th/finalist">&nbsp;&nbsp;- 入围名单</a></li><li><a href="#/awards/page/the17th/partners">&nbsp;&nbsp;- 合作伙伴</a></li><li><a href="#/awards/page/jury/">历届评审团名单</a></li><a href="#/awards/page/titles/">历届得奖名单</a></li><li><a href="#/awards/page/transcript/">历届评审小组会议纪录</a></li>';
								} else {
								div_htmlContent = '<ul class="navSection"><li><a href="#/awards/page/the17th/">第十七届ifva比赛</a><li><a href="#/awards/page/jury/">历届评审团名单</a></li><a href="#/awards/page/titles/">历届得奖名单</a></li><li><a href="#/awards/page/transcript/">历届评审小组会议纪录</a></li>';
								}
							break;
					}
					
					
					
					
					break;
			
				case '#/festival':
					isMainP = true;
					switch(lajq){
							default:
							case 0:
								div_htmlContent = '<ul class="navSection"><li><a href="#/festival/page/the17th/">17th ifva Festival</a></li><li><a href="#/festival/page/past_festival/">Past ifva Festival</a></li>';
							break;
							case 1:
								div_htmlContent = '<ul class="navSection"><li><a href="#/festival/page/the17th/">第十七屆ifva節</a></li><li><a href="#/festival/page/past_festival/">歷屆ifva節</a></li>';
							break;
							case 2:
								div_htmlContent = '<ul class="navSection"><li><a href="#/festival/page/the17th/">第十七届ifva节</a></li><li><a href="#/festival/page/past_festival/">历届ifva节</a></li>';
							break;
					}
					break;
				case '#/festival_inner':
					
					switch(lajq){
							default:
							case 0:
								if(location.hash.match('the17th')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/festival/page/the17th/">17th ifva Festival</a></li><li><a href="#/festival/page/the17th/schedule/">&nbsp;&nbsp;- Festival Event Schedule</a></li><li><a href="#/festival/page/the17th/ticket/">&nbsp;&nbsp;- Ticket Information</a></li><li><a href="#/festival/page/the17th/cinema/">&nbsp;&nbsp;- Cinema 2.0: Altered States</a></li><li><a href="#/festival/page/the17th/finalist/">&nbsp;&nbsp;- Finalist Showcase</a></li><li><a href="#/festival/page/the17th/jury/">&nbsp;&nbsp;- Jury Recommendation</a></li><li><a href="#/cultivation/page/doculab/">&nbsp;&nbsp;- DocuLab</a></li><li><a href="#/festival/page/the17th/wyc/">&nbsp;&nbsp;- When Yesterday Comes</a></li><li><a href="#/festival/page/the17th/bbl/">&nbsp;&nbsp;- Big Blue Lake</a></li><li><a href="#/festival/page/the17th/allaboutus/">&nbsp;&nbsp;- ALL ABOUT US</a></li><li><a href="#/festival/page/the17th/awarded/">&nbsp;&nbsp;- The 17th ifva Awarded Showcase</a></li><li><a href="#/festival/page/the17th/house/">&nbsp;&nbsp;- ifva House Programme & DVD &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Series</a></li><li><a href="#/festival/page/the17th/leeshare/">&nbsp;&nbsp;- Additional Programme:  Sharing &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Session by Mark Lee Ping Bing</a></li><li><a href="#/festival/page/past_festival/">Past ifva Festival</a></li>';						
								} else {
									div_htmlContent = '<ul class="navSection"><li><a href="#/festival/page/the17th/">17th ifva Festival</a></li><li><a href="#/festival/page/past_festival/">Past ifva Festival</a></li>';
								}
							break;
							case 1:
								if(location.hash.match('the17th')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/festival/page/the17th/">第十七屆ifva節</a></li><li><a href="#/festival/page/the17th/schedule/">&nbsp;&nbsp;- 活動時間表</a></li><li><a href="#/festival/page/the17th/ticket/">&nbsp;&nbsp;- 購票須知</a></li><li><a href="#/festival/page/the17th/cinema/">&nbsp;&nbsp;- Cinema 2.0: 異‧形</a></li><li><a href="#/festival/page/the17th/finalist/">&nbsp;&nbsp;- 入圍作品</a></li><li><a href="#/festival/page/the17th/jury/">&nbsp;&nbsp;- 評審推薦</a></li><li><a href="#/cultivation/page/doculab/">&nbsp;&nbsp;- 紀錄片工房</a></li><li><a href="#/festival/page/the17th/wyc/">&nbsp;&nbsp;- 昨日的記憶</a></li><li><a href="#/festival/page/the17th/bbl/">&nbsp;&nbsp;- 大藍湖</a></li><li><a href="#/festival/page/the17th/allaboutus/">&nbsp;&nbsp;- 影像無國界</a></li><li><a href="#/festival/page/the17th/awarded/">&nbsp;&nbsp;- 第十七屆ifva 得獎作品放映</a></li><li><a href="#/festival/page/the17th/house/">&nbsp;&nbsp;- ifva特刊及DVD系列</a></li><li><a href="#/festival/page/the17th/leeshare/">&nbsp;&nbsp;- 特備節目：攝影大師李屏賓</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;拍攝分享</a></li><li><a href="#/festival/page/past_festival/">歷屆ifva節</a></li>';						
								} else {
									div_htmlContent = '<ul class="navSection"><li><a href="#/festival/page/the17th/">17th ifva Festival</a></li><li><a href="#/festival/page/past_festival/">歷屆ifva節</a></li>';
								}
							break;
							case 2:
								if(location.hash.match('the17th')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/festival/page/the17th/">第十七届ifva节</a></li><li><a href="#/festival/page/the17th/schedule/">&nbsp;&nbsp;- 活动时间表</a></li><li><a href="#/festival/page/the17th/ticket/">&nbsp;&nbsp;- 购票须知</a></li><li><a href="#/festival/page/the17th/cinema/">&nbsp;&nbsp;- Cinema 2.0: 异‧形</a></li><li><a href="#/festival/page/the17th/finalist/">&nbsp;&nbsp;- 入围作品</a></li><li><a href="#/festival/page/the17th/jury/">&nbsp;&nbsp;- 评审推荐</a></li><li><a href="#/cultivation/page/doculab/">&nbsp;&nbsp;- 纪录片工房</a></li><li><a href="#/festival/page/the17th/wyc/">&nbsp;&nbsp;- 昨日的记忆</a></li><li><a href="#/festival/page/the17th/bbl/">&nbsp;&nbsp;- 大蓝湖</a></li><li><a href="#/festival/page/the17th/allaboutus/">&nbsp;&nbsp;- 影像无国界</a></li><li><a href="#/festival/page/the17th/awarded/">&nbsp;&nbsp;- 第十七届ifva 得奖作品放映</a></li><li><a href="#/festival/page/the17th/house/">&nbsp;&nbsp;- ifva特刊及DVD系列</a></li><li><a href="#/festival/page/the17th/leeshare/">&nbsp;&nbsp;- 特备节目：摄影大师李屏宾</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;拍摄分享</a></li><li><a href="#/festival/page/past_festival/">历届ifva节</a></li>';						
								} else {
									div_htmlContent = '<ul class="navSection"><li><a href="#/festival/page/the17th/">17th ifva Festival</a></li><li><a href="#/festival/page/past_festival/">历届ifva节</a></li>';
								}
							break;

					}
					
					break;		
					
				case '#/cultivation':
					isMainP = true;
					
					switch(lajq){
							default:
							case 0:
								div_htmlContent = '<ul class="navSection_w"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva supported projects</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">Master Class</a></li><li><a href="#/cultivation/page/animationlab/">Animation Lab</a></li><li><a href="#/cultivation/page/doculab/">DocuLab</a></li><li><a href="#/cultivation/page/distribution/">Distribution</a></li><li><a href="#/cultivation/page/visit/">Festival Visit</a></li>';
							break;
							case 1:
								div_htmlContent = '<ul class="navSection_w"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva 支援計劃</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">大師班</a></li><li><a href="#/cultivation/page/animationlab/">動畫工房</a></li><li><a href="#/cultivation/page/doculab/">紀錄片工房</a></li><li><a href="#/cultivation/page/distribution/">發行作品</a></li><li><a href="#/cultivation/page/visit/">海外交流</a></li>';
							break;
							case 2:
								div_htmlContent = '<ul class="navSection_w"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva 支持计划</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">大师班</a></li><li><a href="#/cultivation/page/animationlab/">动画工房</a></li><li><a href="#/cultivation/page/doculab/">纪录片工房</a></li><li><a href="#/cultivation/page/distribution/">发行作品</a></li><li><a href="#/cultivation/page/visit/">海外交流</a></li>';
							break;
					}
					break;
				case '#/cultivation_inner':
					switch(lajq){
							default:
							case 0:
								if(location.hash.match('greenlab')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/greenlab/7eleven">&nbsp;&nbsp;- 7-eleven @ Community</a></li><li><a href="#/cultivation/page/greenlab/justinlo">&nbsp;&nbsp;- Justin Lo Album Shorts</a></li><li><a href="#/cultivation/page/greenlab/lungkong">&nbsp;&nbsp;- LUNG KONG Exhibition</a></li><li><a href="#/cultivation/page/greenlab/airquality">&nbsp;&nbsp;- Greenpeace Air Pullution</a></li><li><a href="#/cultivation/page/greenlab/motionless">&nbsp;&nbsp;- Back to the Motionless</a></li><li><a href="#/cultivation/page/greenlab/greenpeace10">&nbsp;&nbsp;- Greenpeace, 10th Anniversary</a></li><li><a href="#/cultivation/page/greenlab/global">&nbsp;&nbsp;- Greenpeace, Global Warming</a></li><li><a href="#/cultivation/page/support/">ifva supported projects</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">Master Class</a></li><li><a href="#/cultivation/page/animationlab/">Animation Lab</a></li><li><a href="#/cultivation/page/doculab/">DocuLab</a></li><li><a href="#/cultivation/page/distribution/">Distribution</a></li><li><a href="#/cultivation/page/visit/">Festival Visit</a></li>';
								} else if(location.hash.match('doculab')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva supported projects</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">Master Class</a></li><li><a href="#/cultivation/page/animationlab/">Animation Lab</a></li><li><a href="#/cultivation/page/doculab/">DocuLab</a></li><li><a href="#/cultivation/page/doculab/chenclass/">&nbsp;&nbsp;- CHEN Po-wen Documentary &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Master Class</a></li><li><a href="#/cultivation/page/doculab/cutedge/">&nbsp;&nbsp;- Cut-edge Film Editing Seminar &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;by CHEN Po-wen</a></li><li><a href="#/cultivation/page/doculab/funding/">&nbsp;&nbsp;- Documentary Film Funding &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Workshop</a></li><li><a href="#/cultivation/page/doculab/werner/">&nbsp;&nbsp;- Docu Unlimited – Selected &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Documentary Shorts from &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Werner HERZOG</a></li><li><a href="#/cultivation/page/doculab/docprogramme/">&nbsp;&nbsp;- ifva Documentaries Programmes</a></li><li><a href="#/cultivation/page/distribution/">Distribution</a></li><li><a href="#/cultivation/page/visit/">Festival Visit</a></li>';															
								} else if(location.hash.match('distribution')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva supported projects</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">Master Class</a></li><li><a href="#/cultivation/page/animationlab/">Animation Lab</a></li><li><a href="#/cultivation/page/doculab/">DocuLab</a></li><li><a href="#/cultivation/page/distribution/">Distribution</a></li><li><a href="#/cultivation/page/distribution/curatedprogramme">&nbsp;&nbsp;- Curated Programme</a><li><a href="#/cultivation/page/distribution/screeningrecord">&nbsp;&nbsp;- Screening Record</a></li><li><a href="#/cultivation/page/distribution/bcsunday">&nbsp;&nbsp;- bc Sunday</a></li><li><a href="#/cultivation/page/visit/">Festival Visit</a></li>';
								} else if(location.hash.match('ifvaplus')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva supported projects</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/ifvaplus/bbl/">&nbsp;&nbsp;- Big Blue Lake</a></li><li><a href="#/cultivation/page/ifvaplus/autofiction/">&nbsp;&nbsp;- Autofiction</a></li><li><a href="#/cultivation/page/ifvaplus/gallants/">&nbsp;&nbsp;- Gallants</a></li><li><a href="#/cultivation/page/ifvaplus/highnoon/">&nbsp;&nbsp;- High Noon</a></li><li><a href="#/cultivation/page/masterclass/">Master Class</a></li><li><a href="#/cultivation/page/animationlab/">Animation Lab</a></li><li><a href="#/cultivation/page/doculab/">DocuLab</a></li><li><a href="#/cultivation/page/distribution/">Distribution</a></li><li><a href="#/cultivation/page/visit/">Festival Visit</a></li>';
								} else {
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva supported projects</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">Master Class</a></li><li><a href="#/cultivation/page/animationlab/">Animation Lab</a></li><li><a href="#/cultivation/page/doculab/">DocuLab</a></li><li><a href="#/cultivation/page/distribution/">Distribution</a></li><li><a href="#/cultivation/page/visit/">Festival Visit</a></li>';
								}
								
							break;
							case 1:
								
								if(location.hash.match('greenlab')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/greenlab/7eleven">&nbsp;&nbsp;- 7-eleven @ 連結創意社群</a></li><li><a href="#/cultivation/page/greenlab/justinlo">&nbsp;&nbsp;- 側田音樂專輯</a></li><li><a href="#/cultivation/page/greenlab/lungkong">&nbsp;&nbsp;- 龍剛逆流動力</a></li><li><a href="#/cultivation/page/greenlab/airquality">&nbsp;&nbsp;- 綠色和平空氣質素報告</a></li><li><a href="#/cultivation/page/greenlab/motionless">&nbsp;&nbsp;- 回到未動時</a></li><li><a href="#/cultivation/page/greenlab/greenpeace10">&nbsp;&nbsp;- 綠色和平十周年委約活動</a></li><li><a href="#/cultivation/page/greenlab/global">&nbsp;&nbsp;- 綠色和平全球暖化委約活動</a></li><li><a href="#/cultivation/page/support/">ifva 支援計劃</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">大師班</a></li><li><a href="#/cultivation/page/animationlab/">動畫工房</a></li><li><a href="#/cultivation/page/doculab/">紀錄片工房</a></li><li><a href="#/cultivation/page/distribution/">發行作品</a></li><li><a href="#/cultivation/page/visit/">海外交流</a></li>';
								} else if(location.hash.match('doculab')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva 支援計劃</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">大師班</a></li><li><a href="#/cultivation/page/animationlab/">動畫工房</a></li><li><a href="#/cultivation/page/doculab/">紀錄片工房</a></li><li><a href="#/cultivation/page/doculab/chenclass/">&nbsp;&nbsp;- 陳博文剪接大師班</a></li><li><a href="#/cultivation/page/doculab/cutedge/">&nbsp;&nbsp;- 歷練剪裁 ─ 陳博文講座</a></li><li><a href="#/cultivation/page/doculab/funding/">&nbsp;&nbsp;- 紀錄在案 ─ 資金籌募工作坊</a></li><li><a href="#/cultivation/page/doculab/werner/">&nbsp;&nbsp;- 荷索紀錄短片作品選</a></li><li><a href="#/cultivation/page/doculab/docprogramme/">&nbsp;&nbsp;- ifva 紀錄片系列作品精選</a></li><li><a href="#/cultivation/page/distribution/">發行作品</a></li><li><a href="#/cultivation/page/visit/">海外交流</a></li>';
								} else if(location.hash.match('distribution')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva 支援計劃</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">大師班</a></li><li><a href="#/cultivation/page/animationlab/">動畫工房</a></li><li><a href="#/cultivation/page/doculab/">紀錄片工房</a></li><li><a href="#/cultivation/page/distribution/">發行作品</a></li><li><a href="#/cultivation/page/distribution/curatedprogramme">&nbsp;&nbsp;- 策劃節目</a><li><a href="#/cultivation/page/distribution/screeningrecord">&nbsp;&nbsp;- 參與影展</a></li><li><a href="#/cultivation/page/distribution/bcsunday">&nbsp;&nbsp;- bc Sunday</a></li><li><a href="#/cultivation/page/visit/">海外交流</a></li>';
								} else if(location.hash.match('ifvaplus')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva 支援計劃</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/ifvaplus/bbl/">&nbsp;&nbsp;- 大藍湖</a></li><li><a href="#/cultivation/page/ifvaplus/autofiction/">&nbsp;&nbsp;- Autofiction</a></li><li><a href="#/cultivation/page/ifvaplus/gallants/">&nbsp;&nbsp;- 打擂台</a></li><li><a href="#/cultivation/page/ifvaplus/highnoon/">&nbsp;&nbsp;- 烈日當空</a></li><li><a href="#/cultivation/page/masterclass/">大師班</a></li><li><a href="#/cultivation/page/animationlab/">動畫工房</a></li><li><a href="#/cultivation/page/doculab/">紀錄片工房</a></li><li><a href="#/cultivation/page/distribution/">發行作品</a></li><li><a href="#/cultivation/page/visit/">海外交流</a></li>';
								} else {
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva 支援計劃</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">大師班</a></li><li><a href="#/cultivation/page/animationlab/">動畫工房</a></li><li><a href="#/cultivation/page/doculab/">紀錄片工房</a></li><li><a href="#/cultivation/page/distribution/">發行作品</a></li><li><a href="#/cultivation/page/visit/">海外交流</a></li>';
								}


							break;
							case 2:
								if(location.hash.match('greenlab')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/greenlab/7eleven">&nbsp;&nbsp;- 7-eleven @ 连结创意社群</a></li><li><a href="#/cultivation/page/greenlab/justinlo">&nbsp;&nbsp;- 侧田音乐专辑</a></li><li><a href="#/cultivation/page/greenlab/lungkong">&nbsp;&nbsp;- 龙刚逆流动力</a></li><li><a href="#/cultivation/page/greenlab/airquality">&nbsp;&nbsp;- 绿色和平空气质素报告</a></li><li><a href="#/cultivation/page/greenlab/motionless">&nbsp;&nbsp;- 回到未动时</a></li><li><a href="#/cultivation/page/greenlab/greenpeace10">&nbsp;&nbsp;- 绿色和平十周年委约活动</a></li><li><a href="#/cultivation/page/greenlab/global">&nbsp;&nbsp;- 绿色和平全球暖化委约活动</a></li><li><a href="#/cultivation/page/support/">ifva 支持计划</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">大师班</a></li><li><a href="#/cultivation/page/animationlab/">动画工房</a></li><li><a href="#/cultivation/page/doculab/">纪录片工房</a></li><li><a href="#/cultivation/page/distribution/">发行作品</a></li><li><a href="#/cultivation/page/visit/">海外交流</a></li>';
								} else if(location.hash.match('doculab')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva 支持计划</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">大师班</a></li><li><a href="#/cultivation/page/animationlab/">动画工房</a></li><li><a href="#/cultivation/page/doculab/">纪录片工房</a></li><li><a href="#/cultivation/page/doculab/chenclass/">&nbsp;&nbsp;- 陈博文剪接大师班</a></li><li><a href="#/cultivation/page/doculab/cutedge/">&nbsp;&nbsp;- 历练剪裁 ─ 陈博文讲座</a></li><li><a href="#/cultivation/page/doculab/funding/">&nbsp;&nbsp;- 纪录在案 ─ 资金筹募工作坊</a></li><li><a href="#/cultivation/page/doculab/werner/">&nbsp;&nbsp;- 荷索纪录短片作品选</a></li><li><a href="#/cultivation/page/doculab/docprogramme/">&nbsp;&nbsp;- ifva 纪录片系列作品精选</a></li><li><a href="#/cultivation/page/distribution/">发行作品</a></li><li><a href="#/cultivation/page/visit/">海外交流</a></li>';

								} else if(location.hash.match('distribution')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva 支持计划</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">大师班</a></li><li><a href="#/cultivation/page/animationlab/">动画工房</a></li><li><a href="#/cultivation/page/doculab/">纪录片工房</a></li><li><a href="#/cultivation/page/distribution/">发行作品</a></li><li><a href="#/cultivation/page/distribution/curatedprogramme">&nbsp;&nbsp;- 策划节目</a><li><a href="#/cultivation/page/distribution/screeningrecord">&nbsp;&nbsp;- 参与影展</a></li><li><a href="#/cultivation/page/distribution/bcsunday">&nbsp;&nbsp;- bc Sunday</a></li><li><a href="#/cultivation/page/visit/">海外交流</a></li>';
								} else if(location.hash.match('ifvaplus')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva 支持计划</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/ifvaplus/bbl/">&nbsp;&nbsp;- 大蓝湖</a></li><li><a href="#/cultivation/page/ifvaplus/autofiction/">&nbsp;&nbsp;- Autofiction</a></li><li><a href="#/cultivation/page/ifvaplus/gallants/">&nbsp;&nbsp;- 打擂台</a></li><li><a href="#/cultivation/page/ifvaplus/highnoon/">&nbsp;&nbsp;- 烈日当空</a></li><li><a href="#/cultivation/page/masterclass/">大师班</a></li><li><a href="#/cultivation/page/animationlab/">动画工房</a></li><li><a href="#/cultivation/page/doculab/">纪录片工房</a></li><li><a href="#/cultivation/page/distribution/">发行作品</a></li><li><a href="#/cultivation/page/visit/">海外交流</a></li>';
								} else {
									div_htmlContent = '<ul class="navSection"><li><a href="#/cultivation/page/greenlab/">greenlab</a></li><li><a href="#/cultivation/page/support/">ifva 支持计划</a></li><li><a href="#/cultivation/page/ifvaplus/">ifva preview</a></li><li><a href="#/cultivation/page/masterclass/">大师班</a></li><li><a href="#/cultivation/page/animationlab/">动画工房</a></li><li><a href="#/cultivation/page/doculab/">纪录片工房</a></li><li><a href="#/cultivation/page/distribution/">发行作品</a></li><li><a href="#/cultivation/page/visit/">海外交流</a></li>';
								}

							break;
					
					}
					
					
					
					
					break;
				case '#/engagement':
					isMainP = true;
					
					switch(lajq){
							default:
							case 0:
								div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">Course</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/community_tour/">Community Tour</a></li><li><a href="#/engagement/page/all_about_us/">All About Us</a></li>';
							break;
							case 1:
								div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">課程</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/community_tour/">社區巡迴</a></li><li><a href="#/engagement/page/all_about_us/">影像無國界</a></li>';
							break;
							case 2:
								div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">课程</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/community_tour/">社区巡回</a></li><li><a href="#/engagement/page/all_about_us/">影像无国界</a></li>';
							break;
					}
					
					
					break;
				case '#/engagement_inner':
				
					switch(lajq){
							default:
							case 0:
								if(location.hash.match('all_about_us')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">Course</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/community_tour/">Community Tour</a></li><li><a href="#/engagement/page/all_about_us/">All About Us</a></li><a href="#/engagement/page/all_about_us/all_about_us_2011">&nbsp;&nbsp;- 2011</a></li><li><a href="#/engagement/page/all_about_us/all_about_us_2010">&nbsp;&nbsp;- 2010</a></li>';
								} else if(location.hash.match('ifvaplus')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">Course</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/ifvaplus/documentary/">&nbsp;&nbsp;- Documentary</a></li><li><a href="#/engagement/page/ifvaplus/animation/">&nbsp;&nbsp;- Animation</a></li><li><a href="#/engagement/page/community_tour/">Community Tour</a></li><li><a href="#/engagement/page/all_about_us/">All About Us</a></li>';
								} else if(location.hash.match('course')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">Course</a></li><li><a href="#/engagement/page/course/documentary/">&nbsp;&nbsp;- Documentary in Two Days</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/community_tour/">Community Tour</a></li><li><a href="#/engagement/page/all_about_us/">All About Us</a></li>';
								} else {
									div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">Course</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/community_tour/">Community Tour</a></li><li><a href="#/engagement/page/all_about_us/">All About Us</a></li>';
								}
							break;
							case 1:
								if(location.hash.match('all_about_us')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">課程</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/community_tour/">社區巡迴</a></li><li><a href="#/engagement/page/all_about_us/">影像無國界</a></li><a href="#/engagement/page/all_about_us/all_about_us_2011">&nbsp;&nbsp;- 2011</a></li><li><a href="#/engagement/page/all_about_us/all_about_us_2010">&nbsp;&nbsp;- 2010</a></li>';
								} else if(location.hash.match('ifvaplus')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">課程</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/ifvaplus/documentary/">&nbsp;&nbsp;- 紀錄片系列</a></li><li><a href="#/engagement/page/ifvaplus/animation/">&nbsp;&nbsp;- 動畫系列</a></li><li><a href="#/engagement/page/community_tour/">社區巡迴</a></li><li><a href="#/engagement/page/all_about_us/">影像無國界</a></li>';
								} else if(location.hash.match('course')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">課程</a></li><li><a href="#/engagement/page/course/documentary/">&nbsp;&nbsp;- 紀錄片兩天速成</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/community_tour/">社區巡迴</a></li><li><a href="#/engagement/page/all_about_us/">影像無國界</a></li>';
								} else{
									div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">課程</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/community_tour/">社區巡迴</a></li><li><a href="#/engagement/page/all_about_us/">影像無國界</a></li>';
								}
							break;
							case 2:
								if(location.hash.match('all_about_us')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">课程</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/community_tour/">社区巡回</a></li><li><a href="#/engagement/page/all_about_us/">影像无国界</a></li><a href="#/engagement/page/all_about_us/all_about_us_2011">&nbsp;&nbsp;- 2011</a></li><li><a href="#/engagement/page/all_about_us/all_about_us_2010">&nbsp;&nbsp;- 2010</a></li>';
								} else if(location.hash.match('ifvaplus')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">课程</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/ifvaplus/documentary/">&nbsp;&nbsp;- 纪录片系列</a></li><li><a href="#/engagement/page/ifvaplus/animation/">&nbsp;&nbsp;- 动画系列</a></li><li><a href="#/engagement/page/community_tour/">社区巡回</a></li><li><a href="#/engagement/page/all_about_us/">影像无国界</a></li>';
								} else if(location.hash.match('course')){
									div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">课程</a></li><li><a href="#/engagement/page/course/documentary/">&nbsp;&nbsp;- 纪录片两天速成</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/community_tour/">社区巡回</a></li><li><a href="#/engagement/page/all_about_us/">影像无国界</a></li>';
								} else {
									div_htmlContent = '<ul class="navSection"><li><a href="#/engagement/page/course/documentary/">课程</a></li><li><a href="#/engagement/page/ifvaplus/">ifva+</a></li><li><a href="#/engagement/page/community_tour/">社区巡回</a></li><li><a href="#/engagement/page/all_about_us/">影像无国界</a></li>';
								}
							break;
					}
					
					
				   break;								
			}
			
			
			switch(str){
				default:
					div_htmlContent += '</ul>';
				break;
				case '#/others_inner':
					switch(lajq){
							default:
							case 0:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/home" class="mmback">&laquo; Back</a></li></ul>';
							break;
							case 1:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/home" class="mmback">&laquo; 返回</a></li></ul>';
							break;
							case 2:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/home" class="mmback">&laquo; 返回</a></li></ul>';
							break;
					}
				break;
				case '#/awards_inner':
					switch(lajq){
							default:
							case 0:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/awards" class="mmback">&laquo; Back</a></li></ul>';
							break;
							case 1:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/awards" class="mmback">&laquo; 返回</a></li></ul>';
							break;
							case 2:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/awards" class="mmback">&laquo; 返回</a></li></ul>';
							break;
					}
				break;
				case '#/festival_inner':
					switch(lajq){
							default:
							case 0:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/festival" class="mmback">&laquo; Back</a></li></ul>';
							break;
							case 1:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/festival" class="mmback">&laquo; 返回</a></li></ul>';
							break;
							case 2:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/festival" class="mmback">&laquo; 返回</a></li></ul>';
							break;
					}
				break;
				case '#/cultivation_inner':
					switch(lajq){
							default:
							case 0:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/cultivation" class="mmback">&laquo; Back</a></li></ul>';
							break;
							case 1:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/cultivation" class="mmback">&laquo; 返回</a></li></ul>';
							break;
							case 2:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/cultivation" class="mmback">&laquo; 返回</a></li></ul>';
							break;
					}
				break;
				case '#/engagement_inner':
					switch(lajq){
							default:
							case 0:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/engagement" class="mmback">&laquo; Back</a></li></ul>';
							break;
							case 1:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/engagement" class="mmback">&laquo; 返回</a></li></ul>';
							break;
							case 2:
								div_htmlContent += '<li>&nbsp;</li><li><a href="#/engagement" class="mmback">&laquo; 返回</a></li></ul>';
							break;
					}
				break;
			}
			
			
			$('div.mainNavGroup').html(div_htmlContent);
			
			
			
			
			$('div.mainNavGroup').find("a").each(function(){
				
				if(location.hash.match($(this).attr("href")) && $(this).attr("class") != "mmback"){
					$(this).attr("class", "navSection_selected");
				} 
				
			});
			
			
			
			$('div.mainNavGroup').show();
			
			if(!preHashStr.match("page") || isMainP){
				$('div.mainNavGroup').css({opacity: 0, marginLeft:'-300px'});
				$('div.mainNavGroup').stop().animate({
						  opacity: 1,
						  marginLeft: '0px'
						  }, 800, 'easeInOutExpo');
			
			}
		
		
	}

	
	function footer_logo_in(fadeInBoo){
		
		if(!fadeInBoo){
				$('#footer_logo').stop().fadeOut("slow");
				$('#footer_logo').stop().animate({opacity:0}, "slow");
				
				$('#footer').css({"height":"80px"});
				$('#footer').stop().animate({"bottom":"0px"}, "slow");
		} else {
				
				$('#footer_logo').stop().fadeIn("slow");
				$('#footer_logo').stop().animate({opacity:1}, "slow");
				
				$('#footer').css({"height":"110px"});
				$('#footer').stop().animate({"bottom":"50px"}, "slow");
		}
	}
	
	
	function update_mm_wrapper(){
			
			
			var img_id = 'mm_btn00';
			
			$("div.mm_logo").find("img").attr("src", "../lib/img/html/mm/mm_logo.png");
					
			if(location.hash.match("#/home")){
				img_id = 'mm_btn00';
			} else if(location.hash.match("#/awards")){
				img_id = 'mm_btn01';
			} else if(location.hash.match("#/festival")){
				img_id = 'mm_btn02';
			} else if(location.hash.match("#/cultivation")){
				img_id = 'mm_btn03';
			} else if(location.hash.match("#/engagement")){
				img_id = 'mm_btn04';
			} else {
				img_id = 'mm_btn00';
			}
			
			var images = $("div.mm").find("img");
					
			images.each(function(){
					if($(this).attr("id") == img_id){
						var src = "../lib/img/html/mm/"+$(this).attr("id")+"_selected.png";
						
						if((img_id == 'mm_btn01' && !location.hash.match("page")) || (img_id == 'mm_btn03' && !location.hash.match("page"))){
							 src = "../lib/img/html/mmw/"+$(this).attr("id")+"_selected.png";
							  $("div.mm_logo").find("img").attr("src", "../lib/img/html/mmw/mm_logo.png");
						}
									 
						$(this).attr("src", src);
					} else {
						var src = "../lib/img/html/mm/"+$(this).attr("id")+".png";
						
						if((img_id == 'mm_btn01' && !location.hash.match("page")) || (img_id == 'mm_btn03' && !location.hash.match("page"))){
							src = "../lib/img/html/mmw/"+$(this).attr("id")+".png";
						}
						$(this).attr("src", src);
					}
					
			});	
			
			
		}
		
		
		function home_layer_in(boo){
			
			
			if(boo){
				
				homeLayerBoo = true;
				
				if(!$('#home').find("img").is(":visible")){
					$('#home').find("img").stop().fadeIn(200);
				}
				
				if(!$('#home').find("div").is(":visible")){
					$('#home').find("div").stop().fadeIn(200);
				}
				
				var no = $('#home').find("img").length;
				$('#home').find("img").each(function(){
					$(this).stop().animate({opacity: 1, "top":$('#home').offset().top+"px"}, no*120+300,'easeInOutExpo', function(){
						
						if(no == 0){
								 homeLayerBoo = false;
						 }
						  if(jQuery.browser.msie){
						   	this.style.removeAttribute('filter');
						  }
					});
					no--;
				});			
				
				
				var nos = $('#home').find("div").length;
				$('#home').find("div").each(function(){
					$(this).stop().animate({opacity: 1, "top":$('#home').offset().top+"px"}, nos*120+300,'easeInOutExpo', function(){
							if(nos == 0){
								homeLayerBoo = false;
							}
						   if(jQuery.browser.msie){
							   this.style.removeAttribute('filter');
						   }
					});
					nos--;
				});	
				
				
			} else {
				
				homeLayerBoo = false;
				
					$('#home').find("img").stop();
					$('#home').find("img").hide();
					
					
					$('#home').find("div").stop();
					$('#home').find("div").hide();
			}
			
		}
		
		
		function awards_layer_in(boo){
			
			
			if(boo){
				
				awardsLayerBoo = true;
				
				//$('#awards').find("img").css({"top":$(document).height()+"px"});
				
				if(!$('#awards').find("img").is(":visible")){
					$('#awards').find("img").stop().fadeIn(200);
				}
				
				if(!$('#awards').find("div").is(":visible")){
					$('#awards').find("div").stop().fadeIn(200);
				}
				
				var no = $('#awards').find("img").length;
				$('#awards').find("img").each(function(){
					$(this).stop().animate({opacity: 1, "top":$('#awards').offset().top+"px"}, no*120+300,'easeInOutExpo', function(){
									  if(jQuery.browser.msie){
										this.style.removeAttribute('filter');
									  }
									  
									  if(no == 0){
										  awardsLayerBoo = false;
									  }
								});
					no--;
				});		
				
				var nos = $('#awards').find("div").length;
				$('#awards').find("div").each(function(){
					$(this).stop().animate({opacity: 1, "top":$('#awards').offset().top+"px"}, nos*120+300,'easeInOutExpo', function(){
									  if(jQuery.browser.msie){
										this.style.removeAttribute('filter');
									  }
									  
									  if(nos == 0){
										  awardsLayerBoo = false;
									  }
								});
					nos--;
				});	
				
				
			} else {
				
				awardsLayerBoo = false;
				
				
				$('#awards').find("img").stop();
				$('#awards').find("img").hide();
					
				$('#awards').find("div").stop();
				$('#awards').find("div").hide();
			}
			
		}
		
		
		
		
		function festival_layer_in(boo){
			
			
			if(boo){
				
				festivalLayerBoo = true;
				
				//$('#festival').find("img").css({"top":$(document).height()+"px"});
				
				if(!$('#festival').find("img").is(":visible")){
					$('#festival').find("img").stop().fadeIn(200);
				}
				
				if(!$('#festival').find("div").is(":visible")){
					$('#festival').find("div").stop().fadeIn(200);
				}
				
				var no = $('#festival').find("img").length;
				$('#festival').find("img").each(function(){
					$(this).stop().animate({opacity: 1, "top":$('#festival').offset().top+"px"}, no*120+300,'easeInOutExpo', function(){
									  if(no == 0){
										  festivalLayerBoo = false;
									  }
									  
									  if(jQuery.browser.msie){
										this.style.removeAttribute('filter');
									  }
								});
					no--;
				});							
				
				var nos = $('#festival').find("div").length;
				$('#festival').find("div").each(function(){
					$(this).stop().animate({opacity: 1, "top":$('#festival').offset().top+"px"}, nos*120+300,'easeInOutExpo', function(){
									  if(nos == 0){
										  festivalLayerBoo = false;
									  }
									  if(jQuery.browser.msie){
										this.style.removeAttribute('filter');
									  }
								});
					nos--;
				});	
				
			} else {
				
				festivalLayerBoo = false;
				
				$('#festival').find("img").stop();
				$('#festival').find("img").hide();
				
				$('#festival').find("div").stop();
				$('#festival').find("div").hide();
			}
			
		}
		
		
		
		function engagement_layer_in(boo){
			
			
			if(boo){
				
				engagementLayerBoo = true;
				
				if(!$('#engagement').find("img").is(":visible")){
					$('#engagement').find("img").stop().fadeIn(200);
				}
				
				if(!$('#engagement').find("div").is(":visible")){
					$('#engagement').find("div").stop().fadeIn(200);
				}
				
				var no = $('#engagement').find("img").length;
				$('#engagement').find("img").each(function(){
					$(this).stop().animate({opacity: 1, "top":$('#engagement').offset().top+"px"}, no*120+300,'easeInOutExpo', function(){
									  if(no == 0){
										  engagementLayerBoo = false;
									  }
									  if(jQuery.browser.msie){
										this.style.removeAttribute('filter');
									  }
								});
					no--;
				});	
				
				
				var nos = $('#engagement').find("div").length;
				$('#engagement').find("div").each(function(){
					$(this).stop().animate({opacity: 1, "top":$('#engagement').offset().top+"px"}, nos*120+300,'easeInOutExpo', function(){
									  if(nos == 0){
										  engagementLayerBoo = false;
									  }
									  if(jQuery.browser.msie){
										this.style.removeAttribute('filter');
									  }
								});
					nos--;
				});	
				
				
			} else {
				
				engagementLayerBoo = false;
				
				$('#engagement').find("img").stop();
				$('#engagement').find("img").hide();
				
				$('#engagement').find("div").stop();
				$('#engagement').find("div").hide();
			}
			
		}
		
		
		function cultivation_layer_in(boo){
			
			
			if(boo){
				
				cultivationLayerBoo = true;
				
				//$('#cultivation').find("img").css({"top":$(document).height()+"px"});
				
				if(!$('#cultivation').find("img").is(":visible")){
					$('#cultivation').find("img").stop().fadeIn(200);
				}
				
				if(!$('#cultivation').find("div").is(":visible")){
					$('#cultivation').find("div").stop().fadeIn(200);
				}
				
				var no = $('#cultivation').find("img").length;
				$('#cultivation').find("img").each(function(){
					$(this).stop().animate({opacity: 1, "top":$('#cultivation').offset().top+"px"}, no*120+300,'easeInOutExpo', function(){
									  if(no == 0){
										  cultivationLayerBoo = false;
									  }
									  if(jQuery.browser.msie){
										this.style.removeAttribute('filter');
									  }
								});
					no--;
				});		
				
				var nos = $('#cultivation').find("div").length;
				$('#cultivation').find("div").each(function(){
					$(this).stop().animate({opacity: 1, "top":$('#cultivation').offset().top+"px"}, nos*120+300,'easeInOutExpo', function(){
									  if(nos == 0){
										  cultivationLayerBoo = false;
									  }
									  if(jQuery.browser.msie){
										this.style.removeAttribute('filter');
									  }
								});
					nos--;
				});	
				
				
			} else {
				
				$('#cultivation').find("img").stop();
				$('#cultivation').find("img").hide();
				
				$('#cultivation').find("div").stop();
				$('#cultivation').find("div").hide();
				
			}
			
		}
		
		
		
		
		
	
	function ease(value, max) {
        return Math.sin((value / max - 1) * Math.PI / 2) * max + max;
    };
	
	
	
	function load_innerpage(hrefurl){
		
		$('#preloader').show();
		
		
		$.ajax({
		  url: hrefurl,
		  cache: false
		})
		.success(function(data) { 		  
			$('#innerpage').html(data);
			// alert(data);
		})
		.error(function() { 
			$('#preloader').hide();		
			//alert('load page error');
		})
		.complete(function(data) { 
			$('#preloader').hide();
			$('html,body').stop().animate({scrollTop: 0}, 300,'easeInOutExpo');
			$('#innerpage').fadeIn("slow");
			$('#innerpage .top').mousedown(function() {
				$('html,body').stop().animate({scrollTop: 0}, 300,'easeInOutExpo');
			});
			
			$('#innerpage .to').mousedown(function() {
				$('html,body').stop().animate({scrollTop: $('#'+$(this).attr("data-top")).offset().top}, 300,'easeInOutExpo');
			});
			
		});
	}
	
	
	function video_player_position(){
		var ll = (($(window).height()-510)/2)+"px";
		var tt = (($(window).width()-853)/2)+"px";
			
		$("#videoPlayer .videoPlayerContent").css({"top":ll, "left":tt});
		$("#videoPlayer .videoPlayerBg").css({opacity:0.8});	
	}
	
	function video_player2_position(){
		var ll = (($(window).height()-510)/2)+"px";
		var tt = (($(window).width()-853)/2)+"px";
			
		$("#videoPlayer2 .videoPlayerContent").css({"top":ll, "left":tt});
		$("#videoPlayer2 .videoPlayerBg").css({opacity:0.8});	
	}
	


	$(function(){
  		$(window).hashchange( function(){
				
				
		
				
									   
			   if(location.hash.match("page")){
				   
				   
				     var hrefurl = "";
					 
					 switch(lajq){
						default:
						case 0:
					 		hrefulr = "http://www.ifva.com/2011/en/";
					 	break;
						case 1:
							hrefulr = "http://www.ifva.com/2011/tc/";
						break;
						case 2:
							hrefulr = "http://www.ifva.com/2011/sc/";
						break;
					 }
					 
					 var end = ".php";
					 
					 if(location.hash.substr(location.hash.length-1,1) == "/"){
						 end = "";
					 }
					   
					 if(location.hash.match("others")){
						   
							hrefurl += 'others/'+location.hash.replace('#/others/page/', '')+end;
							mm_in('#/others_inner');
						
						} else if(location.hash.match("awards")){
							
							hrefurl += 'awards/'+location.hash.replace('#/awards/page/', '')+end;
							mm_in('#/awards_inner');
							
							
						} else if(location.hash.match("festival")){
							
							hrefurl += 'festival/'+location.hash.replace('#/festival/page/', '')+end;
							mm_in('#/festival_inner');
							
						} else if(location.hash.match("cultivation")){
							
							hrefurl += 'cultivation/'+location.hash.replace('#/cultivation/page/', '')+end;
							mm_in('#/cultivation_inner');
							
						} else if(location.hash.match("engagement")){
							
							hrefurl += 'engagement/'+location.hash.replace('#/engagement/page/', '')+end;
							mm_in('#/engagement_inner');
							
						}
					   
						
				   
				  
				   if(!innerBoo){
					   
					   
					   innerBoo = true;
					   
					   footer_logo_in(false);
					   
					   
					   if(location.hash.match('other')){
						   $('html,body').scrollTop($('#home').offset().top);
					   } else if(location.hash.match('awards')){
						   $('html,body').scrollTop($('#awards').offset().top);
					   } else if(location.hash.match('festival')){
						   $('html,body').scrollTop($('#festival').offset().top);
					   } else if(location.hash.match('cultivation')){
						   $('html,body').scrollTop($('#cultivation').offset().top);
					   } else if(location.hash.match('engagement')){
						   $('html,body').scrollTop($('#engagement').offset().top);
					   } else {
						   $('html,body').scrollTop($('#home').offset().top);
					   }
					  
						init_arrangement_layer_in_innerpage();
						
						
						
				   	 	$('#content').css({width:$(window).width()});
						
						$('#content').stop().animate({marginLeft: -$(window).width()}, 500, 'easeInOutExpo', function(){																			   							
								$('#content').hide();
								$('#innerpage').html('');
								
								load_innerpage(hrefurl);
								
								
						});
						
						
				   } else {
					   
						$('#innerpage').html('');
						$('#innerpage').hide();
						
						load_innerpage(hrefurl);
						
				   }		
				   
				   
				   
				   
				   
				   
				   

				   
				   
					
			   } else {
				   
			   
			   
					   switch(location.hash){
						   default:
						   		
								mm_in('#/home');
								
								$('#home').find("img").css({"top":$(document).height()+"px"});
								$('#home').find("div").css({"top":$(document).height()+"px"});
								home_layer_in(true);
								
								footer_logo_in(true);
								
								break;
						   case '#/home':
						   case '#/awards':
						   case '#/festival':
						   case '#/cultivation':
						   case '#/engagement':
						   
								$('#content').show();
								
								
								$('#content').css({width:'100%'});
								$('#content').stop().animate({marginLeft:0}, 300, 'easeInOutExpo');
								
								mm_in(location.hash);
								
								
								
								
								
								if(innerBoo){								
									
									innerBoo = false;
									$('#innerpage').hide();
									
									scroll_to_section_from_innerpage();
									init_arrangement_layer_in();
									
								} else {
									
									//alert("DFDSF");
									/*
									anScrollTopBoo = true;
									$('html,body').stop().animate({scrollTop: $(location.hash.replace('#/', '#')).offset().top}, 600,'easeInOutExpo', function() {
										anScrollTopBoo = false;
										}
									);
									*/
								}
								
								
								if(location.hash.match("#/home")){
									
									if(!$('#home').find("img").is(":visible")){
										$('#home').find("img").stop().fadeIn(200);
									}
									
									if(!$('#home').find("div").is(":visible")){
										$('#home').find("div").stop().fadeIn(200);
									}
									
									footer_logo_in(true);
									mm_wrapper_scroll_to_section(0);
									
								} else if(location.hash.match("#/awards")){
									
									if(!$('#awards').find("img").is(":visible")){
										$('#awards').find("img").stop().fadeIn(200);
									}
									
									if(!$('#awards').find("div").is(":visible")){
										$('#awards').find("div").stop().fadeIn(200);
									}
									footer_logo_in(false);
									mm_wrapper_scroll_to_section(0);
									
								} else if(location.hash.match("#/festival")){
									
									if(!$('#festival').find("img").is(":visible")){
										$('#festival').find("img").stop().fadeIn(200);
									}
									
									if(!$('#festival').find("div").is(":visible")){
										$('#festival').find("div").stop().fadeIn(200);
									}
									
									footer_logo_in(false);
									mm_wrapper_scroll_to_section(1);
									
								} else if(location.hash.match("#/cultivation")){
									
									if(!$('#cultivation').find("img").is(":visible")){
										$('#cultivation').find("img").stop().fadeIn(200);
									}
									
									if(!$('#cultivation').find("div").is(":visible")){
										$('#cultivation').find("div").stop().fadeIn(200);
									}
									
									footer_logo_in(false);
									mm_wrapper_scroll_to_section(2);
									
								} else if(location.hash.match("#/engagement")){
									
									if(!$('#engagement').find("img").is(":visible")){
										$('#engagement').find("img").stop().fadeIn(200);
									}
									
									if(!$('#engagement').find("div").is(":visible")){
										$('#engagement').find("div").stop().fadeIn(200);
									}

									footer_logo_in(false);
									mm_wrapper_scroll_to_section(3);
									
								} else {		
									
									footer_logo_in(false);
									mm_wrapper_scroll_to_section(0);
									
								}
								
								
								
								break;
								
								
					   }
	   }
	   
	   	
	   		update_mm_wrapper();
			
			preHashStr = location.hash;
			
			
			var fno = 0;
			$('#footer').find("a").each(function(){
				switch(fno){
					case 0:
						$(this).attr("href", "http://www.ifva.com/2011/tc/"+location.hash);
						break;
					case 1:
						$(this).attr("href", "http://www.ifva.com/2011/sc/"+location.hash);
						break;
					case 2:
						$(this).attr("href", "http://www.ifva.com/2011/en/"+location.hash);
						break;
				}
				fno++;
			});
			
			
			
			
			
	   
	   });
		
		
		
		
		
		
		
		
		
		
		
		
		
		$(window).resize(function() { 
				
				update_mm_wrapper();
				
				
				
				var w = $(window).width();
				var h = $(window).height();
				
				
				if(w <= 1000){
					w = 1000;
				}
				
				if(h <= 800){
					h = 800;
				}
				
				
				
				if(jQuery.browser.msie){
						
						$('#awards').css({"background-color":"#8299c8"});
						$('#awards').css({"width":"100%"});
						$('#awards').css({"height":"auto"});
						$('#awards').css({"overflow":"hidden"});
						$('#awards').css({"background-size":"cover"});
						$('#awards').css({"-moz-background-size":"cover"});
						$('#awards').css({"-o-background-size":"cover"});
						$('#awards').css({"-ms-filter":"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../lib/img/html/bg/bg_awards.jpg', sizingMethod='scale')"});
						$('#awards').css({"filter":"DXImageTransform.Microsoft.AlphaImageLoader(src='../lib/img/html/bg/bg_awards.jpg', sizingMethod='scale'"});
						
						
						$('#festival').css({"background-color":"#8fa7c8"});
						$('#festival').css({"width":"100%"});
						$('#festival').css({"height":"auto"});
						$('#festival').css({"overflow":"hidden"});
						$('#festival').css({"background-size":"cover"});
						$('#festival').css({"-moz-background-size":"cover"});
						$('#festival').css({"-o-background-size":"cover"});
						$('#festival').css({"-ms-filter":"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../lib/img/html/bg/bg_festival.jpg', sizingMethod='scale')"});
						$('#festival').css({"filter":"DXImageTransform.Microsoft.AlphaImageLoader(src='../lib/img/html/bg/bg_festival.jpg', sizingMethod='scale'"});
						
				}
				
				
				/*
				h = w*$('#home').attr("data-coords-h")/$('#home').attr("data-coords-w");
				if(h < $(window).height()){
				}
				*/
				
				//h = w*$('#home').attr("data-coords-h")/$('#home').attr("data-coords-w");
				
				/*
				$('#home').css({height:w*$('#home').attr("data-coords-h")/$('#home').attr("data-coords-w")}); 
				$('#awards').css({height:w*$('#awards').attr("data-coords-h")/$('#awards').attr("data-coords-w")}); 
				$('#festival').css({height:w*$('#festival').attr("data-coords-h")/$('#festival').attr("data-coords-w")}); 
				$('#cultivation').css({height:w*$('#cultivation').attr("data-coords-h")/$('#cultivation').attr("data-coords-w")}); 
				$('#engagement').css({height:w*$('#engagement').attr("data-coords-h")/$('#engagement').attr("data-coords-w")}); 
				*/
				
				$('#home').css({height:h});
				$('#awards').css({height:h});
				$('#festival').css({height:h});
				$('#cultivation').css({height:h});
				$('#engagement').css({height:h});
				
				
				
				
				
				
				$('#home').find("img").each(function(){
					
					if($(this).attr("data-coords-w") != undefined){
					var w = $(window).width();
				
					if(w <= 1000){
						w = 1000;
					}
					
					var h = Math.floor(w*$('#home').attr("data-coords-h")/$('#home').attr("data-coords-w"));
					
					$(this).attr("width", Math.floor($(this).attr("data-coords-w")*w/$('#home').attr("data-coords-w")));
					$(this).attr("height", Math.floor($(this).attr("data-coords-h")*h/$('#home').attr("data-coords-h")));
					
					$('#vimgmm ul').css({"width":$(this).width()*4+'px'});
					$('#vimgmm ul').css({"height":$(this).height()+'px'});
					
					}
					
				});	
				
				
				$('#awards').find("img").each(function(){
					var w = $(window).width();
				
					if(w <= 1000){
						w = 1000;
					}
					
					var h = w*$('#awards').attr("data-coords-h")/$('#awards').attr("data-coords-w");
					
					$(this).attr("width", $(this).attr("data-coords-w")*w/$('#awards').attr("data-coords-w"));
					$(this).attr("height", $(this).attr("data-coords-h")*h/$('#awards').attr("data-coords-h"));
					
				});	
				
				
				$('#festival').find("img").each(function(){
					var w = $(window).width();
				
					if(w <= 1000){
						w = 1000;
					}
					
					var h = w*$('#festival').attr("data-coords-h")/$('#festival').attr("data-coords-w");
					
					$(this).attr("width", $(this).attr("data-coords-w")*w/$('#festival').attr("data-coords-w"));
					$(this).attr("height", $(this).attr("data-coords-h")*h/$('#festival').attr("data-coords-h"));
					
				});	
				
				
				$('#cultivation').find("img").each(function(){
					var w = $(window).width();
				
					if(w <= 1000){
						w = 1000;
					}
					
					var h = w*$('#cultivation').attr("data-coords-h")/$('#cultivation').attr("data-coords-w");
					
					$(this).attr("width", $(this).attr("data-coords-w")*w/$('#cultivation').attr("data-coords-w"));
					$(this).attr("height", $(this).attr("data-coords-h")*h/$('#cultivation').attr("data-coords-h"));
					
				});	
				
				
				$('#engagement').find("img").each(function(){
					var w = $(window).width();
				
					if(w <= 1000){
						w = 1000;
					}
					
					var h = w*$('#engagement').attr("data-coords-h")/$('#engagement').attr("data-coords-w");
					
					$(this).attr("width", $(this).attr("data-coords-w")*w/$('#engagement').attr("data-coords-w"));
					$(this).attr("height", $(this).attr("data-coords-h")*h/$('#engagement').attr("data-coords-h"));
					
				});	
				
				
				$('#engagement').find("div").each(function(){
														   
					var w = $(window).width();
				
					if(w <= 1000){
						w = 1000;
					}
					
					var h = w*$('#engagement').attr("data-coords-h")/$('#engagement').attr("data-coords-w");
					
					
					$(this).css({"width":($(this).attr("data-coords-w")*w/$('#engagement').attr("data-coords-w"))+'px'});
					$(this).css({"height":($(this).attr("data-coords-h")*h/$('#engagement').attr("data-coords-h"))+'px'});
					
					var fs = Math.floor(50*(w/$('#engagement').attr("data-coords-w")));
					var fsd = Math.floor(23*(w/$('#engagement').attr("data-coords-w")));
					
					var fsline = Math.floor(10*(w/$('#engagement').attr("data-coords-w")));
					var fsdline = Math.floor(8*(w/$('#engagement').attr("data-coords-w")));
					
					$('#engagement .headline_head').css({"font-size":fs+"px", "line-height":(fs+fsline)+"px"});
					$('#engagement .headline_description').css({"font-size":fsd+"px", "line-height":(fsd+fsdline)+"px"});
					
				});	
				
				$('#cultivation').find("div").each(function(){
														   
					var w = $(window).width();
				
					if(w <= 1000){
						w = 1000;
					}
					
					var h = w*$('#cultivation').attr("data-coords-h")/$('#cultivation').attr("data-coords-w");
					
					
					$(this).css({"width":($(this).attr("data-coords-w")*w/$('#cultivation').attr("data-coords-w"))+'px'});
					$(this).css({"height":($(this).attr("data-coords-h")*h/$('#cultivation').attr("data-coords-h"))+'px'});
					
					var fs = Math.floor(50*(w/$('#cultivation').attr("data-coords-w")));
					var fsd = Math.floor(23*(w/$('#cultivation').attr("data-coords-w")));
					
					var fsline = Math.floor(10*(w/$('#cultivation').attr("data-coords-w")));
					var fsdline = Math.floor(8*(w/$('#cultivation').attr("data-coords-w")));
					
					$('#cultivation .headline_head').css({"font-size":fs+"px", "line-height":(fs+fsline)+"px"});
					$('#cultivation .headline_description').css({"font-size":fsd+"px", "line-height":(fsd+fsdline)+"px"});
					
				});	
				
				$('#home').find("div").each(function(){
														   
					var w = $(window).width();
				
					if(w <= 1000){
						w = 1000;
					}
					
					var h = w*$('#home').attr("data-coords-h")/$('#home').attr("data-coords-w");
					
					
					$(this).css({"width":($(this).attr("data-coords-w")*w/$('#home').attr("data-coords-w"))+'px'});
					$(this).css({"height":($(this).attr("data-coords-h")*h/$('#home').attr("data-coords-h"))+'px'});
					
					var fs = Math.floor(85*(w/$('#home').attr("data-coords-w")));
					var fsd = Math.floor(45*(w/$('#home').attr("data-coords-w")));
					
					var fsline = Math.floor(70*(w/$('#home').attr("data-coords-w")));
					var fsdline = Math.floor(20*(w/$('#home').attr("data-coords-w")));
					
					$('#home .headline_head').css({"font-size":fs+"px", "line-height":(fsline)+"px"});
					$('#home .headline_description').css({"font-size":fsd+"px", "line-height":(fsd+fsdline)+"px"});
					
					fs = Math.floor(23*(w/$('#home').attr("data-coords-w")));
					fsd = Math.floor(26*(w/$('#home').attr("data-coords-w")));
					
					fsline = Math.floor(4*(w/$('#home').attr("data-coords-w")));
					fsdline = Math.floor(8*(w/$('#home').attr("data-coords-w")));
					
					$('#home .highlight td .title').css({"font-size":fs+"px", "line-height":(fs+fsline)+"px"});
					$('#home .highlight td .description').css({"font-size":fsd+"px", "line-height":(fsd+fsdline)+"px"});
					
					fs = Math.floor(18*(w/$('#home').attr("data-coords-w")));
					fsline = Math.floor(22*(w/$('#home').attr("data-coords-w")));
					$('#home .more').css({"font-size":fs+"px", "line-height":(fs+fsline)+"px"});
					
					fs = Math.floor(32*(w/$('#home').attr("data-coords-w")));
					fsd = Math.floor(50*(w/$('#home').attr("data-coords-w")));
					fsline = Math.floor(60*(w/$('#home').attr("data-coords-w")));
					
					$('#home .highlight td .h_00').attr("height", fs);
					$('#home .highlight td .h_01').attr("height", fsd);
					$('#home .highlight td .h_02').attr("height", fsline);
					
					
					
				});	
				
				
				$('#festival').find("div").each(function(){
														   
					var w = $(window).width();
				
					if(w <= 1000){
						w = 1000;
					}
					
					var h = w*$('#festival').attr("data-coords-h")/$('#festival').attr("data-coords-w");
					
					
					$(this).css({"width":($(this).attr("data-coords-w")*w/$('#festival').attr("data-coords-w"))+'px'});
					$(this).css({"height":($(this).attr("data-coords-h")*h/$('#festival').attr("data-coords-h"))+'px'});
					
					var fs = Math.floor(90*(w/$('#festival').attr("data-coords-w")));
					var fsd = Math.floor(50*(w/$('#festival').attr("data-coords-w")));
					
					var fsline = Math.floor(8*(w/$('#festival').attr("data-coords-w")));
					var fsdline = Math.floor(6*(w/$('#festival').attr("data-coords-w")));
					
					$('#festival .headline_head').css({"font-size":fs+"px", "line-height":(fs+fsline)+"px"});
					$('#festival .headline_description').css({"font-size":fsd+"px", "line-height":(fsd+fsdline)+"px"});
					
				});	
				
				
				$('#awards').find("div").each(function(){
														   
					var w = $(window).width();
				
					if(w <= 1000){
						w = 1000;
					}
					
					var h = w*$('#awards').attr("data-coords-h")/$('#awards').attr("data-coords-w");
					
					
					$(this).css({"width":($(this).attr("data-coords-w")*w/$('#awards').attr("data-coords-w"))+'px'});
					$(this).css({"height":($(this).attr("data-coords-h")*h/$('#awards').attr("data-coords-h"))+'px'});
					
					var fs = Math.floor(85*(w/$('#awards').attr("data-coords-w")));
					var fsd = Math.floor(45*(w/$('#awards').attr("data-coords-w")));
					
					var fsline = Math.floor(70*(w/$('#awards').attr("data-coords-w")));
					var fsdline = Math.floor(20*(w/$('#awards').attr("data-coords-w")));
					
					$('#awards .headline_head').css({"font-size":fs+"px", "line-height":(fsline)+"px"});
					$('#awards .headline_description').css({"font-size":fsd+"px", "line-height":(fsd+fsdline)+"px"});
					
					
					
				});	
				
				
				
				var pl = ($(window).width()-32)/2;
				var pt = ($(window).height()-32)/2-80;
				
				$('#preloader').css({"width":"32px", "height":"32px", "left":pl+"px", "top":pt+"px"});
				
				
				
				video_player_position();
				
				video_player2_position();
				
			
				
				if(!location.hash.match("page") && location.hash != ""){
					scroll_to_section();
				} 
				
				init_arrangement_layer_in();
				
				
				$(".headline_description a").mousedown(function() {
					location.hash = $(this).attr("href");
					scroll_to_section();
					init_arrangement_layer_in();
				});
				
				
				
				$('#vimgmm').css({"overflow":"hidden"});
				$('#vimgmm').scrollLeft(0);
				
				$("#home .description a").mousedown(function() {
					
					if($(this).attr("data-number") != undefined){
					
					var ww = 0; 
					$('#vimgmm').find("img").each(function(){
						ww = $(this).width();
					});
					
					
					if($('#vimgmm').scrollLeft() >= (ww*$(this).attr("data-number"))-5 && $('#vimgmm').scrollLeft() <= (ww*$(this).attr("data-number"))+5){
						$('#vimgmm').css({opacity:0});
					}
					
					$('#vimgmm').stop().animate({opacity:1, scrollLeft: ww*$(this).attr("data-number")}, 300,'easeInOutExpo');
					
					}
					
				});
				
				$("#home .video_play").mousedown(function() {
					
					$("#videoPlayer").show();
					
					
					if(jQuery.browser.msie){
						/*alert(videoCode);
						if($('object').length) {
							
						} else {
							alert('dsfsd');
							$('object').append(videoCode);
						}*/
					}
					
					video_player_position();
					
					$("table.videoPlayerBgPos").css({"height":$(window).height()+"px"});
					$("#videoPlayer").css({"height":$(document).height()+"px", "width":"100%"});
					$("#videoPlayer").stop().animate({opacity:1}, 300, 'easeInOutExpo', function() {
						if(jQuery.browser.msie){
							this.style.removeAttribute('filter');
						}
					});																					   
				});	
				
				$("#home .video_play2").mousedown(function() {
					
					$("#videoPlayer2").show();
					
					
					if(jQuery.browser.msie){
						/*alert(videoCode);
						if($('object').length) {
							
						} else {
							alert('dsfsd');
							$('object').append(videoCode);
						}*/
					}
					
					video_player2_position();
					
					$("table.videoPlayerBgPos").css({"height":$(window).height()+"px"});
					$("#videoPlayer").css({"height":$(document).height()+"px", "width":"100%"});
					$("#videoPlayer2").stop().animate({opacity:1}, 300, 'easeInOutExpo', function() {
						if(jQuery.browser.msie){
							this.style.removeAttribute('filter');
						}
					});																					   
				});	
				
				
				$("div.videoPlayerBg").mousedown(function() {
					
					
					if(jQuery.browser.msie){
						/*if($('object').length) {
							videoCode = $('object').html();
						    $('object').remove(); 
						} */
					}
					
					if($("#videoPlayer").is(":visible")){
						$("#videoPlayer").stop().animate({opacity:0}, 300, 'easeInOutExpo', function() {
							$(this).hide();
						});	
					}	
					
					if($("#videoPlayer2").is(":visible")){
						$("#videoPlayer2").stop().animate({opacity:0}, 300, 'easeInOutExpo', function() {
							$(this).hide();
						});	
					}
					
				});	
				
				
				
				
				
				
				$("div.mm_logo,div.mm,#footer").delay(200).fadeIn(1000, function(){
						
						//var inactiveMargin = -15;
						var inactiveMargin = 0;
					   	var wrapperHeight = $("#mm_wrapper").height();
						var scrollableHeight = $("div.mm").outerHeight() + 2*inactiveMargin;
						
						$("#mm_wrapper").mousemove(function(e){
							var wrapperOffset = $("#mm_wrapper").offset();
							// Scroll menu
							
							var top = (e.pageY -  wrapperOffset.top) * (scrollableHeight - wrapperHeight) / wrapperHeight  - inactiveMargin;
					
							if (top < 0){
							  top = 0;
							}
						
							$("#mm_wrapper").scrollTop(top);
						
					  	});
						
						
						$("#menu_wrapper").mouseleave(function(){
							//alert('dsfdf');
							
							if(!mm_mdoBoo){
							
								if(location.hash.match("#/home")){
									$('#mm_wrapper').stop().animate({scrollTop:(57+23*0)}, 800, 'easeInOutExpo');
								} else if(location.hash.match("#/awards")){
									$('#mm_wrapper').stop().animate({scrollTop:(57+23*0)}, 800, 'easeInOutExpo');
								} else if(location.hash.match("#/festival")){
									$('#mm_wrapper').stop().animate({scrollTop:(57+23*1)}, 800, 'easeInOutExpo');
								} else if(location.hash.match("#/cultivation")){
									$('#mm_wrapper').stop().animate({scrollTop:(57+23*2)}, 800, 'easeInOutExpo');
								} else if(location.hash.match("#/engagement")){
									$('#mm_wrapper').stop().animate({scrollTop:(57+23*3)}, 800, 'easeInOutExpo');
								} else {
									$('#mm_wrapper').stop().animate({scrollTop:(57+23*0)}, 800, 'easeInOutExpo');
								}
							
							}
						   
						   
						});
						
						
						
						$("div.mm_logo").find("img").mousedown(function() {
							location.hash = '#/home';
							
							
										 engagement_layer_in(false);
										 cultivation_layer_in(false);
										 festival_layer_in(false);
										 awards_layer_in(false);
											
										$('#home').find("img").css({"top":$(document).height()+"px"});
										$('#home').find("div").css({"top":$(document).height()+"px"});
									
										home_layer_in(true);
										 
										 
										 
										 
									mm_wrapper_scroll_to_section(0);
									scroll_to_section();	 
						});
						
						
						$("div.mm").find("img").mousedown(function() {
							 var id = $(this).attr("id");
							 
							 if(id == 'mm_btn05' || id == 'mm_btn01'){
							
								location.hash = '#/awards';
								 id = 'mm_btn01';
							
								 	
							 } else if(id == 'mm_btn11' || id == 'mm_btn01'){
								
								location.hash = '#/awards';
								 id = 'mm_btn01';
								 
								 
							 } else if(id == 'mm_btn12' || id == 'mm_btn02'){
								
								location.hash = '#/festival';
								 id = 'mm_btn02';
								 
								
							 } else if(id == 'mm_btn13' || id == 'mm_btn03'){
								
								location.hash = '#/cultivation';
								 id = 'mm_btn03';
								 
								
							 } else if(id == 'mm_btn14' || id == 'mm_btn04'){
								
								location.hash = '#/engagement';
								 id = 'mm_btn04';
								
							 } 
							
							scroll_to_section();
							
							 $("div.mm").find("img").each(function(){
								
								if($(this).attr("id") == id){
									
									 var src = "../lib/img/html/mm/"+$(this).attr("id")+"_selected.png";
									 
									 $("div.mm_logo").find("img").attr("src", "../lib/img/html/mm/mm_logo.png");
									 
									 if(id == 'mm_btn01' || id == 'mm_btn03'){
										 src = "../lib/img/html/mmw/"+$(this).attr("id")+"_selected.png";
										  $("div.mm_logo").find("img").attr("src", "../lib/img/html/mmw/mm_logo.png");
									 }
									 
									 $(this).attr("src", src);
									 
									 if(id == 'mm_btn00'){
										 
										 
										 
										 arrangement_layer_in(0);
										 mm_wrapper_scroll_to_section(0);
										 
									 } else if(id == 'mm_btn01'){
										 
										arrangement_layer_in(1); 
										mm_wrapper_scroll_to_section(0);
										 
										 
									 } else if(id == 'mm_btn02'){
										 
										 arrangement_layer_in(2);
										 mm_wrapper_scroll_to_section(1);
									 } else if(id == 'mm_btn03'){
										 
										 arrangement_layer_in(3);
										 mm_wrapper_scroll_to_section(2);
									 } else if(id == 'mm_btn04'){
										 
										 arrangement_layer_in(4);
										 mm_wrapper_scroll_to_section(3);
									 } 
									 
									 
									 
								} else {
									var src = "../lib/img/html/mm/"+$(this).attr("id")+".png";
									
									if(id == 'mm_btn01' || id == 'mm_btn03'){
										src = "../lib/img/html/mmw/"+$(this).attr("id")+".png";
									}
									$(this).attr("src", src);
								}
								
								
							});			
							
							
						});	
	         		
						
		    	}); 
				
				
						
		});
		
		
		
		
		$(window).scroll(function (position) {
			
				mm_wrapper_scroll_to_section_update();
				section_img_resize_position();
				
				
				if($("#videoPlayer").is(":visible")){
					$("#videoPlayer").stop().animate({opacity:0}, 300, 'easeInOutExpo', function() {
						$(this).hide();
					});	
				}
				
				if($("#videoPlayer2").is(":visible")){
					$("#videoPlayer2").stop().animate({opacity:0}, 300, 'easeInOutExpo', function() {
						$(this).hide();
					});	
				}
				   
		});	
		


	});
	
	
	
	
	
	
	
	// -------- END jquery functions --------
	
	

	
