// JavaScript Document
function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

var http = createRequestObject();

function SendCMS2Arg(f,session,arg) {
	// window.open(f+arg); //  alert(f+'?'+arg);
	http.open('get', f+'?'+arg);
	// http.open('get', 'http://www.x?'+arg);
	http.onreadystatechange = handleResponse;
	http.send(null);
}

function handleResponse() {
    if(http.readyState == 4){
        var response 	= http.responseText;
        var update 		= new Array();
		//alert(response);
        if(response.indexOf('###' != -1)) {
					update = response.split('###');
					document.getElementById(update[0]).innerHTML = update[1];
        }
    }
}

// ------------------------------------------------------------------- Details
function psdcreq(page,divname,art)
{
	document.getElementById(divname).innerHTML = 'Wird geladen ...';
	new Ajax.Updater(divname, page, {onComplete:function()
		{ 
		new Effect.SlideDown(divname, {duration:2});},asynchronous:true, evalScripts:true}
	);
	ref		=	'decref' + art;
	document.getElementById(ref).style.display = 'none';
	ref		=	'decrefd' + art;
	document.getElementById(ref).style.display = 'block';
}

function psdcorg (art)
{
	ref		=	'decref' + art;
	document.getElementById(ref).style.display = 'block';
	ref		=	'decrefd' + art;
	document.getElementById(ref).style.display = 'none';
}

// ------------------------------------------------------------------- Staudenplaner
function chk_licht_false(idjoin){			// deselect 'alle' on select 'e2p' or set 'alle' true if no e2p selected
	flag_desel	=	false;
	for (var i = 0; i < js_arr_lichtanspr.length; i++){
		if (document.psstplan.elements['e2p[' + js_arr_lichtanspr[i] + ']'].checked	== true){
			flag_desel	= true;
			if (idjoin>0){		// set detasea synchron
				document.psdetsea.elements['e2[' + js_arr_lichtanspr[i] + ']'].checked	= true;
			}
		} else {
			if (idjoin>0){		// set detasea synchron
				document.psdetsea.elements['e2[' + js_arr_lichtanspr[i] + ']'].checked	= false;
			}
		}
	}	
	if (flag_desel == true){
		document.psstplan.spplan_licht.checked	= false;
		if (idjoin>0){			// synchon detsea
			document.psdetsea.elements['e2detail[' + idjoin + ']'].checked	= false;
		}
	} else {
		document.psstplan.spplan_licht.checked	= true;
		if (idjoin>0){			// synchon detsea
			document.psdetsea.elements['e2detail[' + idjoin + ']'].checked	= true;
		}
	}
}

function chk_licht_true(idjoin){			// deselect e2p on select 'alle'
	for (var i = 0; i < js_arr_lichtanspr.length; i++){
		document.psstplan.elements['e2p[' + js_arr_lichtanspr[i] + ']'].checked	= false;
		if (idjoin>0){
			document.psdetsea.elements['e2[' + js_arr_e2detail[idjoin][i] + ']'].checked	= false;
		}
	}
	if (idjoin>0){				// set alle in detsea
		document.psdetsea.elements['e2detail[' + idjoin + ']'].checked	= true;
	}
}

