/****************************************************************************************
 * Toggle Box
 *
 * @version 14.09.2009 
 ****************************************************************************************/
 var FroschMenue = { start:function () {
		// Initializes navigation show/hide boxes
		FroschMenue.toggleSlideBox();
	},
// Navigation show/hide boxes
	toggleSlideBox:function () {
		
		// Show/hide menu box in mainnavigation on click
		$("#nav_service .TgBoxHeadline").bind("click", function(){

			// Toggles slider
			$(this).next(".tgBoxDiv").slideToggle("normal");

			return false;
		});

		// Show/hide menu box in service/kontakt navigation on mouseover/out
		var toSv1, toSv2;
		$("#nav_service").bind("mouseenter focus", function(){
			var svId = $(this);
			clearTimeout(toSv2);
			toSv1 = setTimeout(function(){

				// Slide down kontakt box
				svId.find(".tgBoxDiv").slideDown("normal");
			}, 250);

		}).bind("mouseleave", function(){
			var svId = $(this);
			clearTimeout(toSv1);
			toSv2 = setTimeout(function(){

				// Slide up kontakt box
				svId.find(".TgBoxHeadline").next(".tgBoxDiv").slideUp("normal");
			}, 250);

		});

		// Disables click functionality in service/kontakt headline
		$("#nav_service .TgBoxHeadline").bind("click", function(){

			return false;
		});
	}
}
/****************************************************************************************
 * class flyoutNavigation
 *
 * @version 18.05.2009 17:13 
 ****************************************************************************************/
if($.browser.msie && $.browser.version<7) $.browser.msie6 = true;
var flyoutNavigation = { start:function () {

	var a, b, c, d, e;
	var f = false;
	var g = false;
	var fallBack = $("#ifJsDisabled");

	if (fallBack) { fallBack.attr("rel", "alternate stylesheet"); fallBack.attr("disabled", "disabled"); }
	if ($.browser.msie6) { $(".navLevel2").append("<!--[if lte IE 6.5]><iframe src='/_relaunch/Adesign/trans.gif'></iframe><![endif]-->"); }

	$(".navLevel1 > li").siblings().find("a:first:not(.lnDirect)").bind("mouseenter focus", function()
	{
		g = true; a = $(this); b = a.next();
		var h = $(this).offset();
		var k = $(this).position();
		var m = $(window).scrollTop();
		var n = $("#pageMargins").outerHeight();
		var o = $(window).height();
		var p = b.height();
		var q = $("#footer").height();
		var r = n - q;
		if(r < o && n <= o) { var s = h.top + p + q; }
		else if(r < o && n > o) { var s = h.top + p + (q-(n-o)); }
		else if (r > o && m < (r-o)) { var s = h.top + p - m; }
		else if (r > o && m >= (r-o)) { var s = h.top + p + (q-(n-o)); }
			
		if(o > s) {
			b.css({top:k.top-3});
			if ($.browser.msie6) { b.css({top:k.top-2}); }
		}
		else {
			snk = s - o;
			
			b.css({top:(k.top-snk)});
		}
		c = setTimeout(function() {
			$(".navLevel2").hide();
			$(".navLevel1 a:not(.lnDirect)").removeClass("IPNavPath");

			a.addClass("IPNavPath");

			b.show();
			f = false;
		}, 250);
		})
		.bind("mouseleave", function(){
			g = false;
			var a = $(this);
			var b = a.next();
			clearTimeout(c);
			d = setTimeout(function(){
				if(f == false){
					a.removeClass("IPNavPath");
					b.hide();
				}
			}, 300);
		});
		$(".navLevel1 > li").siblings().find("a:first:not(.lnDirect)").next().bind("mouseenter focus", function(){
			f = true;
			clearTimeout(c);
			clearTimeout(d);
			clearTimeout(e);
			$(this).show();
		})
		.bind("mouseleave", function(){
			f = false;
			b = $(this);
			e = setTimeout(function(){
				if(g == false){	
				
					b.hide();
					$(".navLevel1 a:not(.lnDirect)").removeClass("IPNavPath");
				}
			}, 500);
		});
	}
}
jQuery(	function($) { FroschMenue.start(); } );
jQuery(	function($) { flyoutNavigation.start(); } );
/****************************************************************************************
 * Popup Fenster
 ****************************************************************************************/
