
var myimages=new Array();
var prl=new Array();
var wz=new Array();
myimages[0]='http://www.bing.com/fd/hpk2/Baboon_EN-US770913094.jpg';
wz[0]='100% 30%';
myimages[1]='http://www.bing.com/fd/hpk2/Langjokull_EN-US334381078.jpg';
wz[1]='100% 80%';
myimages[2]='http://www.zhaiduo.com/photos/bamboo.jpg';
wz[2]='100% 70%';
myimages[3]='http://www.zhaiduo.com/photos/sanhuyu.jpg';
wz[3]='100% 55%';
myimages[4]='http://www.bing.com/fd/hpk2/Andes_EN-US1356808501.jpg';
wz[4]='50% 50%';
myimages[5]='http://www.bing.com/fd/hpk2/Opossums_EN-US1582063179.jpg';
wz[5]='50% 70%';
myimages[6]='http://www.bing.com/fd/hpk2/PearlHarbor_EN-US1538461641.jpg';
wz[6]='50% 70%';
myimages[7]='http://www.bing.com/fd/hpk2/Luxembourg_EN-US2305373107.jpg';
wz[7]='50% 70%';

myimages[8]='http://www.zhaiduo.com/photo/bluesky2.jpg';
wz[8]='50% 50%';
myimages[9]='http://www.zhaiduo.com/photo/green2.jpg';
wz[9]='50% 50%';
myimages[10]='http://www.zhaiduo.com/photo/green4.jpg';
wz[10]='50% 50%';
myimages[11]='http://www.zhaiduo.com/photo/green3.jpg';
wz[11]='50% 50%';
myimages[12]='http://www.zhaiduo.com/photo/bugkiller.jpg';
wz[12]='50% 50%';
myimages[13]='http://www.zhaiduo.com/photo/shell.jpg';
wz[13]='50% 50%';
myimages[14]='http://www.zhaiduo.com/photo/ice.jpg';
wz[14]='50% 50%';
myimages[15]='http://www.zhaiduo.com/photo/green.jpg';
wz[15]='50% 50%';
myimages[16]='http://www.zhaiduo.com/photo/bug.jpg';
wz[16]='50% 50%';
myimages[17]='http://www.zhaiduo.com/photo/guangzhou3.jpg';
wz[17]='50% 50%';
myimages[18]='http://www.zhaiduo.com/photo/bluesky.jpg';
wz[18]='50% 50%';
myimages[19]='http://www.zhaiduo.com/photo/guangzhou2.jpg';
wz[19]='50% 50%';
myimages[20]='http://www.zhaiduo.com/photo/guangzhou.jpg';
wz[20]='50% 50%';

var imax=myimages.length;
for(i=0;i<imax;i++){
prl[i]= new Image(10,10); 
prl[i].src=myimages[i];
}
var tmp_img=myimages[0];
var tmp_wz=wz[0];
	
$("#header").ready(function() {

	$("#navbar-iframe").slideUp("slow");
	
	var is_run=0;
	$("#header").hover(function(e){
		if(is_run==0){
			is_run=1;
			$('#description').animate({ 
		        opacity: 0
		      }, 500, "swing", function(){
		     	
		     	//
		     	$('#description').animate({ 
		        	opacity: 1
		        }, 500, "swing", function(){
		        	is_run=0;	
		        	
		        });
		     	
		    } );
		    
		}
	});
	
	var gal_run=0;
	$("#header").ready(function(e){
		if(gal_run==0){
			gal_run=1;
			
			var r = Math.floor(Math.random() * imax);
			tmp_img=myimages[r];
			tmp_wz=wz[r];
			

			$('#header').animate({ 
				opacity: 0
		        //background: "#476476 url('"+tmp_img+"') repeat-x "+tmp_wz+";",
		      }, 1000, "swing", function(){
		     	$('#header').css("background","#476476 url('"+tmp_img+"') repeat-x "+tmp_wz+"");
		     	$('#header').animate({ 
		     		opacity: 1
		        	//background: "#476476 url('"+tmp_img+"') repeat-x "+tmp_wz+";",
		        }, 1000, "swing", function(){
					
		        	gal_run=0;	
		        	
		        });
		     	
		    } );
		    
		}
	});
	
	$("#header").click(function(e){
		if(gal_run==0){
			gal_run=1;
			
			var r = Math.floor(Math.random() * imax);
			tmp_img=myimages[r];
			tmp_wz=wz[r];
			
			$('#header').animate({ 
				opacity: 0
		        //background: "url('"+tmp_img+"') repeat-x "+tmp_wz+";",
		      }, 1000, "swing", function(){
		     	$('#header').css("background","#476476 url('"+tmp_img+"') repeat-x "+tmp_wz+"");
		     	$('#header').animate({ 
		     		opacity: 1
		        	//background: "url('"+tmp_img+"') repeat-x "+tmp_wz+";",
		        }, 1000, "swing", function(){
					
		        	gal_run=0;	
		        	
		        });
		     	
		    } );
		    
		}
	});

	
	
});	

$("#profile-container").ready(function() {
	$('<p class="profile-link"><a href="https://www.google.com/reader/shared/03023262007644757583">My Shared Items</a></p><p class="profile-link"><a href="http://lab.zhaiduo.com/test/twitter.php">Zhaiduo Sayings</a></p><!--<p align="center">Online Video<br><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="220" height="165" id="player_zd" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="player_zd.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="player_zd.swf" quality="high" bgcolor="#000000" width="220" height="165" name="player_zd" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></p>-->').appendTo("#profile-container");
});

 