// JavaScript Document

var status=0;
function change(obj, box){
	closeAll(box);	
	var content =obj.parentNode.getElementsByTagName("div")[0];
	if(!status){
		content.style.display="none";
		status=1;
		}
	else {
		obj.parentNode.className="cool_box_js_act";
		content.style.display="block";
		status=0;
		}
}

function closeAll(box){
	var box =document.getElementById(box);
	for(var i=0 ; i<box.childNodes.length; i++){
		if((box.childNodes[i].nodeType!=3) && (box.childNodes[i].nodeType!=8)){
			box.childNodes[i].className="";
			box.childNodes[i].getElementsByTagName("div")[0].style.display="none";
		}
	}
	status=1;
}

/*show picture*/
var t_id = setInterval(animate,20);
var pos=0;
var dir=2;
var len=0;
function animate(){
	var elem = document.getElementById('progress');
	if(elem != null){
		if (pos==0) len += dir;
		if (len>32 || pos>79) pos += dir;
		if (pos>79) len -= dir;
		if (pos>79 && len==0) pos=0;
		elem.style.left = pos;
		elem.style.width = len;
	}
}
function remove_loading(){
	this.clearInterval(t_id);
	var targelem = document.getElementById('loader_container');
	targelem.style.display='none';
	targelem.style.visibility='hidden';
	var t_id = setInterval(animate,60);
}