//----------------------------------------------------------------------------------------------------------
// Browser testen, erzeugt stBrowser (gleich wie CF Browsererkennung)
// stBrowser.bMac 		-> true, false (boolean) 
// stBrowser.sVersion	-> Versionsnummer (float)
// stBrowser.sBrowser	-> "NS", "IE", "SAFARI", "OPERA" (string)
// stBrowser.sType		-> "DOM", "IELAYER", "NSLAYER" (string)


function oBrowser(f_bMac,f_sVersion,f_sBrowser,f_sType) 
{
	this.bMac = f_bMac;
	this.sVersion = f_sVersion;
	this.sBrowser = f_sBrowser;
	this.sType = f_sType;
}

var bMac = false;
var sVersion = 3.0;
var sBrowser = "IE";
var sType = "IELAYER";
var http_user_agent = navigator.userAgent.toLowerCase(); 	

if (http_user_agent.indexOf("mac") != -1)
{
	bMac = true;
}

if (http_user_agent.indexOf("opera") != -1) 
{
	sBrowser = "OPERA";
	if (http_user_agent.indexOf("opera 7") != -1)		sVersion = "7";
	else if (http_user_agent.indexOf("opera 6") != -1)	sVersion = "6";
	else if (http_user_agent.indexOf("opera 5") != -1)	sVersion = "5";
	else if (http_user_agent.indexOf("opera 4") != -1)	sVersion = "4";
	else if (http_user_agent.indexOf("opera 3") != -1)	sVersion = "3";
	else sVersion = "2";	
		
}	
else if (http_user_agent.indexOf("msie") != -1 && http_user_agent.indexOf("compatible") != -1)
{
	sBrowser = "IE";
	if (http_user_agent.indexOf("msie 5.5") != -1)			sVersion = "5.5";
	else if (http_user_agent.indexOf("msie 5.2") != -1)		sVersion = "5.2";
	else if (http_user_agent.indexOf("msie 5") != -1)		sVersion = "5";
	else if (http_user_agent.indexOf("msie 6") != -1)		sVersion = "6";
	else sVersion = "4";
}
else if (http_user_agent.indexOf("applewebkit") != -1 && http_user_agent.indexOf("safari") != -1)
{
	sBrowser = "SAFARI";
	sVersion = "1";
}	
else if (http_user_agent.indexOf("mozilla") != -1)
{
	sBrowser = "NS";
	if (http_user_agent.indexOf("mozilla/5") != -1)			sVersion = "5";
	else if (http_user_agent.indexOf("mozilla/4") != -1)	sVersion = "4";
	else if (http_user_agent.indexOf("mozilla/3") != -1)	sVersion = "3";
}	

if ((sBrowser == "IE" && sVersion >= 5 && !bMac) ||
	(sBrowser == "IE" && sVersion >= 5.2 && bMac) ||
	(sBrowser == "NS" && sVersion >= 5) || 
	(sBrowser == "OPERA" && sVersion >= 7) || 
	(sBrowser == "SAFARI" && sVersion >= 1))
{
	sType = "DOM";
}
else if (sBrowser == "NS" && sVersion == 4)
{
	sType = "NSLAYER";
}
else if ((sBrowser == "IE" && sVersion == 4) || (bMac && sBrowser == "IE" && sVersion <= 5))
{
	sType = "IELAYER";
}
else
{
	sType = "OLD";
}	

stBrowser = new oBrowser(bMac,sVersion,sBrowser,sType);

//--------------------------------------------------

function imageZoom(file,x,y)
{
	var address = rootWWW + "_global/imagezoom.cfm?img=";
	var sizeX = 850;
	var sizeY = 600;

	if(typeof x != "undefined")
		sizeX = x;
	if(typeof y != "undefined")
		sizeY = y;

	if(typeof file != "undefined" && file.length)
	{
		ImageZoomPopup = window.open(address + file, "ImageZoomWindow", "width=" + sizeX + ",height=" + sizeY + ",left=20,top=20,scrollbars=yes,resizable=yes");
		ImageZoomPopup.focus();
	}
}
//--------------------------------------------------
function getObject(f_sObject)
{
	if (stBrowser.sType == "DOM")
	{
		return document.getElementById(f_sObject);
	}
	else
	{
		return eval("document.all." + f_sObject);
	}
}

function noCache()
{
	return "uNC=" + parseInt(Math.random()*10000000);

}

