/* ////////////////////////////////////////////////////////////////                            
                               By i4m                              
///////////////////////////////////////////////////////////////////

Struktur:
<ul>
	<li><a>TXT</a>
		<ul>
			<li><a>TXT</a>
		</ul>
	</li>
</ul>

<ul>
	<span><a>TXT</a>
		<div>
			<span><a>TXT</a></span>
		</div>
	</span>
</ul>
*/
function DrMenu(menuid){
	var self = this;
	this.menuid = menuid;
	this.active_items = new Array();  // Array für aktive Elemente
	this.html_menu = document.getElementById(this.menuid);  // Referenz auf die UL des Menus
	this.menu_event = "over"; // over oder click möglich
	this.show_parent_active = true; // wenn der/die Parent(s) aktiv bleiben sollen wird über die .hover classe gesteuert
	this.linkOut = true;  // ob beim überfahren einens anderen Menüpunktes das aktive Submenu verschwinden soll.
	this.needIeSelectBoxBugFix = ((navigator.appVersion.indexOf("MSIE 5") != -1 || navigator.appVersion.indexOf("MSIE 6") != -1) && navigator.userAgent.indexOf("Opera")==-1); // ob der IeSelectBoxBug gefixt werden muss
	this.init = function(){
		this.html_menu.obref = this;  // Referenz auf das DrMenu-Object
		this.html_menu.innerHTML = this.html_menu.innerHTML.replace(/<UL([^>]*)>/gi, '<div$1>').replace(/<\/UL>/gi, "</div>").replace(/<LI([^>]*)>/gi, '<span$1>').replace(/<\/LI>/gi, "</span>");  // ul wird durch div ersetzt und li durch span
		for(i=0; i<this.html_menu.getElementsByTagName("a").length; i++){  // Ereignissfunktionen werden gesetzt
			if(this.menu_event=="over" && this.html_menu.getElementsByTagName("a")[i].parentNode.getElementsByTagName("div").length>0){  // Wenn der Link ein Submenü beinhaltet
				this.html_menu.getElementsByTagName("a")[i].onmouseover = this.itemOver;
				this.html_menu.getElementsByTagName("a")[i].onmouseout = this.itemOut;
				this.html_menu.getElementsByTagName("a")[i].className += " nextlevel";
				this.html_menu.getElementsByTagName("a")[i].parentNode.getElementsByTagName("div")[0].onmouseover = this.drOver;
				this.html_menu.getElementsByTagName("a")[i].parentNode.getElementsByTagName("div")[0].onmouseout = this.drOut;
				this.html_menu.getElementsByTagName("a")[i].parentNode.getElementsByTagName("div")[0].style.display = "block";  // Das Submenü wird sichtbar gemacht (für die Breitenfeststellung nötig)
				this.setClassWidth(this.html_menu.getElementsByTagName("a")[i].parentNode.getElementsByTagName("div")[0]);  // Breitenfeststellung und Setzung
			}
			else if(this.menu_event=="over" && this.linkOut){  // Wenn der Link kein Submenü beinhaltet
				this.html_menu.getElementsByTagName("a")[i].onmouseover = this.lwsmItemOver;
			}
			else if(this.menu_event=="click" && this.html_menu.getElementsByTagName("a")[i].parentNode.getElementsByTagName("div").length>0){
				this.html_menu.getElementsByTagName("a")[i].onclick = this.itemOver;
				this.html_menu.getElementsByTagName("a")[i].parentNode.getElementsByTagName("div")[0].style.display = "block";  // Das Submenü wird sichtbar gemacht (für die Breitenfeststellung nötig)
				this.setClassWidth(this.html_menu.getElementsByTagName("a")[i].parentNode.getElementsByTagName("div")[0]);  // Breitenfeststellung und Setzung
			}
		}
		for(i=this.html_menu.getElementsByTagName("a").length-1; i>=0; i--){
			if(this.html_menu.getElementsByTagName("a")[i].parentNode.getElementsByTagName("div").length>0){
				this.html_menu.getElementsByTagName("a")[i].parentNode.getElementsByTagName("div")[0].style.display = "none";
				this.html_menu.getElementsByTagName("a")[i].parentNode.getElementsByTagName("div")[0].style.width = this.html_menu.getElementsByTagName("a")[i].parentNode.getElementsByTagName("div")[0].zw_width
			}
		}
	}
	this.lwsmItemOver = function(){
		for(i=0; i<this.parentNode.parentNode.getElementsByTagName("div").length; i++){
			if(this.parentNode.parentNode.getElementsByTagName("div")[i].style.display == "block"){
				self.itemOutTime(this.parentNode.parentNode.getElementsByTagName("div")[i].parentNode.getElementsByTagName("a")[0]);
			}
		}
	}
	this.itemOver = function(){
		zw = true;
		for(i=0; i<this.parentNode.getElementsByTagName("div").length; i++){
			if(this.parentNode.getElementsByTagName("div")[i].style.display == "block"){
				zw=false;
				break;
			}
		}
		if(zw){		
			for(i=0; i<	self.active_items.length; i++){
				self.itemOutTime(self.active_items[i]);
			}
			old_items = self.active_items;
			self.active_items = new Array();
			for(zw=this;zw; zw=zw.parentNode.parentNode.parentNode.getElementsByTagName("a")[0]){
				if(!zw.parentNode.getElementsByTagName("div")[0]){
					zw=false;
					break;
				}
				zw.parentNode.getElementsByTagName("div")[0].style.display = "block";
				self.active_items[self.active_items.length] = zw;
				if(!zw.parentNode.parentNode.parentNode.getElementsByTagName("a")[0]){
					zw=false;
					break;
				}
			}
		}
		this.parentNode.getElementsByTagName("div")[0].style.display = "block";
		if(self.show_parent_active){
			this.className += " hover";
		}
		if(old_items){
			for(i=0; i<old_items.length; i++){
				zw=false;
				for(j=0; j<self.active_items.length; j++){
					if(old_items[i].parentNode.innerHTML == self.active_items[j].parentNode.innerHTML){
						zw=true;
						break;
					}
				}
				if(!zw){
					self.itemOutTime(old_items[i]);
				}
			}
			old_items = false;
		}
		if(this.timeout){
			clearTimeout(this.timeout);
		}
	}
	this.drOver = function(){
		this.parentNode.getElementsByTagName("a")[0].onmouseover();
	}
	this.drOut = function(){
		this.parentNode.getElementsByTagName("a")[0].onmouseout();
	}
	this.itemOut = function(){
		this.timeout = setTimeout(function(a,b) { return function() { b.itemOutTime(a); } } (this,self), 300);
	}
	this.itemOutTime = function(object){
		object.parentNode.getElementsByTagName("div")[0].style.display = "none";
		object.className = object.className.replace(/hover/g, "");
	}
	this.setClassWidth = function(object){
		maxwidth = 0;
		for(j=0; j<object.childNodes.length; j++){
			if(object.childNodes[j].getElementsByTagName){
				if(object.childNodes[j].getElementsByTagName("a")[0].offsetWidth>maxwidth){
					maxwidth = object.childNodes[j].getElementsByTagName("a")[0].offsetWidth;
				}
			}
		}
		for(j=0; j<object.childNodes.length; j++){
			if(object.childNodes[j].getElementsByTagName){
				object.childNodes[j].getElementsByTagName("a")[0].style.width = (maxwidth - getCurrentStyle(object.childNodes[j].getElementsByTagName("a")[0], 'padding-left').replace(/px/, "") - getCurrentStyle(object.childNodes[j].getElementsByTagName("a")[0], 'padding-right').replace(/px/, "")) + "px";
				if(navigator.appVersion.indexOf("MSIE 5.5") != -1 || navigator.appVersion.indexOf("MSIE 5.0") != -1){
					object.childNodes[j].getElementsByTagName("a")[0].style.width = maxwidth;
				}
				if(object.childNodes[j].getElementsByTagName("div").length>0){
					object.childNodes[j].getElementsByTagName("div")[0].style.left = maxwidth + "px";
				}
			}
		}
		object.zw_width = maxwidth + "px";
		if(self.needIeSelectBoxBugFix){  // Nur für IE 5 bis 6
			zw_iframe = document.createElement("iframe");
			object.insertBefore(zw_iframe, object.firstChild);
			zw_iframe.style.position = "absolute";
			zw_iframe.style.filter = 'alpha(opacity=0)';
			zw_iframe.style.left = (getCurrentStyle(object, "border-left-width").replace(/px/g, "")*(-1)) + (getCurrentStyle(object, "padding-left").replace(/px/g, "")*(-1)) + "px";
			zw_iframe.style.top = (getCurrentStyle(object, "border-top-width").replace(/px/g, "")*(-1)) + (getCurrentStyle(object, "padding-top").replace(/px/g, "")*(-1)) + "px";
			zw_iframe.style.width = (object.zw_width.replace(/px/g, "")*1) + (getCurrentStyle(object, "border-left-width").replace(/px/g, "")*1) + (getCurrentStyle(object, "border-right-width").replace(/px/g, "")*1) + (getCurrentStyle(object, "padding-left").replace(/px/g, "")*1) + (getCurrentStyle(object, "padding-right").replace(/px/g, "")*1) + "px";
			zw_iframe.style.height = (object.offsetHeight*1) + (getCurrentStyle(object, "border-top-width").replace(/px/g, "")*1) + (getCurrentStyle(object, "border-bottom-width").replace(/px/g, "")*1) + (getCurrentStyle(object, "padding-top").replace(/px/g, "")*1) + (getCurrentStyle(object, "padding-bottom").replace(/px/g, "")*1) + "px";
		}
	}
}
function getCurrentStyle(obj, prop){  // Gibt den Wert des abgefragten CSS-Wertes zurück
	if(obj.currentStyle){
		if(obj.currentStyle.getAttribute(prop.replace(/\-/g, ""))){
			return obj.currentStyle.getAttribute(prop.replace(/\-/g, ""));
		}
		return "";
	}
	else if(document.defaultView && document.defaultView.getComputedStyle){
		if(document.defaultView.getComputedStyle(obj,"").getPropertyValue(prop)){
			return document.defaultView.getComputedStyle(obj,"").getPropertyValue(prop);
		}
		return "";
	}
	else if(window.getComputedStyle){
		if(window.getComputedStyle(obj,"").getPropertyValue(prop)){
			return window.getComputedStyle(obj,"").getPropertyValue(prop);
		}
		return "";
	}
	else{
		if(obj.style.getAttribute(prop.replace(/\-/g, ""))){
			return obj.style.getAttribute(prop.replace(/\-/g, ""));
		}
		return "";
	}
}

