
/* 
	Globales JavaScript PROJECT Fonds Gruppe
	
*/


// toggle biografie (/unternehmen/geschaeftsfuehrung/)

function toggle(element) {
				if (document.getElementById(element).style.display == "none") {
				document.getElementById(element).style.display = "";
				} else {
				document.getElementById(element).style.display = "none";
				}
            }





$j = jQuery.noConflict();

var Snorkel = {
	init : function() {
		var c = Snorkel;
		var p = c.Project;



		$j(document).ready(function() {
			// List function(s) to fire onload here
			p.cruft();
			p.featureZoom();
			//p.inputFocus();
			p.tableStripes();
			p.tabsDownload();
			p.tagIt();

			if (typeof DD_belatedPNG != "undefined") {
				DD_belatedPNG.fix(c.Config.sPNGsel);
			}
		});

	}

	,Config : {
		sHTMLtag : "can-has-js"
		,sPNGsel : "#site, #wrap-outer, #wrap-inner, #download a, body.sect-home #intro p.pic img, #footer, body.sect-home #main ol.nav img"
		,sSwfPath : "/-/swf/"
	}

	/*
		CLIENT-SPECIFIC FUNCTIONS
	*/
	,Project : {
		cruft : function() {
			$j("li.entry .title a").append("<i></i>");
		}

		

		/*
			Clear text fields on focus
		*/
		
		,inputFocus : function() {
			var oInputs = $j("input[type=text]");
			if (oInputs.length) {
				for (var i = 0; i < oInputs.length; i++) {
					oInputs[i].onfocus = function() {
						this.value = "";
					}
				}
			}
		}

		/*
			Features
		*/
		,featureZoom : function() {
			var oPicLinks = $j("li.feat>p.pic>a");

			$j(oPicLinks).each(function() {
				if ($j(this).attr("href").match(/\.(jpe?g|gif|png)/)) {
					$j(this).append("<i>Vergrößern</i>");
				}
			});
		}

		/*
			Download tabs 123
		*/
		,tabsDownload : function() {
			var oItems = $j("#steps>li");

			if ($j(oItems).length) {
				var iLimit = 0;
				var sSlug = oNavList = iSafe = "";
				var oNavList = "<ol class=\"nav\">\n";

				$j(oItems).each(function(i) {
					iSafe = i + 1;
					sSlug = "step-" + iSafe;

					var iHeight = $j(this).height();

					if (iHeight > iLimit) {
						iLimit = iHeight + 20;
					}

					$j(this).attr("id", sSlug);
					oNavList += "<li><a href=\"#" + sSlug + "\"><b>Step</b> " + iSafe + "</a></li>\n";
				});

				oNavList += "</ol>";

				$j("ol#steps").before(oNavList);
				$j("#how-to ol.nav>a").remove();	/* Safari fix */

				if ($j("#how-to ol.nav").length) {
					// $j("#steps").height(Math.ceil(iLimit / 13) + "em");

					if ($j.browser.msie) {
						$j("#how-to ol.nav").tabs();
					} else {
						$j("#how-to ol.nav").tabs({ fx: {
							duration: "fast"
							,opacity: "toggle"
						}});
					}
				}
			}
		}

		

		/*
			TABLE STRIPES!!1!
		*/
		,tableStripes : function() {
			$j("div>table tbody>tr:odd, #fonds-download>ul>li:odd").addClass("odd");
		}

		/*
			Add @class to <html> if JS is active
		*/
		,tagIt : function() {
			var c = Snorkel;

			var oHtml = $j("html");

			if ($j(oHtml)) {
				$j(oHtml).addClass(c.Config.sHTMLtag);
			}
		}
	}
};

Snorkel.init();

/*
	Zhang 20110722
*/
function mail(s) {
	s = s.replace("(at)", "@");
	document.write('<a href="mailto:' + s + '">');
}