/* win_open(where,x,y)*/
function winOpen(f_sWhere)
{
	if (arguments.length > 1)
	{
		sWin = arguments[1];
	}
	else
	{
		sWin = 1;
	}
	
	if (arguments.length <= 2)
	{
		iX = 700;
		iY = 550;
	}
	else
	{
		iX = arguments[2];
		iY = arguments[3];
	}
	
	win = window.open(f_sWhere,"Object"+sWin,"resizable=yes,status=0,scrollbars=1,width="+iX+",height="+iY);
	win.focus();
}

function getCheckedValue(f_objRadio)
{

	for (i = 0; i < f_objRadio.length; i++) 
	{
		if (f_objRadio[i].checked == true) 
		{
			return f_objRadio[i].value
		}
	}	

	return -1;
}


function showLayer(f_sObject)
{

	obj = getObject(f_sObject);
	if (obj.style.visibility == "hidden")
	{
		obj.style.visibility = "visible";
	}
	else
	{
		obj.style.visibility = "hidden";
	}
}

function minusSize()
{
	for(i=0; i < 2; i++)
	{
		if(stBrowser.sBrowser == "IE")
		{
			oCSS = document.styleSheets[i].rules;
		}
		else
		{
			oCSS = document.styleSheets[i].cssRules;
		}
		
		for(j=0; j < oCSS.length; j++)
		{
			if (oCSS[j].style.fontSize != "")
			{
				oCSS[j].style.fontSize = parseInt(oCSS[j].style.fontSize) - 2;		
			}
		}
	}	
}

function plusSize()
{
	for(i=0; i < 2; i++)
	{
		if(stBrowser.sBrowser == "IE")
		{
			oCSS = document.styleSheets[i].rules;
		}
		else
		{
			oCSS = document.styleSheets[i].cssRules;
		}
		
		for(j=0; j < oCSS.length; j++)
		{
			if (oCSS[j].style.fontSize != "")
			{
				oCSS[j].style.fontSize = parseInt(oCSS[j].style.fontSize) + 2;		
			}
		}
	}
}
/*
function sendlink(iNewsID,iLangID)
{
	winOpen(rootWWW + "_global/sendlink.cfm?uNewsID="+ iNewsID + "&uLangID=" + iLangID,"sendlink",560,550);
}
*/
function sendLink(f_sTitle,f_sUrl,f_iLangID)
{
	winOpen(rootWWW + "_global/sendlink.cfm?uTitle="+f_sTitle+"&uUrl="+escape(f_sUrl) + "&uLangID=" + f_iLangID,"sendlink",360,500);
}

iTimer = null;
function setLangMenu()
{
	var iWidth = 0;
	var iOffset = 0;
	
	if (arguments.length > 1)
	{
		iOffset = arguments[1];
	}
	
	obj = getObject("lang-menu");
	
	if (stBrowser.sType == "DOM")
	{
		if (stBrowser.sBrowser == "IE" && sVersion >= 5)
		{
			iWidth = document.body.clientWidth;
		}
		else
		{
			iWidth = window.innerWidth;
		}
		
		if (iWidth < 680)
		{
			obj.style.left = 0;
		}
		else
		{
			if (stBrowser.sBrowser == "NS" && stBrowser.sVersion == "5")
			{
				obj.style.left = Math.round((iWidth - 670)/2)+170-10;
			}
			else
			{
				obj.style.left = Math.round((iWidth - 670)/2)+170;
				//alert(getObject("lang-menu2").style.top);
				//getObject("lang-menu2").style.top = 14;
				getObject("lang-menu2").style.top = iOffset + 14;
			}
				
		}
		
		
	}
	iTimer = setTimeout("setLangMenu("+iOffset+")",100);
}


//--------------------------------------------------
function arrayToList(aArrayList)
{
	return aArrayList.join(",");
}

function listToArray(lListArray)
{
	return lListArray.split(",");
}

function listGetAt(lList,iPos)
{
	var sDelimiter = ",";
	if (arguments.length > 2)
	{
		sDelimiter = arguments[2];
	}
	var aList = lList.split(sDelimiter);

	if (iPos > 0 && iPos < aList.length+1)
	{
		return aList[iPos - 1];
	}
	else
	{
		return 0;
	}
}

function listSetAt(lList,iPos,sValue)
{
	var aList = lList.split(",");

	if (iPos > 0 && iPos < aList.length+1)
	{
		aList[iPos - 1] = sValue;
		return aList.join(",");
	}
	else
	{
		return lList;
	}	
}

