// JavaScript Document

var load_new=true;

function go_url(gostr){
	window.location=wwwsite+gostr;
}

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);
	}
}

function set_img(){
	document.getElementById('head_pic2').style.filter='Alpha(Opacity=100)';
	document.getElementById('head_pic2').style.opacity=1;
	document.getElementById('head_pic').style.background='url('+wwwsite+'design/head/'+head_img[head_act]+')';
	fade(0);
	load_new=true;
//alert('h');
	
}

function chg_headpic(){
	if(load_new==true){
	document.getElementById('head_pic2').style.background='url('+wwwsite+'design/head/'+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=wwwsite+'design/head/'+head_img[head_act];
	t_img.onload=function(){
			set_img();
	}
	load_new=false;
	
	setTimeout('chg_headpic()',15000);	
	} else setTimeout('chg_headpic()',100); 
}


function load_php(div,www){
	var url=wwwsite+www+'noframe/';
	
	var pars='';
	var target=div;
	var myAjax=new Ajax.Updater(
								target,
								url,
								{
									method: 'get', 
									parameters: pars
									
								}
								);
}