slideClass = function ( naam ) {

			var css;
			var width;
			var height;
			var maxWidth;
			var maxHeight;
			var minWidth;
			var minHeight;
			var data;
			var transition; // if transition == "fade" then id2 is required
			var thumb;
			var timer;
			var id;
			var id2;
			var obj;
			var timer;
			var slide; 
			var current;
			var next;
			var len;
			var opacity;
			var point;
			var des;
			var interval;
			
			this.point = 0;
			this.opacity = 0;
			this.obj = naam.obj;
			// this.id = naam.id;
			// this.id2 = naam.id2;
			this.id = this.obj+'1';
			this.id2 = this.obj+'2';
			this.len = 0;
			this.current = 0;
			this.timer = 5000;
			this.speed = 10;
		
/*****************************************************************************************
******************************************************************************************
     set the variables
******************************************************************************************
*****************************************************************************************/

			if ( naam.des ) {
				 this.des = naam.des;
			}

			if ( naam.css ) {
				 this.css = naam.css;
			}
			
			if ( naam.slide == 0 ) {
				 this.slide = 0;
			} else {
				 this.slide = 1;
			}

			if ( isInt(naam.timer) ) {
				 this.timer = naam.timer;
			}

			if ( isInt(naam.speed) ) {
			   this.speed = naam.speed;
			} 


			if ( isInt(naam.width) ) {
			   this.width = naam.width;
			} else {
				 this.width = '';
			}

			if ( isInt(naam.height) ) {
			   this.height = naam.height;
			} else {
				 this.height = '';
			}

			if ( isInt(naam.minWidth) ) {
			   this.minWidth = naam.minWidth;
			} else {
				 this.minWidth = '';
			}

			if ( isInt(naam.minHeight) ) {
			   this.minHeight = naam.minHeight;
			} else {
				 this.minHeight = '';
			}

			if ( isInt(naam.maxWidth) ) {
			   this.maxWidth = naam.maxWidth;
			} else {
				 this.maxWidth = '';
			}

			if ( isInt(naam.maxHeight) ) {
			   this.maxHeight = naam.maxHeight;
			} else {
				 this.maxHeight = '';
			}

			switch ( naam.thumb ) {
				 case 'true':
				 			this.thumb = 1;
							break;
				 default:
				 			this.thumb = 0;
							break;
			}

			switch ( naam.transition ) {
				 case 'slide':
				 			this.transition = 1;
							break;
				 case 'fade':
				 			this.transition = 2;
							break;
				 default: // none
				 			this.transition = 0;
							break;
			} // end switch

/*****************************************************************************************
******************************************************************************************
      function insert
							 this function is when we call in the main images
							 -> each group would have the following:
							 		img - the url of the image
									description - not required
									thumb - the url of the thumbnail
******************************************************************************************
*****************************************************************************************/

     this.insert = function ( dat ) {
		 		 this.data = dat;
		 }

/*****************************************************************************************
******************************************************************************************
      function getDimensions
							 this function is to find the largest width/height of all the images
							 -> must run this.insert prior to running getDimensions
******************************************************************************************
*****************************************************************************************/

	  this.getDimensions = function ( ) {
					var checkImg = new Image();
					var maxWidth = 0;
					var maxHeight = 0;
					var bool = false;
					for ( var i = 0 ; i < this.data.length ; i++ ) {

							checkImg.src = this.data[i].img;
							if ( checkImg.complete ) {
								 bool = true;
							}
							if ( maxWidth < checkImg.width ) {
								 maxWidth = checkImg.width;
							}
							if ( maxHeight < checkImg.height ) {
								 maxHeight = checkImg.height;
							}
					}
					
					return new Array(maxWidth , maxHeight);

		}
		
/*****************************************************************************************
******************************************************************************************
      function setDimensions
							 this function is to set the width/height of the images
******************************************************************************************
*****************************************************************************************/
	  this.setDimensions = function ( array ) {
				if ( array == 1 ) {
					  array = this.getDimensions(); 
				}
				// alert(array);
				this.maxWidth	= array[0];
    		this.maxHeight = array[1];
		}

/*****************************************************************************************
*****************************************************************************************/

/*****************************************************************************************
******************************************************************************************

******************************************************************************************
*****************************************************************************************/
     this.writeDiv = function() {
					document.getElementById(this.obj).style.width = this.maxWidth+'px';
			  	document.getElementById(this.obj).style.height = this.maxHeight+'px';
					document.getElementById(this.obj).style.display = 'block';

					var i1 = new Image();
					var i2 = new Image();
					var len = this.data.length;
					i1.src = this.data[this.current].img;
					var n = this.current-1;
					if ( n < 0 ) {
						 n = len-1; 
					}
					i2.src = this.data[n].img;

		 			var str = '';
					if ( this.transition == 2 ) {
  					str += '<div style="position: absolute; ">';
  							str += '<img src="'+i1.src+'" id="'+this.id+'"  style="opacity: 0;position: absolute; top: 0; left: 0;" alt="";> ';
  							str += '<img src="'+i2.src+'" id="'+this.id2+'" style="position: absolute; top: 0; left: 0;" alt=""> ';
  					str += '</div>';
					} else {
  					str += '<img src="'+i1.src+'" id="'+this.id+'"  alt="";> ';
					}
					// alert(str);
					// str += '<div style="clear: both;"> </div>';
					// alert(this.maxWidth+ ' ' + this.maxHeight);
					var o = document.getElementById(this.obj);
					if ( o ) {
						 document.getElementById(this.obj).innerHTML = str;
					} else if ( this.debug == true ) {
						 alert(this.obj + ' element does not exist');
					} else {
						 
					}
		 }

/*****************************************************************************************
******************************************************************************************
      function show
******************************************************************************************
*****************************************************************************************/
		 this.show = function ( ) {
/**/
		 			this.len = this.data.length;
		 			if ( typeof this.current == 'undefined' ) {
						 this.current = 0;
					} else {
						 if ( parseInt(this.current) > this.len ) {
						 		this.current = 0;
						 }					
					}
					this.next = parseInt(this.current) + 1;
					if ( this.next > this.len ) {
						 this.next = 0;
					}
					// alert(this.current + ' and ' +this.next + ' in length ' + this.len);
		 			this.writeDiv ();
					// alert('in here');


					_self = this;
							/**/
							_self.opacity = 0;
							if ( _self.transition == 1 ) {
								  this.interval = window.setInterval(
									function() {
									},
									_self.timer // time 
									)
							}
							else if ( _self.transition == 2 ) {
    							this.interval = window.setInterval(
    							function(){
										// if we are going through a transition phase
										if ( _self.transition == 2 ) {
    										var fadeInInterval = this.interval = window.setInterval(
    													 function () {
															 			// alert(this.timer);
																		if ( ( _self.point % 2 ) == 0 ) { 
                                  			var obje = document.getElementById(_self.id);
                                  			var objf = document.getElementById(_self.id2);
																		} else {
                                  			var obje = document.getElementById(_self.id2);
                                  			var objf = document.getElementById(_self.id);
																		}
																		if ( ( !obje ) || ( !objf ) ) {
																			 return;
																		} 
                                    obje.style.filter = "alpha(opacity:"+_self.opacity+")";    // IE/Win
                                    obje.style.KHTMLOpacity = _self.opacity/100;							 // Safari<1.2, Konqueror
                                    obje.style.MozOpacity   = _self.opacity/100;							 // Older Mozilla and Firefox
                                    obje.style.opacity      = _self.opacity/100; 							 // Safari 1.2, newer Firefox and Mozilla, CSS3

																		var negOpacity = 100 - _self.opacity;
                                    objf.style.filter = "alpha(opacity:"+negOpacity+")";       // IE/Win
                                    objf.style.KHTMLOpacity = negOpacity/100;							     // Safari<1.2, Konqueror
                                    objf.style.MozOpacity   = negOpacity/100;							     // Older Mozilla and Firefox
                                    objf.style.opacity      = negOpacity/100; 							   // Safari 1.2, newer Firefox and Mozilla, CSS3

                                    _self.opacity += _self.speed;

																		if ( _self.opacity > 100 ) {
																			 if ( this.des == true ) {
																			 		var o = document.getElementById(_self.des);
																					if ( o ) {
																			 		document.getElementById(_self.des).innerHTML = _self.data[_self.current].des;
																					} else if ( this.debug == true ) {
																						alert('could not find document element - killing the setInterval');
																						this.killInterval();
																					} else {
																						this.killInterval();
																					}
																			 }
																			 bool = true;
																			 objf.src = _self.data[_self.next].img;																			 
																			 window.clearInterval(fadeInInterval);
                        							 _self.current++;
                    									 _self.next++;
                        							 if ( _self.current >= _self.len ) {
                        									 _self.current = 0;
                        							 } // end if _self.current
                    									 if ( _self.next >= _self.len ) {
                    											 _self.next = 0;
                    									 } // end if self.next
  																		 _self.opacity = 0;
																			 _self.point++;
																		} // end self.opacity > 100
															 } // end function()
    												,150); // end fadeInInterval
														// alert(fadeInInterval);

										}	
    						  }
    							, _self.timer);
							} // end if self.slide
							/**/
							else {
									window.setInterval(
    							function(){
										var o = document.getElementById(_self.id);
										if ( o ) {
										 		document.getElementById(_self.id).src = _self.data[_self.current].img;
										} else if ( this.debug == true ) {
										  	alert('could not find document element - killing the process');
												this.killInterval();
										} else {
												this.killInterval();
										}
										if ( document.getElementById(_self.des) ) {
											 document.getElementById(_self.des).innerHTML = _self.data[_self.current].des;
										}
          					_self.current++;
      							_self.next++;
          					if ( _self.current >= _self.len ) {
          						 _self.current = 0;
          					}
      							if ( _self.next >= _self.len ) {
      								 _self.next = 0;
      							}
									},_self.timer);
							}

		 }
		 
		 this.output = function (i) {
		 			alert(this.data[i].des);
/**/
		 }

/*****************************************************************************************
******************************************************************************************
      function showThumb
******************************************************************************************
*****************************************************************************************/
 		 this.showThumb = function ( ) {
		 
		 }


/*****************************************************************************************
******************************************************************************************
      function killInterval
******************************************************************************************
*****************************************************************************************/
		 this.killInterval = function ( ) {
		 			// alert('going to clear ' + this.interval + ' interval ');
		 			clearInterval(this.interval);
		 }

/*****************************************************************************************
******************************************************************************************
      function changeSpeed
******************************************************************************************
*****************************************************************************************/
		 this.changeSpeed = function ( i , upDown ) {
		 			switch ( upDown ) {
							case '+':
								i = parseInt(this.timer) + parseInt(i);
								break;
							case '-':
								i = this.timer - i;
								break;
					}
					if ( i > 5000 ) {} else {
						 i = 5000;
					}
		 			this.timer = i;
					this.killInterval();
					this.show();
		 }

/*****************************************************************************************
******************************************************************************************
      function changePos
******************************************************************************************
*****************************************************************************************/
		 this.changePos = function ( dir ) {
		 			this.killInterval();
		 			switch ( dir ) {
								 case 1:
								 			this.current++;
											break;
								 case 2:
								 			this.current--;
											break;
					} // end switch
					if ( ( this.current > this.len ) ) {
						 this.current = 0;
					}
					if ( this.current < 0 ) {
						 this.current = this.len - 1;
					}
					this.show();
		 } // end this.changePos()
		 
}

 function isInt(x) {
   var y=parseInt(x);
   if (isNaN(y)) return false;
   return x==y && x.toString()==y.toString();
 } 

