/*function gobyscroll(target, b) {
  var c = parseInt(window.getElementById("container").style.height);
  var y = target.offsetTop;
  wy = window.pageYOffset;
  alert(window.innerHeight);
  if ((window.outerHeight + wy) > c) {
	  y = window.innerHeight - c;
  }
  if (y > wy) {
    window.scrollBy(0, b);
    window.setTimeout( function(){ gobyscroll(target, b - 2)}, 10 );
  }
  if (y < wy) {
  	window.scrollTo(0, y);
  }
}*/
function fett(el) {
	el.innerHTML = '<strong>' + el.innerHTML + '</strong>';			
}
function slide(el, html, url) {
	el.style.overflow = 'hidden';
	D1 = document.createElement("DIV");
	D2 = document.createElement("DIV");
	D1.innerHTML = el.innerHTML;
	el.innerHTML = '';
	D2.innerHTML = html;
	el.appendChild(D1);	
	el.appendChild(D2);
	D1.id = "D1";
	D2.id = "D2";
	D1.style.marginLeft = "0px";
	if (((navigator.userAgent).search("MSIE") != -1)) {
		D2.style.marginTop = "-"+D1.offsetHeight + "px";
	}
	//el.style.height = D2.offsetHeight + "px";
	slideheight(D1.offsetHeight, D2.offsetHeight, el);
	
		slidedo(D1, D2, el, 83);

}

function slidedo(D1, D2, el, mm) {
	m = parseInt(D1.style.marginLeft) - mm;
	if (m  < -727) { m = -727; }
	D1.style.marginLeft = Math.round(m) + 'px';
	D2.style.marginLeft = (730 + Math.round(m)) + 'px';
	if (mm > 3 ) { mm = mm * 0.89; }
	if (m > -727) { 
		window.setTimeout( function(){ slidedo(D1, D2,el,  mm)}, 10 );
	} 
	if (m <= -727) { 
		D2.style.marginLeft = "0px";
		D1.style.marginLeft = "-727px";
		slideend(D1, D2, el);
	}
}

function slideend(D1, D2, el) {
	var html = D2.innerHTML;
	el.removeChild(D1);
	el.removeChild(D2);
	el.innerHTML = html;
	el.style.height = "auto";
	//el.style.height = el.offsetHeight + "px";
	//document.getElementById("content").style.height = document.getElementById("content").offsetHeight + "px";
}

function slideheight(D1, D2, el) {
	if (D1 > D2) {
		heightmin(D1, D2+20, el, 30);	
	} else  if (D1 < D2) {
		heightplu(D1, D2+20, el, 30);
	}
}

function heightmin(D1, D2, el, hm) {
	D1 = D1 - hm;
	if (D1  < D2) { D1 = D2; }
	el.style.height = Math.round(D1) + 'px';
	if (hm > 3 ) { hm = hm * 0.99; }
	if (D1 > D2) { 
		window.setTimeout( function(){ heightmin(D1, D2,el,  hm)}, 10 );
	} 
	if (D1 = D2) { 
		el.style.height = "auto";
	} 
	if (D1 < D2) { 
		el.style.height = "auto";
	} 
}

function heightplu(D1, D2, el, hm) {
	D1 = D1 + hm;
	if (D1  > D2) { D1 = D2; }
	el.style.height = Math.round(D1) + 'px';
	if (hm > 3 ) { hm = hm * 0.99; }
	if (D1 < D2) { 
		window.setTimeout( function(){ heightplu(D1, D2,el,  hm)}, 10 );
	} 
	if (D1 = D2) { 
		el.style.height = "auto";
	} 
	if (D1 > D2) { 
		el.style.height = "auto";
	} 
}

function FadeIn(el, doing) {
	el.style.visibility = 'visible';
	el.style.opacity = "0";
	el.style.filter="Alpha(opacity=0)";
	FadeInStart(el, doing, 0);
	el.style.zoom = "100%";
	document.getElementById("content").style.height = "auto";
}

function FadeInStart(el, doing, op) {
	var o = op + 0.08 / (1 + op);
	op = o;
	if (o > 1) { o = 1; }
	el.style.opacity = o;
	el.style.filter = "Alpha(opacity=" + (o * 100) + ")"; 
	if (o < 1) { 
		window.setTimeout( function(){ FadeInStart(el, doing, op)}, 20 );
	} 			
	if (o >= 1) {
		//el.style.height = el.offsetHeight + "px";
		//document.getElementById("content").style.height = document.getElementById("content").offsetHeight + "px";
		try { eval(doing); } catch (e) { } 	
	}
}

function FadeOut(el, doing) {
	el.style.opacity = "1";
	FadeOutStart(el, doing, 1);
}

function FadeOutStart(el, doing, op) {
	var o = op - (0.2);
	op = o;
	if (o < 0) { o = 0; }
	el.style.opacity = o;
	el.style.filter="Alpha(opacity="+(Math.round(o*100))+")";
	if (o > 0) { 
		window.setTimeout( function(){ FadeOutStart(el, doing, op)}, 20 );
	} 			
	if (o <= 0) {
		el.style.visibility = 'hidden';
		try { eval(doing); } catch (e) { } 	
	}
}

function wait(el) {
	el.style.backgroundImage = "loading.gif";
	el.style.backgroundPosition = "center";
	el.style.backgroundRepeat = "no-repeat";

}

function unwait(el) {
	el.style.backgroundImage = "";
}