function setHeadlinesSpan(container, tagname){
	if(container){
		for(i=0; i<container.getElementsByTagName(tagname).length; i++){
			container.getElementsByTagName(tagname)[i].innerHTML = "<span>"+container.getElementsByTagName(tagname)[i].innerHTML+"</span>";
			container.getElementsByTagName(tagname)[i].className = "line";
		}
	}
	else{
		return false;
	}
}

/*******    popup(linkobjekt, breite, höhe)    ********/
function popup(obj,w,h){
	popup(obj,w,h,false);
}
function popup(obj,w,h,returnobj) {
	var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
	if (!url) return true;
	if(w && h){
		var args = 'width='+w+',height='+h+',resizable=no';
	}
	else{
		var args = 'resizable=yes,hotkeys=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes';
	}
	pop = window.open(url,'',args);
	if(returnobj){
		return pop;
	}
	return (pop) ? false : true;
}	

/*******    durchsucht alle links mit target="_blank" oder rel="external"    ********/
function parseLinks(){
	for(i=0; i<document.getElementsByTagName("a").length; i++){
		zwobj = document.getElementsByTagName("a")[i];
		if((zwobj.getAttribute) ? zwobj.getAttribute('target') : zwobj.target == "_blank"){
			zwobj.onclick = function(){
				return popup(this);
		}
			zwobj.target="";
		}
		else if((zwobj.getAttribute) ? zwobj.getAttribute('rel') : zwobj.rel == "external"){
			zwobj.onclick = function(){
				return popup(this);	
			}
		}
	}
}
/*/////////////////////////////////////////////////////////////
                          Flash Check
/////////////////////////////////////////////////////////////*/
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 7;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// -----------------------------------------------------------------------------
// -->