function chk_bluef_false(idjoin){			// deselect 'alle' on select 'e2p' or set 'alle' true if no e2p selected
	flag_desel	=	false;
	for (var i = 0; i < js_arr_bluef.length; i++){
		if (document.psstplan.elements['e2p[' + js_arr_bluef[i] + ']'].checked	== true){
			flag_desel	= true;
			if (idjoin>0){		// set detasea synchron
				document.psdetsea.elements['e2[' + js_arr_bluef[i] + ']'].checked	= true;
			}
		} else {
			if (idjoin>0){		// set detasea synchron
				document.psdetsea.elements['e2[' + js_arr_bluef[i] + ']'].checked	= false;
			}
		}
	}	
	if (flag_desel == true){
		document.psstplan.spplan_bluete.checked	= false;
		if (idjoin>0){			// synchon detsea
			document.psdetsea.elements['e2detail[' + idjoin + ']'].checked	= false;
		}
	} else {
		document.psstplan.spplan_bluete.checked	= true;
		if (idjoin>0){			// synchon detsea
			document.psdetsea.elements['e2detail[' + idjoin + ']'].checked	= true;
		}
	}
}
function chk_bluef_true(idjoin){			// deselect e2p on select 'alle'
	for (var i = 0; i < js_arr_bluef.length; i++){
		document.psstplan.elements['e2p[' + js_arr_bluef[i] + ']'].checked	= false;
		if (idjoin>0){
			document.psdetsea.elements['e2[' + js_arr_e2detail[idjoin][i] + ']'].checked	= false;
		}
	}
	if (idjoin>0){				// set alle in detsea
		document.psdetsea.elements['e2detail[' + idjoin + ']'].checked	= true;
	}
}
// switch alle on click on span
function psst_chkswitch(chkid,idjoin){
	if (document.psstplan.elements[chkid].checked == true){
		document.psstplan.elements[chkid].checked	= false;
		if (idjoin>0){
			document.psdetsea.elements['e2detail[' + idjoin + ']'].checked	= false;
		}
	} else {
		document.psstplan.elements[chkid].checked	= true;
		if (idjoin>0){
			document.psdetsea.elements['e2detail[' + idjoin + ']'].checked	= true;
		}
	}
}
// ------------------------------------------------------------------- Detailsearch
function chk_e2detail_deselect_all(){			// deselect all and set all on 'alle'
	for (var i = 0; i < js_arr_e2katnum.length; i++){
		chk_e2detail_true(js_arr_e2katnum[i]);													// delselect by funktion
		document.psdetsea.elements['e2detail[' + js_arr_e2katnum[i] + ']'].checked	= true;		// select alle by kat id
	}
	for (var i = 0; i < js_arr_e2katnum_pd.length; i++){
		document.psdetsea.elements[js_arr_e2katnum_pd[i]].selectedIndex	= 0;				// select alle by kat id
	}
	for (var i = 0; i < js_arr_e2katnum.length; i++){
		document.psdetsea.elements['e2andor9[' + js_arr_e2katnum[i] + ']'].checked	= true;		// select alle by kat id
		document.psdetsea.elements['e2andor8[' + js_arr_e2katnum[i] + ']'].checked	= false;		// select alle by kat id
	}
	document.psstplan.spplan_licht.checked			= true;
	document.psstplan.spplan_bluete.checked			= true;
	document.psstplan.spplan_hoehe.selectedIndex	= 5000;
}

// ------------------
function chk_e2detail_false(kat,idjoin){			// deselect 'alle' on select 'e2' or set 'alle' true if no e2 selected
	flag_desel	=	false;
	for (var i = 0; i < js_arr_e2detail[kat].length; i++){
		if (document.psdetsea.elements['e2[' + js_arr_e2detail[kat][i] + ']'].checked	== true){
			flag_desel	= true;
			if (idjoin!=''){		// set detasea synchron
				document.psstplan.elements['e2p[' + js_arr_e2detail[kat][i] + ']'].checked	= true;
			} 
		}	else {
			if (idjoin!=''){		// set detasea synchron
				document.psstplan.elements['e2p[' + js_arr_e2detail[kat][i] + ']'].checked	= false;
			}
		}
	}	
	if (flag_desel == true){
		document.psdetsea.elements['e2detail[' + kat + ']'].checked	= false;
		if (idjoin!=''){
			document.psstplan.elements[idjoin].checked	= false;
		}
	} else {
		document.psdetsea.elements['e2detail[' + kat + ']'].checked	= true;
		if (idjoin!=''){
			document.psstplan.elements[idjoin].checked	= true;
		}
	}
}
function chk_e2detail_true(kat,idjoin){			// deselect e2 on select 'alle'
	for (var i = 0; i < js_arr_e2detail[kat].length; i++){
		document.psdetsea.elements['e2[' + js_arr_e2detail[kat][i] + ']'].checked	= false;
		if (idjoin>0){
			document.psstplan.elements['e2p[' + js_arr_e2detail[kat][i] + ']'].checked	= false;
		}
	}
}
// detsea | fuer span alle
function ds_swd(chkid,idjoin){
	if (document.psdetsea.elements['e2detail[' + chkid + ']'].checked == true){
		document.psdetsea.elements['e2detail[' + chkid + ']'].checked	= false;
		if (idjoin!=''){
			document.psstplan.elements[idjoin].checked	= false;
		}
	} else {
		document.psdetsea.elements['e2detail[' + chkid + ']'].checked	= true;
		if (idjoin!=''){
			document.psstplan.elements[idjoin].checked	= true;
		}
	}
}
// detsea | fuer span 
function ds_sw(chkid,idjoin){
	if (document.psdetsea.elements['e2[' + chkid + ']'].checked == true){
		document.psdetsea.elements['e2[' + chkid + ']'].checked	= false;
		if (idjoin!=''){
			document.psstplan.elements[idjoin].checked	= false;
		}
	} else {
		document.psdetsea.elements['e2[' + chkid + ']'].checked	= true;
		if (idjoin!=''){
			document.psstplan.elements[idjoin].checked	= true;
		}
	}
}