function listDeleteAt(lList,iPos)
{
	var aList = lList.split(",");

	if(aList.length > 1)
	{ 
		if (iPos > 0 && iPos < aList.length+1)
		{
	
			if (sBrowser == "IE" && sVersion < "5.5")
			{
				if (aList.length > iPos)
				{
					for (i = iPos-1; i < aList.length-1; i++)
					{
						aList[i] = aList[i + 1];
					}
					
					aList.length --;
				}
				else
				{
					aList.length --;
				}	
			}
			else
			{
				aList.splice(iPos-1, 1);
			}	
			
			return aList.join(",");
		
		}
		else
		{
			return lList;
		}
	}
	else
	{
		return "";
	}		
}

function listFind(lList,sValue)
{
	var aList = lList.split(",");
	//alert(sValue.toLowerCase());
	
	for (i = 0; i < aList.length; i++)
	{
		if(sValue.toString().toLowerCase() == aList[i].toString().toLowerCase())
		{
			return i+1;
		}
	}
	return 0;
}

function listAppend(lList,sValue)
{

	if(lList.length > 0)
	{
		var aList = lList.split(",");
	
		/* keine doppelten hinzufügen
		for (i = 0; i < aList.length; i++)
		{
			if(sValue.toString().toLowerCase() == aList[i].toString().toLowerCase())
			{
				return i;
			}
		}
		*/
		
		if (sBrowser == "IE" && sVersion < "5.5")
		{
			aList.length ++;
			aList[aList.length-1] = sValue;
		}
		else
		{
			aList.push(sValue);
		}	
		
		
		return aList.join(",");
	}
	else
	{
		return sValue;
	}
}
//--------------------------------------------------
sOver = "a";
sNormal = "n";

function setClass(f_obj)
{
	if (stBrowser.sType == "IELAYER" || stBrowser.sType == "DOM")
	{
		
		sClassName = f_obj.className;
		sMainClassName = sClassName.substr(0,sClassName.length-1);
		sEndClassName = sClassName.substr(sMainClassName.length,sClassName.length);
	
		if (sEndClassName == sNormal)
		{
			f_obj.className = sMainClassName + sOver;
			setCursor(f_obj);
		}
		else
		{
			f_obj.className = sMainClassName + sNormal;
		}
	
	}
	
}

function setClassName(f_sObj)
{
	if (stBrowser.sType == "IELAYER" || stBrowser.sType == "DOM")
	{
		obj = getObject(f_sObj);
		sClassName = obj.className;
		sMainClassName = sClassName.substr(0,sClassName.length-1);
		sEndClassName = sClassName.substr(sMainClassName.length,sClassName.length);
		
		if (sEndClassName == sNormal)
		{
			obj.className = sMainClassName + sOver;
			setCursor(obj);
		}
		else
		{
			obj.className = sMainClassName + sNormal;
		}
	
	}
	
}

function setCursor(f_obj)
{

	if (stBrowser.sBrowser == "NS")
	{
		f_obj.style.cursor  = "pointer";
	}
	else
	{
		f_obj.style.cursor  = "hand";
	}
}

function setCursorNormal(f_obj)
{
	if (stBrowser.sBrowser == "NS")
	{
		f_obj.style.cursor  = "";
	}
	else
	{
		f_obj.style.cursor  = "";
	}
}

function setLoc(f_sLoc)
{
	document.location.href=f_sLoc;
}

function setExpColor(f_sObj,f_iSwitch)
{
	if (stBrowser.sType == "IELAYER" || stBrowser.sType == "DOM")
	{
		
		if (f_iSwitch == 0)
		{
			f_sObj.style.backgroundColor = "";
		}
		else
		{
			f_sObj.style.backgroundColor = "FDB15D";
		}
	
	}

}


//--------------------------------------------------

function protectMail(){
	$('a[domain]').each(function(){
		var elem = $(this);
		elem.text(elem.text() + '@' + elem.attr('domain'));
		elem.attr('href','mailto:' + elem.text());
	});
}

$().ready(function(){protectMail()});

//<a domain="mydomain.com">firstname.lastname</a>

//--------------------------------------------------
//---------------------------------+
//  CARPE  S l i d e r        1.3  |
//  2005 - 12 - 10                 |
//  By Tom Hermansson Snickars     |
//  Copyright CARPE Design         |
//  http://carpe.ambiprospect.com/ |
//---------------------------------+