function popUp(strURL,strType,strHeight,strWidth) {
			var strOptions="";
				if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
				if (strType=="benutzer") strOptions="resizable,scrollbars,height="+strHeight+",width="+strWidth;
				if (strType=="showall") strOptions="toolbar,menubar,scrollbars,resizable,location,status,height="+strHeight+",width="+strWidth;
				if (strType=="elastic") strOptions="menubar,scrollbars,resizable,height="+strHeight+",width="+strWidth;
				
				if ( window.screen ) {
				    var ah = screen.availHeight - 30;
				    var aw = screen.availWidth - 10;
		
				    var xc = ( aw - strWidth ) / 2;
				    var yc = ( ah - strHeight ) / 2;
				
				strOptions += ",left=" + xc + ",screenX=" + xc;
				strOptions += ",top=" + yc + ",screenY=" + yc;
				}
				// Fenster öffnen	
				fenster = window.open(strURL, 'newWin', strOptions);
				fenster.focus();
				}
				
/****************************************************************************************
 * Table Ruler
 ****************************************************************************************/	
$(document).ready(function(){ 
  $(".ruler tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});
  /*$(".ruler tr:even").addClass("alt"); alternierende Hintergrundfarbe bei Zeilen*/
});
/**************
*
* Ab hier die Vorschlagssuche-Suche mit Ajax
* 
****************/
function sAus()
{
        var obj = document.getElementById('search_suggest');
        if ( obj )
        {
                obj.style.display='none';
        }
}
function addDebugDiv()
{
	var obj = document.getElementById("col1_content");
	if ( obj )
	{
		var newdiv = document.createElement('div');
		newdiv.setAttribute('id', 'debug_div');
		newdiv.style.backgroundColor = "#FFA";
		newdiv.style.position = "absolute";
		newdiv.style.left = "500px";
		newdiv.style.top = "220px";
		newdiv.style.padding = "4px";
		newdiv.style.border = "solid 1px red";
		newdiv.style.fontSize = "10px";
		newdiv.style.display = "block";
		newdiv.innerHTML = "<b>Debug Ausgabe</b> <a href='#' onclick='clearDebug();return false;'>Leeren</a>";
		obj.appendChild(newdiv);

		return document.getElementById('debug_div');
	}

	alert("Warnung:\nDebug function addDebugDiv() kann auf das\nElement ganzeBreite nicht zugreifen.");

	return null;
}
function writeDebug(text)
{
	 return true; //deaktiviert

	var obj = document.getElementById("debug_div");
	if ( !obj )
	{
		obj = addDebugDiv();
	}

	if ( obj )
	{
		obj.innerHTML += "<br>"+text;
	}
}
function clearDebug(text)
{
	 return TRUE; //deaktiviert

	var obj = document.getElementById("debug_div");


	if ( obj )
	{
		obj.innerHTML = "<b>Debug Ausgabe</b> <a href='#' onclick='clearDebug();return false;'>Leeren</a>";
	}
}
var BrowserName = navigator.appName;
if (BrowserName == "Netscape")
{
	document.onkeypress = getkeycode;
}
var ssActivated = true;
function getXmlHttpRequestObject()
{
	var http_request = false;
	
	// Nicht-IE
	if (window.XMLHttpRequest)
	{
		http_request = new XMLHttpRequest();
		return http_request;
	}
	// IE
	if(window.ActiveXObject)
 	{
 		try
		{
                	http_request = new ActiveXObject("Msxml2.XMLHTTP");
					
            	}
		catch (e) 
		{
			try
			{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
				
                	}
			catch (e) {}
            	}
        }
		
  	if (!http_request)
	{
		if(window.ActiveXObject) displayAXHinweis();
		
		alert("Ihr Browser unterstuetzt wichtige Funktionen er Suche nicht!\nBitte nehmen Sie ein Update vor oder aktivieren Sie ActiveXObjects.\nWenn Sie Hilfe benoetigen - fragen Sie uns!");
	}
	
	return http_request;
}

var searchReq = getXmlHttpRequestObject();
var searchTimeout='';

function triggerSearch(){
	writeDebug("function triggerSearch()");
if (searchTimeout!=''){
	clearTimeout(searchTimeout);
	writeDebug("timeout cleared");		
	}
	else{
	writeDebug("timeout started");	
	}	
	searchTimeout=setTimeout('searchSuggest()',200);
}
function searchSuggest()
{
writeDebug("function searchSuggest()");
	if (!ssActivated) return true;
	if (searchReq != null)
	{
		if (searchReq.readyState == 4 || searchReq.readyState == 0)
		{
			if (!document.getElementById('txtSearchID')) return 0;
			var q = document.getElementById('txtSearchID').value;
			var qq = q.replace(/\s/gi, "");
			if (qq.length < 2) return true;
			if (document.location.search) {
						 var sugDatei = '/info/suggest.asp?' + 'q=' + escape(q);
						//var sugDatei = '/info/suggest.asp' + document.location.search + '&q=' + escape(q);
			}
			else { var sugDatei = '/info/suggest.asp?q=' + escape(q); }
			searchReq.open("GET", sugDatei, true);
				searchReq.onreadystatechange = handleSearchSuggest; 
			searchReq.send(null);
		}	
  		return true;
	}
	else return 0;
}
function handleSearchSuggest()
{
	if (searchReq.readyState == 4)
	{
writeDebug("function handleSearchSuggest() readyState=4");
		var ss = document.getElementById('search_suggest');
		document.getElementById('url').value = '';
		ss.innerHTML = '';
		var str = searchReq.responseText.split("\n");
		var letzteselement = str.length-1;
		ss.innerHTML += str[letzteselement];
		var flag = "";
		var type = "";
		if (str[0]!="") document.getElementById('cntsuggests').value=str.length-1;
		if (str.length > 1)
		{
			var searchinput = document.getElementById('txtSearchID').value;
			var matchstring = "";
			var Ergebnis = "";
			var Ergebnis2 = "";
			var display = "";
			var suggest = "";
			var land = "";
			var ort = "";
        		 suggest += '    <div id="suggLayer">';
				 suggest += '     <div class="suggItem">';
				 suggest += '       <div class="suggName help"><strong>Einige Vorschläge zu Ihrem Suchbegriff:</strong></div>';
				 suggest += '       <div class="suggCat help"> </div>';
				 suggest += '     </div>';
			for(i=0; i < str.length-1; i++)
			{
				if (str[i]!='')
				{
					ort = document.getElementById('vorschlagort'+i).value;
					var searcher = htmlentities(searchinput,2);
					matchstring = new RegExp (searcher, "i");
					Ergebnis = str[i].match(matchstring);
					if(Ergebnis)
					{
						display = str[i].replace(new RegExp("("+Ergebnis+")","i"),"<strong>"+Ergebnis+"</strong>");
					}
					else display = str[i];
					Ergebnis2 = ort.match(matchstring);
					if(Ergebnis2)
					{
						displayort = ort.replace(new RegExp("("+Ergebnis2+")","i"),"<strong>"+Ergebnis2+"</strong>");
					}
					else displayort = ort;					

					land = document.getElementById('vorschlagland'+i).value;					
						typ = document.getElementById('vorschlagtyp'+i).value;					

						/*if (typ == 'Eltern-Kind-Reisen') typ = 'Familienreisen';*/
						suggest += ' <div class="suggItem" onmouseover="this.className=\'suggItemOver\';" onmouseout="this.className=\'suggItem\';"';
						suggest += 'onclick="javascript:setSearch(' + i + ');" id="suchzelle1'+i+'">';
					
						suggest += '<div class="suggName">'+ display + ' / ' + displayort +'</div> <div class="suggCat">';
						suggest += typ; 
						suggest += '</div>';
				}
				suggest += ' </div>';	
			}
			suggest += '</div>';
			ss.innerHTML += suggest;
		}
		if(document.getElementById('search_suggest').innerHTML != '')
		{
			document.getElementById('search_suggest').style.display='block';
		}
		else
		{
			document.getElementById('search_suggest').style.display='none';
		}
	}
}
function suggestOver(i)
{
writeDebug("function suggestOver("+i+")");
	var obj1 = document.getElementById("suggItem"+i);
	if (obj1) { obj1.style.backgroundColor='#874d51';obj1.style.color='#ffffff'; }
}
function suggestOut(i)
{
writeDebug("function suggestOut("+i+")");
	var obj1 = document.getElementById("suggItem"+i);
	if (obj1) { obj1.style.backgroundColor='transparent';obj1.style.color='#874d51'; }
}
function setSearch( selectedrow) {
	document.getElementById('url').value  = document.getElementById("vorschlagurl" + selectedrow).value;
	 var url = document.getElementById('url').value;
	document.forms['frmSearch'].setAttribute('action',url) ;
	document.getElementById('search_suggest').innerHTML = '';
  	document.getElementById('frmSearch').submit();
}
function getkeycode(Ereignis)
{
writeDebug("function getkeycode(");
	if (typeof selectedrow == "undefined")
	{
		selectedrow = -1;
	}

	if (!Ereignis) Ereignis = window.event;
	if (Ereignis)
	{
		var Tastencode = -1;

		if (Ereignis.keyCode)
		{
			Tastencode = Ereignis.keyCode;
		}
		else if (Ereignis.which)
		{
			Tastencode = Ereignis.which;
		}
		
		if (Tastencode=='38' || Tastencode == '40')
		{
			ssActivated = false;
			changeselection(Tastencode);
		}
		else if (Tastencode=='13') 
		{
			ssActivated = true;
			onReturnCopySelectedSuggest();
			selectedrow=-1;
		}
		else
		{
			ssActivated = true;
			selectedrow=-1;
		}
	}
writeDebug("function getkeycode(");
}
function onReturnCopySelectedSuggest()
{
	var obj1 = document.getElementById("selectedsuggest");
	var obj2 = document.getElementById("txtSearchID");
	return true;
}
function changeselection (Tastencode)
{
writeDebug("function changeselection(");
	if (typeof selectedrow == 'undefined')
	{
		selectedrow = -1;
	}
	if (!Tastencode)
	{
		Ereignis = window.event;
		if (Ereignis.which)
		{
			Tastencode = Ereignis.which;
		}
		else if (Ereignis.keyCode)
		{
			Tastencode = Ereignis.keyCode;
		}
	}
	if (document.getElementById("cntsuggests"))
	{
		var cntsuggests = document.getElementById("cntsuggests").value;
	}
	else
	{
		var cntsuggests = 0;
	}
	if (Tastencode == '38' && cntsuggests>0)
	{
		if (selectedrow>0)
		{
			selectedrow = selectedrow - 1;
			if (selectedrow=='-2') selectedrow=-1;

			var previousrow = selectedrow-1;
			var nextrow = selectedrow+1;

			if (document.getElementById("suchzelle1" + selectedrow).className!='')
			{
				document.getElementById("suchzelle1" + selectedrow).className = 'suggItemOver';
			}

			if (document.getElementById("suchzelle1" + nextrow).className!='')
			{
				document.getElementById("suchzelle1" + nextrow).className = 'suggItem';
		}
		}
	}

	if (Tastencode == '40' && cntsuggests>0)
	{
		// NACH UNTEN;
		if (selectedrow < cntsuggests - 1)
		{
			selectedrow = selectedrow + 1;
			var previousrow = selectedrow-1;
			var nextrow = selectedrow+1;

			//suggestOver(selectedrow);
		  document.getElementById("suchzelle1" + selectedrow).className = 'suggItemOver';
		  
			if (selectedrow!=0)
			{
				if (document.getElementById("suchzelle1" + previousrow).className!='')
				{
					//suggestOut(previousrow);
					document.getElementById("suchzelle1" + previousrow).className = 'suggItem';
				}
			}
		}
	}

	if ((Tastencode == '38' || Tastencode=='40') && selectedrow>=0 && cntsuggests>0)
	{
	document.getElementById('url').value  = document.getElementById("vorschlagurl" + selectedrow).value;
		
	}
	else
	{
		selectedrow=-1;
	}
}
function sleep(ms)
{
	var zeit=(new Date()).getTime();
	var stoppZeit=zeit+ms;
	while((new Date()).getTime()<stoppZeit) {};
} 
function startsearch()
{

	 var url = document.getElementById('url').value;
	 if (url != '') {
		document.forms['frmSearch'].setAttribute('action',url) ;
		  return true; }
	 else return true;
} 
function htmlentities(str,typ) {
   if(typeof str=="undefined") str="";
    if(typeof typ!="number") typ=2;
    typ=Math.max(0,Math.min(3,parseInt(typ)));
    var html=new Array();
    html[38]="&amp;"; html[60]="&lt;"; html[62]="&gt;";
    if(typ==1 || typ==3) html[39]="&#039;";
    if(typ==2 || typ==3) html[34]="&quot;";
    for(var i in html) eval("str=str.replace(/"+String.fromCharCode(i)+"/g,\""+html[i]+"\");");
   var entity=new Array(
      "&nbsp;","&iexcl;","&cent;","&pound;","&curren;","&yen;","&brvbar;","&sect;",
      "&uml;","&copy;","&ordf;","&laquo;","&not;","&shy;","&reg;","&macr;",
     "&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;",
      "&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;",
      "&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;",
      "&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;",
      "&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;",
     "&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;",
     "&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;",
      "&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;",
     "&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;",
      "&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&yacute;","&thorn;","&yuml;"
      );
    for(var i in entity) eval("str=str.replace(/"+String.fromCharCode(i*1+160)+"/g,\""+entity[i]+"\");");
    return str;
    }  
	
/****************************************************************************************
 * Pretty Photo Lightbox
 ****************************************************************************************/
(function($){$.prettyPhoto={version:'2.5.4'};$.fn.prettyPhoto=function(settings){settings=jQuery.extend({animationSpeed:'normal',padding:40,opacity:0.60,showTitle:true,allowresize:true,counter_separator_label:'/',theme:'light_rounded',hideflash:false,modal:false,changepicturecallback:function(){},callback:function(){}},settings);if($.browser.msie&&$.browser.version==6){settings.theme="light_square";}
if($('.pp_overlay').size()==0){_buildOverlay();}else{$pp_pic_holder=$('.pp_pic_holder');$ppt=$('.ppt');}
var doresize=true,percentBased=false,correctSizes,$pp_pic_holder,$ppt,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,pp_type='image',setPosition=0,$scrollPos=_getScroll();$(window).scroll(function(){$scrollPos=_getScroll();_centerOverlay();_resizeOverlay();});$(window).resize(function(){_centerOverlay();_resizeOverlay();});$(document).keydown(function(e){if($pp_pic_holder.is(':visible'))
switch(e.keyCode){case 37:$.prettyPhoto.changePage('previous');break;case 39:$.prettyPhoto.changePage('next');break;case 27:if(!settings.modal)
$.prettyPhoto.close();break;};});$(this).each(function(){$(this).bind('click',function(){link=this;theRel=$(this).attr('rel');galleryRegExp=/\[(?:.*)\]/;theGallery=galleryRegExp.exec(theRel);var images=new Array(),titles=new Array(),descriptions=new Array();if(theGallery){$('a[rel*='+theGallery+']').each(function(i){if($(this)[0]===$(link)[0])setPosition=i;images.push($(this).attr('href'));titles.push($(this).find('img').attr('alt'));descriptions.push($(this).attr('title'));});}else{images=$(this).attr('href');titles=($(this).find('img').attr('alt'))?$(this).find('img').attr('alt'):'';descriptions=($(this).attr('title'))?$(this).attr('title'):'';}
$.prettyPhoto.open(images,titles,descriptions);return false;});});$.prettyPhoto.open=function(gallery_images,gallery_titles,gallery_descriptions){if($.browser.msie&&$.browser.version==6){$('select').css('visibility','hidden');};if(settings.hideflash)$('object,embed').css('visibility','hidden');images=$.makeArray(gallery_images);titles=$.makeArray(gallery_titles);descriptions=$.makeArray(gallery_descriptions);if($('.pp_overlay').size()==0){_buildOverlay();}else{$pp_pic_holder=$('.pp_pic_holder');$ppt=$('.ppt');}
$pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);isSet=($(images).size()>0)?true:false;_getFileType(images[setPosition]);_centerOverlay();_checkPosition($(images).size());$('.pp_loaderIcon').show();$('div.pp_overlay').show().fadeTo(settings.animationSpeed,settings.opacity,function(){$pp_pic_holder.fadeIn(settings.animationSpeed,function(){$pp_pic_holder.find('p.currentTextHolder').text((setPosition+1)+settings.counter_separator_label+$(images).size());if(descriptions[setPosition]){$pp_pic_holder.find('.pp_description').show().html(unescape(descriptions[setPosition]));}else{$pp_pic_holder.find('.pp_description').hide().text('');};if(titles[setPosition]&&settings.showTitle){hasTitle=true;$ppt.html(unescape(titles[setPosition]));}else{hasTitle=false;};if(pp_type=='image'){imgPreloader=new Image();nextImage=new Image();if(isSet&&setPosition>$(images).size())nextImage.src=images[setPosition+1];prevImage=new Image();if(isSet&&images[setPosition-1])prevImage.src=images[setPosition-1];pp_typeMarkup='<img id="fullResImage" src="" />';$pp_pic_holder.find('#pp_full_res')[0].innerHTML=pp_typeMarkup;$pp_pic_holder.find('.pp_content').css('overflow','hidden');$pp_pic_holder.find('#fullResImage').attr('src',images[setPosition]);imgPreloader.onload=function(){correctSizes=_fitToViewport(imgPreloader.width,imgPreloader.height);_showContent();};imgPreloader.src=images[setPosition];}else{movie_width=(parseFloat(grab_param('width',images[setPosition])))?grab_param('width',images[setPosition]):"425";movie_height=(parseFloat(grab_param('height',images[setPosition])))?grab_param('height',images[setPosition]):"344";if(movie_width.indexOf('%')!=-1||movie_height.indexOf('%')!=-1){movie_height=($(window).height()*parseFloat(movie_height)/100)-100;movie_width=($(window).width()*parseFloat(movie_width)/100)-100;percentBased=true;}
movie_height=parseFloat(movie_height);movie_width=parseFloat(movie_width);if(pp_type=='quicktime')movie_height+=15;correctSizes=_fitToViewport(movie_width,movie_height);if(pp_type=='youtube'){pp_typeMarkup='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.youtube.com/v/'+grab_param('v',images[setPosition])+'" /><embed src="http://www.youtube.com/v/'+grab_param('v',images[setPosition])+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"></embed></object>';}else if(pp_type=='quicktime'){pp_typeMarkup='<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="'+correctSizes['height']+'" width="'+correctSizes['width']+'"><param name="src" value="'+images[setPosition]+'"><param name="autoplay" value="true"><param name="type" value="video/quicktime"><embed src="'+images[setPosition]+'" height="'+correctSizes['height']+'" width="'+correctSizes['width']+'" autoplay="true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>';}else if(pp_type=='flash'){flash_vars=images[setPosition];flash_vars=flash_vars.substring(images[setPosition].indexOf('flashvars')+10,images[setPosition].length);filename=images[setPosition];filename=filename.substring(0,filename.indexOf('?'));pp_typeMarkup='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="'+filename+'?'+flash_vars+'" /><embed src="'+filename+'?'+flash_vars+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"></embed></object>';}else if(pp_type=='iframe'){movie_url=images[setPosition];movie_url=movie_url.substr(0,movie_url.indexOf('iframe')-1);pp_typeMarkup='<iframe src ="'+movie_url+'" width="'+(correctSizes['width'])+'" height="'+(correctSizes['height'])+'" frameborder="no"></iframe>';}
_showContent();}});});};$.prettyPhoto.changePage=function(direction){if(direction=='previous'){setPosition--;if(setPosition<0){setPosition=0;return;}}else{if($('.pp_arrow_next').is('.disabled'))return;setPosition++;};if(!doresize)doresize=true;_hideContent();$('a.pp_expand,a.pp_contract').fadeOut(settings.animationSpeed,function(){$(this).removeClass('pp_contract').addClass('pp_expand');$.prettyPhoto.open(images,titles,descriptions);});};$.prettyPhoto.close=function(){$pp_pic_holder.find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt').fadeOut(settings.animationSpeed);$('div.pp_overlay').fadeOut(settings.animationSpeed,function(){$('div.pp_overlay,div.pp_pic_holder,div.ppt').remove();if($.browser.msie&&$.browser.version==6){$('select').css('visibility','visible');};if(settings.hideflash)$('object,embed').css('visibility','visible');setPosition=0;settings.callback();});doresize=true;};_showContent=function(){$('.pp_loaderIcon').hide();if($.browser.opera){windowHeight=window.innerHeight;windowWidth=window.innerWidth;}else{windowHeight=$(window).height();windowWidth=$(window).width();};projectedTop=$scrollPos['scrollTop']+((windowHeight/2)-(correctSizes['containerHeight']/2));if(projectedTop<0)projectedTop=0+$pp_pic_holder.find('.ppt').height();$pp_pic_holder.find('.pp_content').animate({'height':correctSizes['contentHeight']},settings.animationSpeed);$pp_pic_holder.animate({'top':projectedTop,'left':((windowWidth/2)-(correctSizes['containerWidth']/2)),'width':correctSizes['containerWidth']},settings.animationSpeed,function(){$pp_pic_holder.width(correctSizes['containerWidth']);$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(correctSizes['height']).width(correctSizes['width']);$pp_pic_holder.find('#pp_full_res').fadeIn(settings.animationSpeed);if(isSet&&pp_type=="image"){$pp_pic_holder.find('.pp_hoverContainer').fadeIn(settings.animationSpeed);}else{$pp_pic_holder.find('.pp_hoverContainer').hide();}
$pp_pic_holder.find('.pp_details').fadeIn(settings.animationSpeed);if(settings.showTitle&&hasTitle){$ppt.css({'top':$pp_pic_holder.offset().top-20,'left':$pp_pic_holder.offset().left+(settings.padding/2),'display':'none'});$ppt.fadeIn(settings.animationSpeed);};if(correctSizes['resized'])$('a.pp_expand,a.pp_contract').fadeIn(settings.animationSpeed);if(pp_type!='image')$pp_pic_holder.find('#pp_full_res')[0].innerHTML=pp_typeMarkup;settings.changepicturecallback();});};function _hideContent(){$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');$pp_pic_holder.find('.pp_hoverContainer,.pp_details').fadeOut(settings.animationSpeed);$pp_pic_holder.find('#pp_full_res').fadeOut(settings.animationSpeed,function(){$('.pp_loaderIcon').show();});$ppt.fadeOut(settings.animationSpeed);}
function _checkPosition(setCount){if(setPosition==setCount-1){$pp_pic_holder.find('a.pp_next').css('visibility','hidden');$pp_pic_holder.find('a.pp_arrow_next').addClass('disabled').unbind('click');}else{$pp_pic_holder.find('a.pp_next').css('visibility','visible');$pp_pic_holder.find('a.pp_arrow_next.disabled').removeClass('disabled').bind('click',function(){$.prettyPhoto.changePage('next');return false;});};if(setPosition==0){$pp_pic_holder.find('a.pp_previous').css('visibility','hidden');$pp_pic_holder.find('a.pp_arrow_previous').addClass('disabled').unbind('click');}else{$pp_pic_holder.find('a.pp_previous').css('visibility','visible');$pp_pic_holder.find('a.pp_arrow_previous.disabled').removeClass('disabled').bind('click',function(){$.prettyPhoto.changePage('previous');return false;});};if(setCount>1){$('.pp_nav').show();}else{$('.pp_nav').hide();}};function _fitToViewport(width,height){hasBeenResized=false;_getDimensions(width,height);imageWidth=width;imageHeight=height;windowHeight=$(window).height();windowWidth=$(window).width();if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allowresize&&!percentBased){hasBeenResized=true;notFitting=true;while(notFitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{notFitting=false;};pp_containerHeight=imageHeight;pp_containerWidth=imageWidth;};_getDimensions(imageWidth,imageHeight);};return{width:imageWidth,height:imageHeight,containerHeight:pp_containerHeight,containerWidth:pp_containerWidth,contentHeight:pp_contentHeight,contentWidth:pp_contentWidth,resized:hasBeenResized};};function _getDimensions(width,height){$pp_pic_holder.find('.pp_details').width(width).find('.pp_description').width(width-parseFloat($pp_pic_holder.find('a.pp_close').css('width')));pp_contentHeight=height+$pp_pic_holder.find('.pp_details').height()+parseFloat($pp_pic_holder.find('.pp_details').css('marginTop'))+parseFloat($pp_pic_holder.find('.pp_details').css('marginBottom'));pp_contentWidth=width;pp_containerHeight=pp_contentHeight+$pp_pic_holder.find('.ppt').height()+$pp_pic_holder.find('.pp_top').height()+$pp_pic_holder.find('.pp_bottom').height();pp_containerWidth=width+settings.padding;}
function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com\/watch/i)){pp_type='youtube';}else if(itemSrc.indexOf('.mov')!=-1){pp_type='quicktime';}else if(itemSrc.indexOf('.swf')!=-1){pp_type='flash';}else if(itemSrc.indexOf('iframe')!=-1){pp_type='iframe'}else{pp_type='image';};};function _centerOverlay(){if($.browser.opera){windowHeight=window.innerHeight;windowWidth=window.innerWidth;}else{windowHeight=$(window).height();windowWidth=$(window).width();};if(doresize){$pHeight=$pp_pic_holder.height();$pWidth=$pp_pic_holder.width();$tHeight=$ppt.height();projectedTop=(windowHeight/2)+$scrollPos['scrollTop']-($pHeight/2);if(projectedTop<0)projectedTop=0+$tHeight;$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+$scrollPos['scrollLeft']-($pWidth/2)});$ppt.css({'top':projectedTop-$tHeight,'left':(windowWidth/2)+$scrollPos['scrollLeft']-($pWidth/2)+(settings.padding/2)});};};function _getScroll(){if(self.pageYOffset){scrollTop=self.pageYOffset;scrollLeft=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){scrollTop=document.documentElement.scrollTop;scrollLeft=document.documentElement.scrollLeft;}else if(document.body){scrollTop=document.body.scrollTop;scrollLeft=document.body.scrollLeft;}
return{scrollTop:scrollTop,scrollLeft:scrollLeft};};function _resizeOverlay(){$('div.pp_overlay').css({'height':$(document).height(),'width':$(window).width()});};function _buildOverlay(){toInject="";toInject+="<div class='pp_overlay'></div>";toInject+='<div class="pp_pic_holder"><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_loaderIcon"></div><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details clearfix"><a class="pp_close" href="#">Close</a><p class="pp_description"></p><div class="pp_nav"><a href="#" class="pp_arrow_previous">Previous</a><p class="currentTextHolder">0'+settings.counter_separator_label+'0</p><a href="#" class="pp_arrow_next">Next</a></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div>';toInject+='<div class="ppt"></div>';$('body').append(toInject);$('div.pp_overlay').css('opacity',0);$pp_pic_holder=$('.pp_pic_holder');$ppt=$('.ppt');$('div.pp_overlay').css('height',$(document).height()).hide().bind('click',function(){if(!settings.modal)
$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});$('a.pp_expand').bind('click',function(){$this=$(this);if($this.hasClass('pp_expand')){$this.removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$this.removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent();$pp_pic_holder.find('.pp_hoverContainer, .pp_details').fadeOut(settings.animationSpeed);$pp_pic_holder.find('#pp_full_res').fadeOut(settings.animationSpeed,function(){$.prettyPhoto.open(images,titles,descriptions);});return false;});$pp_pic_holder.find('.pp_previous, .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');return false;});$pp_pic_holder.find('.pp_next, .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');return false;});$pp_pic_holder.find('.pp_hoverContainer').css({'margin-left':settings.padding/2});};};function grab_param(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);if(results==null)
return"";else
return results[1];}})(jQuery);
$(document).ready(function(){$(".lightbox a[rel^='prettyPhoto']").prettyPhoto({theme:'light_rounded'});});	
/*  * jQuery Tooltip plugin 1.3 */
;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent);}function settings(element){return $.data(element,"tooltip");}function handle(event){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else
show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)helper.body.append("<br/>");helper.body.append(part);}helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}if(settings(this).showURL&&$(this).url())helper.url.html($(this).url().replace('http://','')).show();else
helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments);}function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else
helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}update();}function update(event){if($.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION"){return;}if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}if(current==null){$(document.body).unbind('mousemove',update);return;}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}helper.parent.css({left:left,right:right,top:top});}var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}function hide(event){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
helper.parent.stop().fadeOut(tsettings.fade,complete);}else
complete();if(settings(this).fixPNG)helper.parent.unfixPNG();}})(jQuery);
/* Tooltip normal */
$(function() {
$('.tooltip').tooltip({ 
opacity: 0.9, 
positionLeft: false,
showURL: false,
left: 5,
showBody: " | ",
track: true
 });
});

/* Google Analytics */
  $(document).ready(function() {var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");$.getScript(gaJsHost + "google-analytics.com/ga.js",function() {var pageTracker = _gat._getTracker('UA-235824-1');pageTracker._initData();
pageTracker._trackPageview();});});