// x switchcontent scripa - depend on: <input type="hidden" id="<divname>stat<n>" value="0" />
function ps_x_down(divname,n,s)
{
	for (var i = 1; i <= s; i++){
		aktdiv	=	divname + i;
		if (i == n){
			if (document.getElementById(divname + 'stat' + i).value == 0){
				document.getElementById(divname + 'stat' + i).value	= 1;
			} else {
				document.getElementById(divname + 'stat' + i).value	= 0;
			} 
			Effect.toggle(aktdiv,'slide',{duration:2});
		} else {  // others div up
			if (document.getElementById(divname + 'stat' + i).value	== 1){
				document.getElementById(divname + 'stat' + i).value	= 0;
				Effect.toggle(aktdiv,'slide',{duration:1});
			} 
		}
	}
}

function cps_onoff(div,display){
	document.getElementById(div).style.display = display;
}


function cps_load_pop(url,name,w,h){
	window.open(url, name, 'width='+w+',height='+h+',scrollbars=1,toolbar=0,location=0');
}
// ------------------------------------------------------------cps---
function addbookmark(js_bookmarkurl,js_bookmarktitle,js_bookmarktxt)
{
    if ((navigator.appName == "Microsoft Internet Explorer") && 
          (parseInt(navigator.appVersion) >= 4))
    {
        window.external.AddFavorite(js_bookmarkurl,js_bookmarktitle)
    }
    else
    {
        if(navigator.appName == "Netscape")
        {
           js_bookmarktxt += " mit den Tasten STRG+D.";
        }
        js_bookmarktxt += " zu den Favoriten hinzufügen";
        alert(js_bookmarktxt);
    }
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenuGo(objId,targ,restore){ //v9.0
  var selObj = null;  with (document) { 
  if (getElementById) selObj = getElementById(objId);
  if (selObj) eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0; }
}
// -------------------------------------------------------------------
// Switch Content Script- By Dynamic Drive, available at: http://www.dynamicdrive.com
// Created: Jan 5th, 2007 - http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm
// Last updated: Jan 25th, 2007. Fixed defaultExpanded() feature not working when persistence is enabled (applicable only for 1st page load)
// -------------------------------------------------------------------

function switchcontent(className){
this.className=className
this.collapsePrev=false //Default: Collapse previous content each time
this.enablePersist=false //Default: Disable session only persistence
//Limit type of element to scan for on page for switch contents if 2nd function parameter is defined, for efficiency sake (ie: "div")
this.filter_content_tag=(arguments.length==2)? arguments[1].toLowerCase() : ""
}

switchcontent.prototype.setStatus=function(openHTML, closeHTML){ //PUBLIC: Set open/ closing HTML indicator. Optional
this.statusOpen=openHTML
this.statusClosed=closeHTML
}

switchcontent.prototype.setColor=function(openColor, closeColor){ //PUBLIC: Set open/ closing color of switch header. Optional
this.colorOpen=openColor
this.colorClosed=closeColor
}

switchcontent.prototype.setPersist=function(bool){ //PUBLIC: Enable/ disable persistence. Default is true.
this.enablePersist=bool
}

switchcontent.prototype.collapsePrevious=function(bool){ //PUBLIC: Enable/ disable collapse previous content. Default is false.
this.collapsePrev=bool
}


switchcontent.prototype.sweepToggle=function(setting){ //PUBLIC: Expand/ contract all contents method. (Values: "contract"|"expand")
if (typeof this.headers!="undefined" && this.headers.length>0){ //if there are switch contents defined on the page
for (var i=0; i<this.headers.length; i++){
if (setting=="expand")
this.expandcontent(this.headers[i]) //expand each content
else if (setting=="contract")
this.contractcontent(this.headers[i]) //contract each content
}
}
}


// -------------------------------------------------------------------
// PUBLIC: defaultExpanded(indices_of_contents)- Set contents that should be expanded by default when the page loads.
// Note that the persistence feature (if enabled) overrides this setting.
// Pass in the position of the contents relative to the rest of the contents ie: defaultExpanded(0,2,3) would expand the 1st, 3rd, and 4th contents by default
// -------------------------------------------------------------------

switchcontent.prototype.defaultExpanded=function(){
var expandedindices=[] //Array to hold indices (position) of content to be expanded by default
//Loop through function arguments, and store each one within array
//Two test conditions: 1) End of Arguments array, or 2) If "collapsePrev" is enabled, only the first entered index (as only 1 content can be expanded at any time)
for (var i=0; (!this.collapsePrev && i<arguments.length) || (this.collapsePrev && i==0); i++)
expandedindices[expandedindices.length]=arguments[i]
this.expandedindices=expandedindices.join(",") //convert array into a string of the format: "0,2,3" for later parsing by script
}


//PRIVATE: Sets color of switch header.

switchcontent.prototype.togglecolor=function(header, status){
if (typeof this.colorOpen!="undefined")
header.style.color=status
}


//PRIVATE: Sets status indicator HTML of switch header.

switchcontent.prototype.togglestatus=function(header, status){
if (typeof this.statusOpen!="undefined")
header.firstChild.innerHTML=status
}


//PRIVATE: Contracts a content based on its corresponding header entered

switchcontent.prototype.contractcontent=function(header){
var innercontent=document.getElementById(header.id.replace("-title", "")) //Reference content for this header
innercontent.style.display="none"
this.togglestatus(header, this.statusClosed)
this.togglecolor(header, this.colorClosed)
}


//PRIVATE: Expands a content based on its corresponding header entered

switchcontent.prototype.expandcontent=function(header){
var innercontent=document.getElementById(header.id.replace("-title", ""))
innercontent.style.display="block"
this.togglestatus(header, this.statusOpen)
this.togglecolor(header, this.colorOpen)
}

// -------------------------------------------------------------------
// PRIVATE: toggledisplay(header)- Toggles between a content being expanded or contracted
// If "Collapse Previous" is enabled, contracts previous open content before expanding current
// -------------------------------------------------------------------

switchcontent.prototype.toggledisplay=function(header){
var innercontent=document.getElementById(header.id.replace("-title", "")) //Reference content for this header
if (innercontent.style.display=="block")
this.contractcontent(header)
else{
this.expandcontent(header)
if (this.collapsePrev && typeof this.prevHeader!="undefined" && this.prevHeader.id!=header.id) // If "Collapse Previous" is enabled and there's a previous open content
this.contractcontent(this.prevHeader) //Contract that content first
}
if (this.collapsePrev)
this.prevHeader=header //Set current expanded content as the next "Previous Content"
}


// -------------------------------------------------------------------
// PRIVATE: collectElementbyClass()- Searches and stores all switch contents (based on shared class name) and their headers in two arrays
// Each content should carry an unique ID, and for its header, an ID equal to "CONTENTID-TITLE"
// -------------------------------------------------------------------

switchcontent.prototype.collectElementbyClass=function(classname){ //Returns an array containing DIVs with specified classname
var classnameRE=new RegExp("(^|\\s+)"+classname+"($|\\s+)", "i") //regular expression to screen for classname within element
this.headers=[], this.innercontents=[]
if (this.filter_content_tag!="") //If user defined limit type of element to scan for to a certain element (ie: "div" only)
var allelements=document.getElementsByTagName(this.filter_content_tag)
else //else, scan all elements on the page!
var allelements=document.all? document.all : document.getElementsByTagName("*")
for (var i=0; i<allelements.length; i++){
if (typeof allelements[i].className=="string" && allelements[i].className.search(classnameRE)!=-1){
if (document.getElementById(allelements[i].id+"-title")!=null){ //if header exists for this inner content
this.headers[this.headers.length]=document.getElementById(allelements[i].id+"-title") //store reference to header intended for this inner content
this.innercontents[this.innercontents.length]=allelements[i] //store reference to this inner content
}
}
}
}


//PRIVATE: init()- Initializes Switch Content function (collapse contents by default unless exception is found)

switchcontent.prototype.init=function(){
var instanceOf=this
this.collectElementbyClass(this.className) //Get all headers and its corresponding content based on shared class name of contents
if (this.headers.length==0)
return //If no headers are present (no contents to switch), just exit
// Get ids of open contents below. Three possible scenerios:
// 1) Persistence is enabled AND corresponding cookie contains a non blank ("") string, indicating this isn't the first page load
// 2) Or, check to see if there are contents that should be enabled by default (even if persistence is enabled and this IS the first page load)
// 3) Or, default to no contents should be expanded on page load ("" value)
var opencontents_ids=(this.enablePersist && switchcontent.getCookie(this.className)!="")? ','+switchcontent.getCookie(this.className)+',' : (this.expandedindices)? ','+this.expandedindices+',' : ""
for (var i=0; i<this.headers.length; i++){ //BEGIN FOR LOOP (1)
if (typeof this.statusOpen!="undefined") //If open/ closing HTML indicator is enabled/ set
this.headers[i].innerHTML='<span class="status"></span>'+this.headers[i].innerHTML //Add a span element to original HTML to store indicator
if (opencontents_ids.indexOf(','+i+',')!=-1){ //(2) if index "i" exists within cookie string or default-enabled string (i=position of the content to expand)
this.expandcontent(this.headers[i]) //Expand each content per stored indices (if ""Collapse Previous" is set, only one content)
if (this.collapsePrev) //If "Collapse Previous" set
this.prevHeader=this.headers[i]  //Indicate the expanded content's corresponding header as the last clicked on header (for logic purpose)
}
else //else if no indices found in stored string
this.contractcontent(this.headers[i]) //Contract each content by default
this.headers[i].onclick=function(){instanceOf.toggledisplay(this)}
}
if (this.enablePersist)
switchcontent.dotask(window, function(){instanceOf.rememberpluscleanup()}, "unload") //Call persistence method onunload
}


// -------------------------------------------------------------------
// PRIVATE: rememberpluscleanup()- Stores the indices of content that are expanded inside session only cookie
// If "Collapse Previous" is enabled, only 1st expanded content index is stored
// -------------------------------------------------------------------

switchcontent.prototype.rememberpluscleanup=function(){ //store index of opened ULs relative to other ULs in Tree into cookie
// Define array to hold ids of open content that should be persisted
// Default to just "none" to account for the case where no contents are open when user leaves the page (and persist that):
var opencontents=new Array("none")
for (var i=0; i<this.innercontents.length; i++){
//If persistence enabled, content in question is expanded, and either "Collapse Previous" is disabled, or if enabled, this is the first expanded content
if (this.enablePersist && this.innercontents[i].style.display=="block" && (!this.collapsePrev || (this.collapsePrev && opencontents.length<2)))
opencontents[opencontents.length]=i //save the index of the opened UL (relative to the entire list of ULs) as an array element
this.headers[i].onclick=null //Cleanup code
}
if (opencontents.length>1) //If there exists open content to be persisted
opencontents.shift() //Boot the "none" value from the array, so all it contains are the ids of the open contents
if (typeof this.statusOpen!="undefined") //Cleanup code
this.statusOpen=this.statusClosed=null //Cleanup code
switchcontent.setCookie(this.className, opencontents.join(",")) //populate cookie with indices of open contents: classname=1,2,3,etc
}


// -------------------------------------------------------------------
// A few utility functions below:
// -------------------------------------------------------------------


switchcontent.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
}

switchcontent.getCookie=function(Name){ 
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return ""
}

switchcontent.setCookie=function(name, value){
document.cookie = name+"="+value
}




/***********************************************
* Ultimate Fade-In Slideshow (v1.5): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use - http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
var fadebgcolor="#E8FFE8"

////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" alt="'+this.theimages[picindex][2]+'" title="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" style="border-color:#D9FFD9" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=obj.degree/100
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}

