// JavaScript Document

var load_new=true;


function jump(page){
	if (link_id[head_act]!=0) go_url(link_id[head_act]);
}

function fade(x){
	var alf1=100-x;
	var alf2=1-Math.round(x)/100;
	document.getElementById('head_pic2').style.filter='Alpha(Opacity='+alf1+')';
	document.getElementById('head_pic2').style.opacity=alf2;
	if (x<100){ 
		x=x+5;
		setTimeout('fade('+x+')',30);
	}
}

var set_img=function(){
	document.getElementById('head_pic2').style.filter='Alpha(Opacity=100)';
	document.getElementById('head_pic2').style.opacity=1;
	document.getElementById('head_pic2').title=title[head_act];
	if (link_id[head_act]!=0) document.getElementById('head_pic2').style.cursor='pointer'; else
		document.getElementById('head_pic2').style.cursor='auto';
	document.getElementById('head_pic').style.background='url('+head_img[head_act]+')';
	fade(0);
	load_new=true;

	
}

function chg_headpic(){
	if(load_new==true){
	document.getElementById('head_pic2').style.background='url('+head_img[head_act]+')';
	if (head_img[head_act]=='') alert(head_img[head_act]+':'+head_act);
	if (head_act<head_count-1) head_act++; else head_act=0;
	var t_img= new Image();
	
	t_img.src=head_img[head_act];
	load_new=false;
	//alert(navigator.appName);
	if (navigator.appName!='Microsoft Internet Explorer') t_img.onload=set_img; else set_img();
	
	
	//t_img.onload=set_img;	
	
	
	setTimeout('chg_headpic()',ms[head_act]);	
	} else setTimeout('chg_headpic()',100); 
}
//alert(ms);
setTimeout('chg_headpic()',ms[0]);
