/*  
Scripting 4 suco-ratz.ch
realisation : George @ www.gehonline.ch
*/
var d = document;

ddsmoothmenu.init({
	mainmenuid: "navbox", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'slideMenu', //class added to menu's outer DIV
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})


js = function () {
	var key = 10;
	
	this.decode = function (str) {
		var address = "";
		var len = str.length;
		for(var i=0; i < len; i++)	{
			var n = str.charCodeAt(i);
			if (n >= 43 && n <= 90)	{	// 0-9 A-Z @ special chars
				address += this.decrypt(n,43,90);	
			} else if (n >= 95 && n <= 122)	{	// a-z_
				address += this.decrypt(n,95,122);	
			} else {
				address += str.charAt(i);
			}
		}
		return (address);
	}
	
	this.decrypt = function (n,start,end) {
		n = n+ key;
		if (n > end)	{
			n = start + (n - end - 1);
		} else if (n < start)	{
			n = end - (start - n - 1);
		}
		return String.fromCharCode(n);
	}
	
	this.href = function (str) {
		return "mailto:" + str;
	}
	
	/*	//study of navigation justificating by js - do not use
	this.justifyMenuBar = function() {
		var mmenu = d.getElementById("mainMenu");
		var totalWidth = mmenu.clientWidth;
		var count = mmenu.childNodes.length;
		var sum = 0;
		//	1st loop count width
		var node = mmenu.firstChild
		while (node != null) {
			if ("LI" == node.nodeName) { sum += node.clientWidth; }
			node = node.nextSibling;
		}
		var WidthDiff = Math.floor( totalWidth / (totalWidth - sum) );
		//	2nd loop change width
		var node = mmenu.firstChild
		while (node != null) {
			sum =  node.clientWidth + WidthDiff - 1;
			if ("LI" == node.nodeName) { node.getElementsByTagName("a")[0].style.width = sum + "px"; }
			node = node.nextSibling;
		}
	}
	*/
}

/*
Textual Tooltip Script- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

appear = function () {

	this.regenerate = function(){
		window.location.reload()
	}

	this.regenerate2 = function(){
		if (d.layers){
			this.appear()
			setTimeout("window.onresize=this.regenerate",450)
		}
	}

 	this.changetext = function(whichcontent){
		if (d.all||d.getElementById){
			cross_el=d.getElementById? d.getElementById("fade1"):d.all.fade1
			cross_el.innerHTML=whichcontent
		}
		else if (d.layers){
			d.d1.d.d2.d.write(whichcontent)
			d.d1.d.d2.d.close()
		}
	}

	this.appear = function(){
		d.d1.visibility='show'
	}

}

suco = new js();

faqAnswer = new appear();
window.onload = faqAnswer.regenerate2