// carpeGetElementByID: Cross-browser version of "document.getElementById()"
function carpeGetElementById(element)
{
	if (document.getElementById) element = document.getElementById(element);
	else if (document.all) element = document.all[element];
	else element = null;
	return element;
}
// carpeLeft: Cross-browser version of "element.style.left"
function carpeLeft(elmnt, pos)
{
	if (!(elmnt = carpeGetElementById(elmnt))) return 0;
	if (elmnt.style && (typeof(elmnt.style.left) == 'string')) {
		if (typeof(pos) == 'number') elmnt.style.left = pos + 'px';
		else {
			pos = parseInt(elmnt.style.left);
			if (isNaN(pos)) pos = 0;
		}
	}
	else if (elmnt.style && elmnt.style.pixelLeft) {
		if (typeof(pos) == 'number') elmnt.style.pixelLeft = pos;
		else pos = elmnt.style.pixelLeft;
	}
	return pos;
}
// carpeTop: Cross-browser version of "element.style.top"
function carpeTop(elmnt, pos)
{
	if (!(elmnt = carpeGetElementById(elmnt))) return 0;
	if (elmnt.style && (typeof(elmnt.style.top) == 'string')) {
		if (typeof(pos) == 'number') elmnt.style.top = pos + 'px';
		else {
			pos = parseInt(elmnt.style.top);
			if (isNaN(pos)) pos = 0;
		}
	}
	else if (elmnt.style && elmnt.style.pixelTop) {
		if (typeof(pos) == 'number') elmnt.style.pixelTop = pos;
		else pos = elmnt.style.pixelTop;
	}
	return pos;
}
// moveSlider: Handles slider and display while dragging
function moveSlider(evnt)
{
	var evnt = (!evnt) ? window.event : evnt; // The mousemove event
	if (mouseover) { // Only if slider is dragged
		x = pxLeft + evnt.screenX - xCoord // Horizontal mouse position relative to allowed slider positions
		y = pxTop + evnt.screenY - yCoord // Horizontal mouse position relative to allowed slider positions
		if (x > xMax) x = xMax // Limit horizontal movement
		if (x < 0) x = 0 // Limit horizontal movement
		if (y > yMax) y = yMax // Limit vertical movement
		if (y < 0) y = 0 // Limit vertical movement
		carpeLeft(sliderObj.id, x)  // move slider to new horizontal position
		carpeTop(sliderObj.id, y) // move slider to new vertical position
		sliderVal = x + y // pixel value of slider regardless of orientation
		sliderPos = (sliderObj.pxLen / sliderObj.valCount) * Math.round(sliderObj.valCount * sliderVal / sliderObj.pxLen)
		v = Math.round((sliderPos * sliderObj.scale + sliderObj.fromVal) * // calculate display value
			Math.pow(10, displayObj.dec)) / Math.pow(10, displayObj.dec)
		displayObj.value = v // put the new value in the slider display element
		return false
	}
	return
}
// moveSlider: Handles the start of a slider move.
function slide(evnt, orientation, length, from, to, count, decimals, display)
{
	if (!evnt) evnt = window.event;
	sliderObj = (evnt.target) ? evnt.target : evnt.srcElement; // Get the activated slider element.
	sliderObj.pxLen = length // The allowed slider movement in pixels.
	sliderObj.valCount = count ? count - 1 : length // Allowed number of values in the interval.
	displayObj = carpeGetElementById(display) // Get the associated display element.
	displayObj.dec = decimals // Number of decimals to be displayed.
	sliderObj.scale = (to - from) / length // Slider-display scale [value-change per pixel of movement].
	if (orientation == 'horizontal') { // Set limits for horizontal sliders.
		sliderObj.fromVal = from
		xMax = length
		yMax = 0
	}
	if (orientation == 'vertical') { // Set limits and scale for vertical sliders.
		sliderObj.fromVal = to
		xMax = 0
		yMax = length
		sliderObj.scale = -sliderObj.scale // Invert scale for vertical sliders. "Higher is more."
	}
	pxLeft = carpeLeft(sliderObj.id) // Sliders horizontal position at start of slide.
	pxTop  = carpeTop(sliderObj.id) // Sliders vertical position at start of slide.
	xCoord = evnt.screenX // Horizontal mouse position at start of slide.
	yCoord = evnt.screenY // Vertical mouse position at start of slide.
	mouseover = true
	document.onmousemove = moveSlider // Start the action if the mouse is dragged.
	document.onmouseup = sliderMouseUp // Stop sliding.
}
// sliderMouseup: Handles the mouseup event after moving a slider.
// Snaps the slider position to allowed/displayed value. 
function sliderMouseUp()
{
	mouseover = false // Stop the sliding.
	v = (displayObj.value) ? displayObj.value : 0 // Find last display value.
	pos = (v - sliderObj.fromVal)/(sliderObj.scale) // Calculate slider position (regardless of orientation).
	if (yMax == 0) carpeLeft(sliderObj.id, pos) // Snap horizontal slider to corresponding display position.
	if (xMax == 0) carpeTop(sliderObj.id, pos) // Snap vertical slider to corresponding display position.
}
//--------------------------------------------------
/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();
//--------------------------------------------------
function testString(f_sString)
{
	if (f_sString.length > 0)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testStringEq(f_sString, f_iLen)
{
	if (f_sString.length == f_iLen)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testStringGt(f_sString, f_iLen)
{
	if (f_sString.length > f_iLen)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testStringLt(f_sString, f_iLen)
{
	if (f_sString.length < f_iLen)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testInt(f_iInteger)
{
	var regInt = /^[0-9]+$/;
	
	if (regInt.test(f_iInteger) == true)
	{
		return true;
	}	
	else
	{
		return false;
	}
}

function testFloat(f_flFloat)
{
	var regFloat = /^[0-9]+(\.[0-9]+)*$/;
	
	if (regFloat.test(f_flFloat) == true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testIntGtZero(f_iInteger)
{
	var regInt = /^[0-9]+$/;
	
	if (regInt.test(f_iInteger) == true && f_iInteger > 0)
	{
		return true;
	}	
	else
	{
		return false;
	}
}

function testMinusOne(f_iInteger)
{
	if (f_iInteger != -1)
	{
		return true;
	}	
	else
	{
		return false;
	}
}

function testTime(f_sTime)
{
	var regTime = /^([0-2]?[0-9]):[0-5][0-9](:[0-5][0-9])?$/;
	var iIndex;
	var iValue;
	var sValue = f_sTime;
	
	if (regTime.test(sValue) == true)
	{
		iIndex = sValue.indexOf(":");
		iValue = sValue.substr(0,iIndex);
		
		if (iValue <= 23 && iValue >=0)
		{
			return true;
		}
		else
		{
			return false;
		}	
	}
	else
	{
		return false;
	}
}

function testDate(f_sDate)
{
	var regDate = /^([0-3]?[0-9])\.([0-1]?[0-9])\.[1-9][0-9]{3}$/;
	var iIndex, iIndex2;
	var iMonth,iDay,iYear;
	var arrMonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	var sValue = f_sDate;
	
	if (regDate.test(sValue) == true)
	{
		iIndex = sValue.indexOf(".");
		iIndex2 = sValue.indexOf(".",iIndex+1);
		
		iDay = sValue.substr(0,iIndex);
		iMonth = sValue.substring(iIndex+1,iIndex2);
		iYear = sValue.substr(iIndex2+1,sValue.length);		

		if (iMonth < 1 || iMonth > 12)
		{
			return false;		
		}
		
		if (iMonth == 2 && ( ( (iYear % 4) == 0 && (iYear % 100) != 0 ) || (iYear % 400) == 0 ) ) 
		{
			if (iDay < 1 || iDay > 29)
			{
				return false;
			}
		}
		else
		{
			if (iDay < 1 || iDay > arrMonth[iMonth-1])
			{
				return false;
			}
		}		

		return true;

	}
	else
	{
		return false;
	}
}

function testEmail(f_sEmail)
{
	var regEmail = /^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*\.([a-zA-Z]{2,4})$/;
	
	if (regEmail.test(f_sEmail) == true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testChPlz(f_iPLZ)
{
	var regPLZ = /^[1-9][0-9]{3}$/;
	
	if (regPLZ.test(f_iPLZ) == true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testCHMoney(f_flMoney)
{
	var regMoney = /(^[1-9][0-9]*|^0)(\.[0-9](0|5))?$/;
	
	if (regMoney.test(f_flMoney) == true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function testEmpty(f_sString)
{
	var regWhiteSpace = /[^ \f\n\r\t]/;
	
	if (regWhiteSpace.test(f_sString))
	{
		return false;
	}
	else
	{
		return true;
	}
}

function testReg(f_sString,f_regString)
{

	regString = new RegExp(f_regString,"gi");
	if (regString.test(f_sString) == true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

//--------------------------------------------------
/**
 * jQuery lightBox plugin
 * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
 * and adapted to me for use like a plugin from jQuery.
 * @name jquery-lightbox-0.5.js
 * @author Leandro Vieira Pinho - http://leandrovieira.com
 * @version 0.5
 * @date April 11, 2008
 * @category jQuery plugin
 * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
 * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
 * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
 */

// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias
(function($) {
	/**
	 * $ is an alias to jQuery object
	 *
	 */
	$.fn.lightBox = function(settings) {
		// Settings to configure the jQuery lightBox plugin how you like
		settings = jQuery.extend({
			// Configuration related to overlay
			overlayBgColor: 		'#000',		// (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
			overlayOpacity:			0.8,		// (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
			// Configuration related to navigation
			fixedNavigation:		false,		// (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
			// Configuration related to images
			imageLoading:			'http://assets.krebsliga.ch/custom/lightbox/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
			imageBtnPrev:			'http://assets.krebsliga.ch/custom/lightbox/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image
			imageBtnNext:			'http://assets.krebsliga.ch/custom/lightbox/lightbox-btn-next.gif',			// (string) Path and the name of the next button image
			imageBtnClose:			'http://assets.krebsliga.ch/custom/lightbox/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
			imageBlank:				'http://assets.krebsliga.ch/custom/lightbox/lightbox-blank.gif',			// (string) Path and the name of a blank image (one pixel)
			// Configuration related to container image box
			containerBorderSize:	10,			// (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
			containerResizeSpeed:	400,		// (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
			// Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.
			txtImage:				'Image',	// (string) Specify text "Image"
			txtOf:					'of',		// (string) Specify text "of"
			// Configuration related to keyboard navigation
			keyToClose:				'c',		// (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
			keyToPrev:				'p',		// (string) (p = previous) Letter to show the previous image
			keyToNext:				'n',		// (string) (n = next) Letter to show the next image.
			// Don´t alter these variables in any way
			imageArray:				[],
			activeImage:			0
		},settings);
		// Caching the jQuery object with all elements matched
		var jQueryMatchedObj = this; // This, in this context, refer to jQuery object
		/**
		 * Initializing the plugin calling the start function
		 *
		 * @return boolean false
		 */
		function _initialize() {
			_start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked
			return false; // Avoid the browser following the link
		}
		/**
		 * Start the jQuery lightBox plugin
		 *
		 * @param object objClicked The object (link) whick the user have clicked
		 * @param object jQueryMatchedObj The jQuery object with all elements matched
		 */
		function _start(objClicked,jQueryMatchedObj) {
			// Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
			$('embed, object, select').css({ 'visibility' : 'hidden' });
			// Call the function to create the markup structure; style some elements; assign events in some elements.
			_set_interface();
			// Unset total images in imageArray
			settings.imageArray.length = 0;
			// Unset image active information
			settings.activeImage = 0;
			// We have an image set? Or just an image? Let´s see it.
			if ( jQueryMatchedObj.length == 1 ) {
				settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));
			} else {
				// Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references		
				for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
					settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));
				}
			}
			while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) {
				settings.activeImage++;
			}
			// Call the function that prepares image exibition
			_set_image_to_view();
		}
		/**
		 * Create the jQuery lightBox plugin interface
		 *
		 * The HTML markup will be like that:
			<div id="jquery-overlay"></div>
			<div id="jquery-lightbox">
				<div id="lightbox-container-image-box">
					<div id="lightbox-container-image">
						<img src="../fotos/XX.jpg" id="lightbox-image">
						<div id="lightbox-nav">
							<a href="#" id="lightbox-nav-btnPrev"></a>
							<a href="#" id="lightbox-nav-btnNext"></a>
						</div>
						<div id="lightbox-loading">
							<a href="#" id="lightbox-loading-link">
								<img src="../images/lightbox-ico-loading.gif">
							</a>
						</div>
					</div>
				</div>
				<div id="lightbox-container-image-data-box">
					<div id="lightbox-container-image-data">
						<div id="lightbox-image-details">
							<span id="lightbox-image-details-caption"></span><br/>
							<span id="lightbox-image-details-currentNumber"></span>
						</div>
						<div id="lightbox-secNav">
							<a href="#" id="lightbox-secNav-btnClose">
								<img src="../images/lightbox-btn-close.gif">
							</a>
						</div>
					</div>
				</div>
			</div>
		 *
		 */
		function _set_interface() {
			// Apply the HTML markup into body tag
			$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><br /><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>');	
			// Get page sizes
			var arrPageSizes = ___getPageSize();
			// Style overlay and show it
			$('#jquery-overlay').css({
				backgroundColor:	settings.overlayBgColor,
				opacity:			settings.overlayOpacity,
				width:				arrPageSizes[0],
				height:				arrPageSizes[1]
			}).fadeIn();
			// Get page scroll
			var arrPageScroll = ___getPageScroll();
			// Calculate top and left offset for the jquery-lightbox div object and show it
			$('#jquery-lightbox').css({
				top:	arrPageScroll[1] + (arrPageSizes[3] / 10),
				left:	arrPageScroll[0]
			}).show();
			// Assigning click events in elements to close overlay
			$('#jquery-overlay,#jquery-lightbox').click(function() {
				_finish();									
			});
			// Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects
			$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {
				_finish();
				return false;
			});
			// If window was resized, calculate the new overlay dimensions
			$(window).resize(function() {
				// Get page sizes
				var arrPageSizes = ___getPageSize();
				// Style overlay and show it
				$('#jquery-overlay').css({
					width:		arrPageSizes[0],
					height:		arrPageSizes[1]
				});
				// Get page scroll
				var arrPageScroll = ___getPageScroll();
				// Calculate top and left offset for the jquery-lightbox div object and show it
				$('#jquery-lightbox').css({
					top:	arrPageScroll[1] + (arrPageSizes[3] / 10),
					left:	arrPageScroll[0]
				});
			});
		}
		/**
		 * Prepares image exibition; doing a image´s preloader to calculate it´s size
		 *
		 */
		function _set_image_to_view() { // show the loading
			// Show the loading
			$('#lightbox-loading').show();
			//if ( settings.fixedNavigation ) {
			if ( 1 == 2 ) {
				$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
			} else {
				// Hide some elements
				$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
			}
			// Image preload process
			var objImagePreloader = new Image();
			objImagePreloader.onload = function() {
				$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);
				// Perfomance an effect in the image container resizing it
				_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);
				//	clear onLoad, IE behaves irratically with animated gifs otherwise
				objImagePreloader.onload=function(){};
			};
			objImagePreloader.src = settings.imageArray[settings.activeImage][0];
		};
		/**
		 * Perfomance an effect in the image container resizing it
		 *
		 * @param integer intImageWidth The image´s width that will be showed
		 * @param integer intImageHeight The image´s height that will be showed
		 */
		function _resize_container_image_box(intImageWidth,intImageHeight) {
			// Get current width and height
			var intCurrentWidth = $('#lightbox-container-image-box').width();
			var intCurrentHeight = $('#lightbox-container-image-box').height();
			// Get the width and height of the selected image plus the padding
			var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image´s width and the left and right padding value
			var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image´s height and the left and right padding value
			// Diferences
			var intDiffW = intCurrentWidth - intWidth;
			var intDiffH = intCurrentHeight - intHeight;
			// Perfomance the effect
			$('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); });
			if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {
				if ( $.browser.msie ) {
					___pause(250);
				} else {
					___pause(100);	
				}
			} 
			$('#lightbox-container-image-data-box').css({ width: intImageWidth });
			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });
		};
		/**
		 * Show the prepared image
		 *
		 */
		function _show_image() {
			$('#lightbox-loading').hide();
			$('#lightbox-image').fadeIn(function() {
				_show_image_data();
				_set_navigation();
			});
			_preload_neighbor_images();
		};
		/**
		 * Show the image information
		 *
		 */
		function _show_image_data() {
			$('#lightbox-container-image-data-box').slideDown('fast');
			$('#lightbox-image-details-caption').hide();
			if ( settings.imageArray[settings.activeImage][1] ) {
				$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();
			}
			// If we have a image set, display 'Image X of X'
			if ($('.gallery').length > 0){
				if ( settings.imageArray.length > 1 ) {
					$('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();
				}		
			}
		}
		/**
		 * Display the button navigations
		 *
		 */
		function _set_navigation() {
			$('#lightbox-nav').show();
			
			if ($('.gallery').length > 0){			
				// Instead to define this configuration in CSS file, we define here. And it´s need to IE. Just.
				$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
				
				// Show the prev button, if not the first image in set
				if ( settings.activeImage != 0 ) {
					if ( settings.fixedNavigation ) {
						$('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })
							.unbind()
							.bind('click',function() {
								settings.activeImage = settings.activeImage - 1;
								_set_image_to_view();
								return false;
							});
					} else {
						// Show the images button for Next buttons
						$('#lightbox-nav-btnPrev').unbind().hover(function() {
							$(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });
						},function() {
							$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
						}).show().bind('click',function() {
							settings.activeImage = settings.activeImage - 1;
							_set_image_to_view();
							return false;
						});
					}
				}
				
				// Show the next button, if not the last image in set
				if ( settings.activeImage != ( settings.imageArray.length -1 ) ) {
					if ( settings.fixedNavigation ) {
						$('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })
							.unbind()
							.bind('click',function() {
								settings.activeImage = settings.activeImage + 1;
								_set_image_to_view();
								return false;
							});
					} else {
						// Show the images button for Next buttons
						$('#lightbox-nav-btnNext').unbind().hover(function() {
							$(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });
						},function() {
							$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
						}).show().bind('click',function() {
							settings.activeImage = settings.activeImage + 1;
							_set_image_to_view();
							return false;
						});
					}
				}
				// Enable keyboard navigation
				_enable_keyboard_navigation();
			}
		}
		/**
		 * Enable a support to keyboard navigation
		 *
		 */
		function _enable_keyboard_navigation() {
			$(document).keydown(function(objEvent) {
				_keyboard_action(objEvent);
			});
		}
		/**
		 * Disable the support to keyboard navigation
		 *
		 */
		function _disable_keyboard_navigation() {
			$(document).unbind();
		}
		/**
		 * Perform the keyboard actions
		 *
		 */
		function _keyboard_action(objEvent) {
			// To ie
			if ( objEvent == null ) {
				keycode = event.keyCode;
				escapeKey = 27;
			// To Mozilla
			} else {
				keycode = objEvent.keyCode;
				escapeKey = objEvent.DOM_VK_ESCAPE;
			}
			// Get the key in lower case form
			key = String.fromCharCode(keycode).toLowerCase();
			// Verify the keys to close the ligthBox
			if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {
				_finish();
			}
			// Verify the key to show the previous image
			if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {
				// If we´re not showing the first image, call the previous
				if ( settings.activeImage != 0 ) {
					settings.activeImage = settings.activeImage - 1;
					_set_image_to_view();
					_disable_keyboard_navigation();
				}
			}
			// Verify the key to show the next image
			if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {
				// If we´re not showing the last image, call the next
				if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {
					settings.activeImage = settings.activeImage + 1;
					_set_image_to_view();
					_disable_keyboard_navigation();
				}
			}
		}
		/**
		 * Preload prev and next images being showed
		 *
		 */
		function _preload_neighbor_images() {
			if ( (settings.imageArray.length -1) > settings.activeImage ) {
				objNext = new Image();
				objNext.src = settings.imageArray[settings.activeImage + 1][0];
			}
			if ( settings.activeImage > 0 ) {
				objPrev = new Image();
				objPrev.src = settings.imageArray[settings.activeImage -1][0];
			}
		}
		/**
		 * Remove jQuery lightBox plugin HTML markup
		 *
		 */
		function _finish() {
			$('#jquery-lightbox').remove();
			$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });
			// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
			$('embed, object, select').css({ 'visibility' : 'visible' });
		}
		/**
		 / THIRD FUNCTION
		 * getPageSize() by quirksmode.com
		 *
		 * @return Array Return an array with page width, height and window width, height
		 */
		function ___getPageSize() {
			var xScroll, yScroll;
			if (window.innerHeight && window.scrollMaxY) {	
				xScroll = window.innerWidth + window.scrollMaxX;
				yScroll = window.innerHeight + window.scrollMaxY;
			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
				xScroll = document.body.scrollWidth;
				yScroll = document.body.scrollHeight;
			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
				xScroll = document.body.offsetWidth;
				yScroll = document.body.offsetHeight;
			}
			var windowWidth, windowHeight;
			if (self.innerHeight) {	// all except Explorer
				if(document.documentElement.clientWidth){
					windowWidth = document.documentElement.clientWidth; 
				} else {
					windowWidth = self.innerWidth;
				}
				windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}	
			// for small pages with total height less then height of the viewport
			if(yScroll < windowHeight){
				pageHeight = windowHeight;
			} else { 
				pageHeight = yScroll;
			}
			// for small pages with total width less then width of the viewport
			if(xScroll < windowWidth){	
				pageWidth = xScroll;		
			} else {
				pageWidth = windowWidth;
			}
			arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
			return arrayPageSize;
		};
		/**
		 / THIRD FUNCTION
		 * getPageScroll() by quirksmode.com
		 *
		 * @return Array Return an array with x,y page scroll values.
		 */
		function ___getPageScroll() {
			var xScroll, yScroll;
			if (self.pageYOffset) {
				yScroll = self.pageYOffset;
				xScroll = self.pageXOffset;
			} else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
				yScroll = document.documentElement.scrollTop;
				xScroll = document.documentElement.scrollLeft;
			} else if (document.body) {// all other Explorers
				yScroll = document.body.scrollTop;
				xScroll = document.body.scrollLeft;	
			}
			arrayPageScroll = new Array(xScroll,yScroll);
			return arrayPageScroll;
		};
		 /**
		  * Stop the code execution from a escified time in milisecond
		  *
		  */
		 function ___pause(ms) {
			var date = new Date(); 
			curDate = null;
			do { var curDate = new Date(); }
			while ( curDate - date < ms);
		 };
		// Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
		return this.unbind('click').click(_initialize);
	};
})(jQuery); // Call and execute the function immediately passing the jQuery object


jQuery(function() {
    jQuery('a.lightbox').lightBox();
});
//--------------------------------------------------

