var freeze_location = 0;
var head_clone = null;

$(document).scroll(function(){
   var height = $('#scroll_div').offset().top;
   var window_height = $(document).scrollTop();
	
	if (height - window_height <= 25){
		$('#scroll_div').css({'position': 'fixed', 'top': '25px'}); 
		
		if (freeze_location == 0) freeze_location =  window_height;
		
	}
	
	if (window_height < freeze_location ){
		$('#scroll_div').css({'position': 'static'}); 
	}
	/*
	var div_head_offst_height = $('#head').offset().top;
	var div_head_height = $('#head').height();
	
	if (window_height > div_head_height * 1.3){
	
		if (!head_clone) {
			head_clone = $('#head').clone();
			head_clone.attr('id', 'head_clone');
			head_clone.css({
				'position': 'fixed',
				'background': '#FFF',
				'z-index': '99999',
				'font-size': '0.7em',
				'width': '960px',
				'top': '0',
				'padding-top': '15px',
				'border-bottom': '5px solid #ECECEC'
			});
			$('#main_content').append(head_clone);
			head_clone.slideDown(400);
		} else {

			head_clone.slideDown(400);
		}
		
		
		
	} else {
		head_clone.slideUp();
	}
	*/
	
});

// Tynt
if(document.location.protocol=='http:'){
 var Tynt=Tynt||[];Tynt.push('b_25eyMmGr467eacwqm_6r');
 (function(){var s=document.createElement('script');s.async="async";s.type="text/javascript";s.src='http://tcr.tynt.com/ti.js';var h=document.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);})();
}

// 防止 iframe 嵌入
jQuery(document).ready(function(){
	try{
		var tmp = parent.window.location != "";
	}catch(err){
		parent.location.href = document.documentURI;
	}finally{
		var frameNum=window.top.length;
		if (frameNum == 0){
			window.opener = null;
			window.close();
		}
	}
});