document.write('<script language="VBScript" type="text/vbscript"\> \n');
document.write('// Visual basic helper required to detect Flash Player ActiveX control version information\n');
document.write('Function VBGetSwfVer(i)\n');
document.write('  on error resume next\n');
document.write('  Dim swControl, swVersion\n');
document.write('  swVersion = 0\n');
document.write('  set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))\n');
document.write('  if (IsObject(swControl)) then\n');
document.write('    swVersion = swControl.GetVariable("$version")\n');
document.write('  end if\n');
document.write('  VBGetSwfVer = swVersion\n');
document.write('End Function\n');
document.write('//\n ');
document.write('</script\>');

<!-- // Detect Client Browser type

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Cant detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{

 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	
	for (i=25;i>0;i--) {	
		
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
			
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		
		
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
}

// Version check based upon the values entered above in "Globals"
var fl = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);




/*/////////////////////////////////////////////////////////////
                     Draw Flash Funktion
/////////////////////////////////////////////////////////////*/
/*
Aufruf:
drawFlash(pfad, width, height, wmode, bgcolor, id, alt, rw);

pfad = der Pfad zur .swf Datei
width,height = Breite und Höhe
wmode = wmode-Eigenschaf des Flash Objekts
bgcolor = Hintergrundfarbe
id = die id des <object> Tag
alt = HTML-Code der zurückgegeben wird wenn Flash nicht aktiv ist
rw = true wenn das Flash object per document.write geschrieben werden soll.
*/
function drawFlash(pfad, width, height, wmode, bgcolor, id, alt, rw){   /// giebt den Quellcode für ein Flash-Object zurück
	ausgabe = "";
	if(fl){
		params = false;
		if(pfad.indexOf("?") != -1){
			params = pfad.split("?")[1];
			pfad = pfad.split("?")[0];
		}
		ausgabe += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" name="flash" width="' + width + '" id="' + id + '" height="' + height + '" align="middle">';
		ausgabe += '<param name="allowScriptAccess" value="sameDomain" />';
		if(wmode!=""){ausgabe += '<param name="wmode" value="' + wmode + '" />';}
		if(bgcolor!=""){ausgabe += '<param name="bgcolor" value="' + bgcolor + '" />';}
		if(params){ausgabe += '<param name="flashvars" value="' + params + '" />';}
		ausgabe += '<param name="movie" value="' + pfad + '" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />';
		ausgabe += '<embed src="' + pfad + '" width="' + width + '" height="' + height + '"';
		if(wmode!=""){ausgabe += ' wmode="' + wmode + '"';}
		if(bgcolor!=""){ausgabe += ' bgcolor="' + bgcolor + '"';}
		if(params){ausgabe += ' flashvars="' + params + '"';}
		ausgabe += ' menu="false" align="middle" quality="high" bgcolor="#ffffff" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" name="flash" />';
		ausgabe += '</object>';
	}
	else{
		ausgabe += alt;
	}
	if(rw){
		document.write(ausgabe);
	}
	return ausgabe;
}








function parseRezept(object){
	zh2=0;
	for(i=0; i<object.childNodes.length; i++){
		if(object.childNodes[i].nodeName.toLowerCase() == "h2"){
			object.childNodes[i].className += " closed";
			object.childNodes[i].number = zh2;
			object.childNodes[i].innerHTML = '<a href="javascript:void(0);"><span>details einblenden</span>' + object.childNodes[i].innerHTML + '</a>';
			object.childNodes[i].getElementsByTagName("a")[0].onclick = function(){
				if(document.getElementById("divtipp_" + this.parentNode.number).className == "closed"){
					document.getElementById("divtipp_" + this.parentNode.number).className = "opened";
					this.className = "opened";
					this.getElementsByTagName("span")[0].innerHTML = "details ausblenden";
				}
				else{
					document.getElementById("divtipp_" + this.parentNode.number).className = "closed";
					this.getElementsByTagName("span")[0].innerHTML = "details einblenden";
					this.className = "";
				}
				this.blur();
			}
			zh2++;
		}
		else if(object.childNodes[i].nodeName.toLowerCase() == "div"){
			object.childNodes[i].className = "closed";
			object.childNodes[i].number = zh2-1;
			object.childNodes[i].id = "divtipp_" + (zh2-1);
		}
	}
}


function startSlideShow(object, path, size){
	object.picsize = size;
	object.aktpic = 0;
	object.path = path;
	setTimeout('runSlideShow("' + object.id + '")', 4000);
}
function runSlideShow(objectid){
	object = document.getElementById(objectid);
	if (document.all){
		object.style.filter='blendTrans(duration='+'2'+')';
		object.filters.blendTrans.Apply();   
	}
	object.aktpic++;
	if(object.aktpic>=object.picsize){
		object.aktpic=0;
	}
	object.src = object.path + object.aktpic + ".jpg";
	if (document.all){
		object.filters.blendTrans.Play();
	}
	setTimeout('runSlideShow("' + objectid + '")', 4000);
}

function parseImageGallery(object){
	for(i=0; i<object.getElementsByTagName("a").length; i++){
		object.getElementsByTagName("a")[i].href = "/content/de/hotel/impressionen/img.php?url=" + object.getElementsByTagName("a")[i].href;
		object.getElementsByTagName("a")[i].onclick = function(){
			return popup(this, 600, 450);
		}
		object.getElementsByTagName("a")[i].title = "Klicken Sie auf das Bild um es zu vergr&ouml;&szlig;ern";
	}
}

function Gallery(container, width, height){
	this.obref = container;
	this.imgwidth = width;
	this.imgheight = height;
	this.catnames = new Array();
	this.catpahts = new Array();
	this.catlengths = new Array();
	this.catimgnames = new Array();
	this.duration = 5000;
	this.fade_duration = 1;
	var self = this;
	this.addCategory = function(catname, catpath, catlength, names){
		self.catnames.push(catname);
		self.catpahts.push(catpath);
		self.catlengths.push(catlength);
		self.catimgnames.push(names);
	}
	this.init = function(catnum){
		if(!catnum || catnum==""){
			catnum=0;
		}
		self.htmlcode  = '<div class="ig_imgwrapper" style="width:' + self.imgwidth + 'px;height:' + self.imgheight + 'px;"><img style="filter:progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=15,Duration=' + self.fade_duration + ')" /></div>';
		self.htmlcode += '<span class="ig_title"></span>';
		self.htmlcode += '<div class="ig_navigation">';
		self.htmlcode += '<a href="#" class="ig_back">Zurück</a><a href="#" class="ig_play">Pause</a><a href="" class="ig_next">Weiter</a>';
		self.htmlcode += '</div>';
		self.htmlcode += '<div class="ig_categories">';
		self.htmlcode += '<ul>';
		for(i=0; i<self.catnames.length; i++){
			self.htmlcode += '<li><a href="#" title="' + self.catnames[i] + '">' + self.catnames[i] + '</a>';
		}
		self.htmlcode += '</ul>';
		self.htmlcode += '</div>';
		self.obref.innerHTML = self.htmlcode;
		self.activeCategory = catnum;
		self.play();
		//self.obref.getElementsByTagName("img")[0].style.filter = "";
		for(i=0; i<self.catnames.length; i++){
			self.obref.getElementsByTagName("div")[2].getElementsByTagName("a")[i].catid = i;
			self.obref.getElementsByTagName("div")[2].getElementsByTagName("a")[i].onclick = function(){
				self.setCategory(this.catid);
				return false;
			}
		}
		self.obref.getElementsByTagName("a")[0].onclick = function(){
			self.back();
			return false;
		}
		self.obref.getElementsByTagName("a")[1].onclick = function(){
			self.play();
			return false;
		}
		self.obref.getElementsByTagName("a")[2].onclick = function(){
			self.next();
			return false;
		}
	}
	this.setCategory = function(numid){
		self.activeCategory = numid;
		self.activeImg = self.catlengths[numid];
		self.next();
	}
	this.showImg = function(imgnum){
		self.obref.getElementsByTagName("span")[0].innerHTML = self.catimgnames[self.activeCategory][imgnum];
		self.activeImg = imgnum;
		if(self.obref.getElementsByTagName("img")[0].filters){
			self.obref.getElementsByTagName("img")[0].filters[0].apply();
		}
		self.obref.getElementsByTagName("img")[0].src = self.catpahts[self.activeCategory] + '/' + imgnum + '.jpg';
		if(self.obref.getElementsByTagName("img")[0].filters){		
			self.obref.getElementsByTagName("img")[0].filters[0].play();
		}
	}
	this.next = function(){
		if(self.activeImg+1 < self.catlengths[self.activeCategory]){
			self.showImg(self.activeImg+1);
		}
		else{
			self.showImg(0);
		}
		if(self.timeout){
			clearTimeout(self.timeout);
		}
		if(self.is_playing){
			self.timeout = setTimeout(function(a,b) { return function() { a.next(b); } } (self,true), self.duration);
		}
	}
	this.back = function(){
		if(self.activeImg > 0){
			self.showImg(self.activeImg-1);
		}
		else{
			self.showImg(self.catlengths[self.activeCategory]-1);
		}
		if(self.timeout){
			clearTimeout(self.timeout);
		}
	}
	this.play = function(){
		if(self.is_playing){
			self.is_playing = false;
			clearTimeout(self.timeout);
			self.obref.getElementsByTagName("a")[1].innerHTML = "Play";
			self.obref.getElementsByTagName("a")[1].className = "ig_play";
		}
		else{
			self.is_playing = true;
			self.obref.getElementsByTagName("a")[1].innerHTML = "Pause";
			self.obref.getElementsByTagName("a")[1].className = "ig_pause";
			self.next();
		}
	}
}



function parseQuerystring( parameterName )
{
 var lletter, fletter;
 var querystring, parameterValue, rSpace;
 querystring = document.location.search;
 parameterValue = "";
 if ( querystring.length > 1 ) 
 {
 querystring = querystring.substr(1);
 fletter = querystring.indexOf(parameterName);
 if(fletter != -1)
 {
 fletter += parameterName.length + 1;
// lletter = querystring.indexOf('%26', fletter);
 lletter = querystring.indexOf('&', fletter);
 if(lletter == -1)
 {
 lletter = querystring.length;
 }
 parameterValue = querystring.substring(fletter,lletter);
 rSpace = new RegExp(" ","g");
 parameterValue = parameterValue.replace(rSpace, "+");
 }
 }
 return parameterValue;
}




function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

