////////////////////////////////////////////////////////////////////////////////
//
//  LASAGNA
//  Copyright 2009-2011 lasagna
//  http://www.idmgh.com
//  All Rights Reserved.
//
//  NOTICE: lasagna permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

/*package com.lasagna.iComp*/

var com;
if(!com) com = {};
if(!com.lasagna) com.lasagna = {};
if(!com.lasagna.iComp) com.lasagna.iComp = {}; 

com.lasagna.iComp.Image = function(){
	

	this.borderColors    = false;
	this.out             = "#FF3300";
	this.backgroundOut   = "#FF3300";
	this.over            = "#FFFFFF";
	this.backgroundOver  = "#FFFFFF";
	this.displayParent   = true;
	this.lastIndex       = false;
	this.thumbs          = [];
	this.source          = [];
	this.useLocation     = false;
	this.useNumbers      = false;
	this.jQuery          = false;
	this.jQueryID        = [];
	this.instance        = [];
	this.jQueryEvent     = function(){};
	this.ParentLength    = [];
	this.length          = [];
	this.limit           = 0;
	this.offset          = 0;
	this.links           = [];
	this.offsetContainer = 0;
	this.count           = 0;	
	this.container       = [];
	this.queue           = [];
	this.children        = [];
	this.useRandomImages = false;
	this.rail            = false;
	this.thumbsPath      = "";
	this.floatWidth      = 0;
	this.isHidden        = false;
	this.isThumbs        = true;
	this.useThumbs       = true;
	this.saveChildren    = [];
	this.parentPath      = "";
	this.presentColor    = "";
	this.update          = function(){};
	this.enableLocation  = function(){};

	  
   this.sameColors = function(){

	this.backgroundOut = this.out;
   this.backgroundOver = this.over;
	   
	   };
	   
	 this.switchColors = function(){

	this.backgroundOut  = this.over;
   this.backgroundOver  = this.out;
	   
	   };
	
	//styles
	this.Width       = 350;
	this.Height      = 350;
    this.ThumbWidth  = 100;
	this.ThumbHeight = 100;
	this.Style       = "Image";
	this.ThumbStyle  = "ImageBox ImageRoundCorners";
	
	/* All colors */
    this.colors = ["#003300",
		                                "#006600",
		                                "#009900",
		                                "#00CC00",
		                                "#00FF00",
		                                "#330000",
		                                "#333300",
		                                "#336600",
		                                "#339900",
		                                "#33CC00",
		                                "#33FF00",
		                                "#660000",
		                                "#663300",
		                                "#666600",
		                                "#669900",
		                                "#66CC00",
		                                "#66FF00",
		                                "#333333",
		                                
		                                //SECOND LINE
		                                
		                                "#000033",
		                                "#003333",
		                                "#006633",
		                                "#009933",
		                                "#00CC33",
		                                "#00FF33",
		                                "#330033",
		                                "#333333",
		                                "#336633",
		                                "#339933",
		                                "#33CC33",
		                                "#33FF33",
		                                "#660033",
		                                "#663333",
		                                "#666633",
		                                "#669933",
		                                "#66CC33",
		                                "#66FF33",
		                                "#666666",
		                                
		                                //THIRD LINE
		                                
		                                "#000066",
		                                "#003366",
		                                "#006666",
		                                "#009966",
		                                "#00CC66",
		                                "#00FF66",
		                                "#330066",
		                                "#333366",
		                                "#336666",
		                                "#339966",
		                                "#33CC66",
		                                "#33FF66",
		                                "#660066",
		                                "#663366",
		                                "#666666",
		                                "#669966",
		                                "#66CC66",
		                                "#66FF66",
		                                "#999999",
		                                
		                                //FOURTH LINE
		                                
		                                "#000099",
		                                "#003399",
		                                "#006699",
		                                "#009999",
		                                "#00CC99",
		                                "#00FF99",
		                                "#330099",
		                                "#333399",
		                                "#336699",
		                                "#339999",
		                                "#33CC99",
		                                "#33FF99",
		                                "#660099",
		                                "#663399",
		                                "#666699",
		                                "#669999",
		                                "#66CC99",
		                                "#66FF99",
		                                "#CCCCCC",
		                                
		                                //FIFTH LINE
		                                
		                                "#0000CC",
		                                "#0033CC",
		                                "#0066CC",
		                                "#0099CC",
		                                "#00CCCC",
		                                "#00FFCC",
		                                "#3300CC",
		                                "#3333CC",
		                                "#3366CC",
		                                "#3399CC",
		                                "#33CCCC",
		                                "#33FFCC",
		                                "#6600CC",
		                                "#6633CC",
		                                "#6666CC",
		                                "#6699CC",
		                                "#66CCCC",
		                                "#66FFCC",
		                                "#FFFFFF",
		                                
		                                //SIXTH LINE
		                                
		                                "#0000FF",
		                                "#0033FF",
		                                "#0066FF",
		                                "#0099FF",
		                                "#00CCFF",
		                                "#00FFFF",
		                                "#3300FF",
		                                "#3333FF",
		                                "#3366FF",
		                                "#3399FF",
		                                "#33CCFF",
		                                "#33FFFF",
		                                "#6600FF",
		                                "#6633FF",
		                                "#6666FF",
		                                "#6699FF",
		                                "#66CCFF",
		                                "#66FFFF",
		                                "#FF0000",
		                                
		                                //SEVENTH LINE
		                                
		                                "#990000",
		                                "#993300",
		                                "#996600",
		                                "#999900",
		                                "#99CC00",
		                                "#99FF00",
		                                "#CC0000",
		                                "#CC3300",
		                                "#CC6600",
		                                "#CC9900",
		                                "#CCCC00",
		                                "#CCFF00",
		                                "#FF0000",
		                                "#FF3300",
		                                "#FF6600",
		                                "#FF9900",
		                                "#FFCC00",
		                                "#FFFF00",
		                                "#00FF00",
		                                
		                                //EIGHTH LINE
		                                
		                                "#990033",
		                                "#993333",
		                                "#996633",
		                                "#999933",
		                                "#99CC33",
		                                "#99FF33",
		                                "#CC0033",
		                                "#CC3333",
		                                "#CC6633",
		                                "#CC9933",
		                                "#CCCC33",
		                                "#CCFF33",
		                                "#FF0033",
		                                "#FF3333",
		                                "#FF6633",
		                                "#FF9933",
		                                "#FFCC33",
		                                "#FFFF33",
		                                "#0000FF",
		                                
		                                //NINTH LINE
		                                
		                                "#990066",
		                                "#993366",
		                                "#996666",
		                                "#999966",
		                                "#99CC66",
		                                "#99FF66",
		                                "#CC0099",
		                                "#CC3399",
		                                "#CC6699",
		                                "#CC9999",
		                                "#CCCC99",
		                                "#CCFF99",
		                                "#FF0099",
		                                "#FF3399",
		                                "#FF6699",
		                                "#FF9999",
		                                "#FFCC99",
		                                "#FFFF99",
		                                "#FFFF00",
		                               
		                                
		                                //TENTH LINE
		                                
		                                "#990099",
		                                "#993399",
		                                "#996699",
		                                "#999999",
		                                "#99CC99",
		                                "#99FF99",
		                                "#CC0099",
		                                "#CC3399",
		                                "#CC6699",
		                                "#CC9999",
		                                "#CCCC99",
		                                "#CCFF99",
		                                "#FF0099",
		                                "#FF3399",
		                                "#FF6699",
		                                "#FF9999",
		                                "#FFCC99",
		                                "#FFFF99",
		                                "#00FFFF",
		                                
		                                                   
		                                
		                                "#9900CC",
		                                "#9933CC",
		                                "#9966CC",
		                                "#9999CC",
		                                "#99CCCC",
		                                "#99FFCC",
		                                "#CC00CC",
		                                "#CC33CC",
		                                "#CC66CC",
		                                "#CC99CC",
		                                "#CCCCCC",
		                                "#CCFFCC",
		                                "#FF00CC",

		                                "#FF33CC",
		                                "#FF66CC",
		                                "#FF99CC",
		                                "#FFCCCC",
		                                "#FFFFCC",
		                                "#FF00FF",
		                                
		                                
		                                "#9900FF",
		                                "#9933FF",
		                                "#9966FF",
		                                "#9999FF",
		                                "#99CCFF",
		                                "#99FFFF",
		                                "#CC00FF",
		                                "#CC33FF",
		                                "#CC66FF",
		                                "#CC99FF",
		                                "#CCCCFF",
		                                "#CCFFFF",
		                                "#FF00FF",
		                                "#FF33FF",
		                                "#FF66FF",
		                                "#FF99FF",
		                                "#FFCCFF",
		                                "#FFFFFF"];
										
    };
  

com.lasagna.iComp.Image.prototype.add = function(imageC,thumbC,ImageEvent,completeEvent){
	
	this.sprite = function(e){
	
  return document.createElementNS ? document.createElementNS( 'http://www.w3.org/1999/xhtml', e) : document.createElement(e);

   };
 
   
   if(this.isThumbs){
	
	if(this.thumbs.length != this.source.length){
		
		alert("Thumbnail and main Image reference must much in length::IDM:Error:<->");
		return;
		
    };
	
   };
	
	if(this.borderColors){
		
    this.colorLength  = this.colors.length;
    this.colorCount   = 0;
	
	};
	
	    this.parentContainer                   = document.getElementById(imageC);
		this.parentContainer.className         = this.Style;
		this.parentContainer.style.borderColor = this.out;
		//this.parentContainer.id  = "com_lasagna_iComp_Images_parentContainer" + Math.floor(Math.random() * 5000);
		this.instance["container"] = this.parentContainer.id;
		this.jQueryID["container"] = "#"+this.parentContainer.id;
		
       if(this.useLocation){
		
	     this.parentAnchor              = this.sprite("a");
	     this.parentAnchor.id           = "coverBox" + Math.random() * 1000;
		 this.parentContainer.appendChild(this.parentAnchor);
		
		};
		
		if(this.rail == false){
		
		this.parentImage  = new Image();

		 if(this.isHidden){
		
		this.parentContainer.style.overflow = "hidden";	 
	//	this.parentContainer.className = "ImageBoxResize";	
		this.parentContainer.style.width  = this.Width + "px";
		this.parentContainer.style.height = this.Height + "px";	 
			 
		 }else{
			 
		// this.parentImage.width   = this.Width;
		 //this.parentImage.height  = this.Height;
				 
          };

		this.parentImage.id     = "com_lasagna_iComp_Images_parent" + Math.floor(Math.random() * 15000);
		this.instance["parent"] = this.parentImage.id;
		this.jQueryID["parent"] = "#"+this.parentImage.id;
	
	    this.parentContainer.appendChild(this.parentImage);
		
		if(this.displayParent){
		
		this.parentContainer.style.display = "block";
		
		}else{
			
		this.parentContainer.style.display = "none";
			
		 };
		
		};
	
	this.childContainer  = document.getElementById(thumbC);
	
	if(this.useThumbs == false){
		
		this.childContainer.style.display = "none";
		
	};
	
	for(var i = 0; i < this.thumbs.length; i++){
		
		if(this.rail == true){
			
			this.parentImage           =  new Image();
			this.parentImage.id        = "com_lasagna_iComp_Images_parent" + Math.floor(Math.random() * 15000);
			this.parentImage.className = "ImageParent";
			this.parentImage.links     = "";
		    this.instance["parent"]    = this.parentImage.id;
		    this.jQueryID["parent"]    = "#"+this.parentImage.id;
			this.ParentLength.push("#"+this.parentImage.id);
			this.parentContainer.appendChild(this.parentImage);
			
			if(this.links[i] == undefined){
				
				this.parentImage.links = "#";
				
				}else{
					
				this.parentImage.links = this.links[i];
					
				}
				
			this.parentImage.onclick = function(evnt){
				
				var e = evnt ? evnt : window.event;
	        var target = e.target ? evnt.target : e.srcElement;
				
				document.location = target.links
				
				}
			
			if(i == 0){
				
			this.floatWidth = 0;	
				
			}else if(i == this.thumbs.length - 1){
				
			this.floatWidth += (this.offset * 2) - this.offset;
				
			}else{
				
			this.floatWidth += this.offset;
			
			};
			
            this.offsetContainer += this.offset;
			this.parentContainer.style.width = this.offsetContainer + "px";
			
		
		 };
		
		this.imageBox             = this.sprite("div");
	    this.imageBox.className   = this.ThumbStyle;
		this.imageBox.id          = "com_lasagna_iComp_Images_ImageBox" + i + Math.floor(Math.random() * 30000);
        this.instance["box"]      = this.imageBox.id;
		this.jQueryID["box"]      = "#"+this.imageBox.id;
		
		this.length.push("#"+this.imageBox.id);
		this.queue.push(this.imageBox.id);
		
       if(this.borderColors){
		   
		this.colorCount++;
		  
		if(this.colorCount == this.colorLength){
			
			this.colorCount = 0;
			
		};   
		
		this.presentColor	            = this.colors[Math.floor(Math.random() * this.colors.length)];
		this.imageBox.style.borderColor = this.presentColor;
		
		}else{
			
		this.imageBox.style.borderColor = this.out;
			
		};
		
		if(this.limit === 0){
		
		this.childContainer.appendChild(this.imageBox);
		
		}else{
			
		    if(i < this.limit){
				
				this.childContainer.appendChild(this.imageBox);
				
				}else{
					
				this.saveChildren.push(this.imageBox);	
	
				 }; 
               };
			   
		if(this.isThumbs){
			   
	    this.thumbsObj            = new Image();
	    this.thumbsObj.src        = this.thumbsPath + this.thumbs[i];
		this.thumbsObj.source     = this.source[i];
		this.thumbsObj.className  = "ImageRoundCorners";
		
		}else{
		
		this.thumbsObj  = this.sprite("div");
		
		 if(this.borderColors){
			 
		this.thumbsObj.style.background = this.presentColor;
		this.out = this.presentColor;
		
		 }else{
			 
        this.thumbsObj.style.background = this.backgroundOut;	
		
		 }
		
		this.thumbsObj.source     = this.source[i];
		this.thumbsObj.isThumbs   = this.isThumbs;
		
		if(this.useNumbers){
			
			if(i == 0){
			
			this.thumbsObj.innerHTML = "H.";	
				
				}else{
			
			this.thumbsObj.innerHTML = i + ".";		
			
			}
			
			
			this.thumbsObj.className  = "ImageNumbers ImageRoundCorners";
			
			};
		
		};
		
		if(this.isHidden){
		
		this.imageBox.style.overflow = "hidden";
		this.imageBox.style.width    = this.ThumbWidth + "px";
		this.imageBox.style.height   = this.ThumbHeight + "px";
		
		}else{
		
		this.thumbsObj.style.width  = this.ThumbWidth + "px";
		this.thumbsObj.style.height = this.ThumbHeight + "px";	
		
        };
		
		this.thumbsObj.id        = "com_lasagna_iComp_Images_thumbsObj" + i + Math.floor(Math.random() * 38000);
        this.instance["thumb"+i] = this.thumbsObj.id;
		this.jQueryID["thumb"+i] = "#"+this.thumbsObj.id;
		this.thumbsObj.count     = i;
		this.children.push(this.thumbsObj.id);
		
		if(this.useRandomImages){
			
		this.randomNum       = Math.floor(Math.random() * this.source.length);
		this.parentImage.src = this.parentPath + this.source[this.randomNum];
			
		}else{
			
			if(this.rail){
             
			this.parentImage.src = this.parentPath + this.source[i];
			
			   if(this.lastIndex == false){
			
			      if(i == (this.thumbs.length - 1)){
			
			this.parentImage           =  new Image();
			this.parentImage.id        = "com_lasagna_iComp_Images_parent" + Math.floor(Math.random() * 15000);
			this.parentImage.className = "ImageParent";
		    this.instance["parent"]    = this.parentImage.id;
		    this.jQueryID["parent"]    = "#"+this.parentImage.id;
			this.ParentLength.push("#"+this.parentImage.id);
			this.parentContainer.appendChild(this.parentImage);
			this.offsetContainer += this.offset;
			this.parentContainer.style.width = this.offsetContainer + "px";
			this.parentImage.src = this.parentPath + this.source[0];
			
			    };
			  };
		   
			}else{
				
		this.parentImage.src = this.parentPath + this.source[0];
		
			};
         };
		
		this.thumbsObj.parentContainer = this.parentContainer.id;
		this.thumbsObj.parent          = this.parentImage.id;
		this.thumbsObj.parentPath      = this.parentPath;
	    this.thumbsObj.railID          = this.floatWidth;
		this.thumbsObj.queue           = this.queue;
		this.thumbsObj.selected        = false;
		this.thumbsObj.borderReference = this.imageBox.id; 
        this.thumbsObj.borderColor     = this.imageBox.style.borderColor;
		this.thumbsObj.borderColors    = this.borderColors; 
		this.thumbsObj.over            = this.over;
		this.thumbsObj.out             = this.out;
		this.thumbsObj.backgroundOut   = this.backgroundOut;
		this.thumbsObj.backgroundOver  = this.backgroundOver;
		this.thumbsObj.onmouseover     = imageBoxOver;
		this.thumbsObj.onmouseout      = imageBoxOut;
		
		if(!this.jQuery){
		
		this.thumbsObj.onclick  = ImageEvent;
		this.parentImage.onload = completeEvent;
		
		};
		
		this.onComplete = function(handler){
			
			$(this.jQueryID.parent).load(function(evnt){
				
				handler(evnt);
				
		        });
			 };
		
		this.jQueryEvent = function(type,handler){
			
			this.allE  = String(this.length).split(",");

            for(var i =0; i < this.allE.length; i++){
			
			$(this.allE[i])[type](function(evnt){
				
				handler(evnt);
				
		        });
              };
            };
			
			this.jQueryParentEvent = function(type,handler){
			
			this.allE  = String(this.parentLength).split(",");

            for(var i =0; i < this.allE.length; i++){
			
			$(this.allE[i])[type](function(evnt){
				
				handler(evnt);
				
		        });
              };
            };
			
		this.parentDefaults  = function(evnt){
			
			var e = evnt ? evnt : window.event;
	        var target = e.target ? evnt.target : e.srcElement;
			
			alert(target.links);
			
		}
		
		this.defaults  = function(evnt){
			
			var e = evnt ? evnt : window.event;
	        var target = e.target ? evnt.target : e.srcElement; 
			
			if(target.parentPath !== undefined){
				
				if(this.rail == false){
			
			document.getElementById(target.parent).src                        = target.parentPath + target.source; 
			document.getElementById(target.parentContainer).style.borderColor = target.borderColor;
			this.count = target.count;
            return target.parentPath + target.source;
			
				}else{
					
			$("#"+target.parentContainer).animate({marginLeft: "-" + target.railID},1000); 
		   this.count = target.count;		
		   
					};
		      };
		    };
			
	    this.imageBox.appendChild(this.thumbsObj);
	  
        };
	   
	   for(var v = 0; v < this.saveChildren.length; v++){
		       
			   if(v < this.limit){
			   
	           this._container  = document.getElementById(this.container[0]);
			  this._container.appendChild(this.saveChildren[v]);	
						
				}else if(this.container.length -1){
						
				this._container  = document.getElementById(this.container[this.container.length -1]);
				this._container.appendChild(this.saveChildren[v]);	
						
			 };
	      };
		
		this.automation = function(evnt){
			
			 var e      =     evnt ? evnt        : window.event;
	         var target = e.target ? evnt.target : e.srcElement;
			 
			 if(target.borderReference){
			 
			 this.allE = String(target.queue).split(",");
             this.allC = String(this.children).split(",");
			
			for(var b = 0; b < this.allE.length ; b++){
						
             thumb  = document.getElementById(this.allE[b]);
			 child  = document.getElementById(this.allC[b]);

			if(child.borderColors){
		   
		    thumb.style.borderColor = child.borderColor;
			
			 if(child.isThumbs == false){
	
		    child.style.background = child.borderColor;
		   
		     }
		   
		     }else{
			   
		    thumb.style.borderColor = child.out;	
			
			 if(child.isThumbs == false){
	
		    child.style.background = child.backgroundOut;	 
		   
		    };   
			  };
			 
			 child.selected = false;
					 
              };	
             
              this.changeBorder                   = document.getElementById(target.borderReference);
		      this.changeBorder.style.borderColor = target.over;  
			  target.selected                     = true;
			  
			  if(child.isThumbs == false){
				  
				  document.getElementById(target.id).style.background = target.backgroundOver; 
				  
				 };
			  };
		   };
	
		function imageBoxOver(evnt){
		  
		   var e = evnt ? evnt : window.event;
	       var target = e.target ? evnt.target : e.srcElement; 
		   
		   if(!target.selected){
		   
		   this.changeBorder = document.getElementById(target.borderReference);
		   this.changeBorder.style.borderColor = target.over;
		   
		   if(target.isThumbs == false){
	
		    document.getElementById(target.id).style.background = target.backgroundOver;	 
		   
		    };
		   
		     };
		  
		  };
		  
	  function imageBoxOut(evnt){
		  
		   var e = evnt ? evnt : window.event;
	       var target = e.target ? evnt.target : e.srcElement; 
		   
		   if(!target.selected){
		   
		   this.changeBorder = document.getElementById(target.borderReference);
		   
		   if(target.borderColors){
		   
		   this.changeBorder.style.borderColor = target.borderColor;
		   
		   if(target.isThumbs == false){
	
		    document.getElementById(target.id).style.background = target.borderColor;	 
		   
		    };
		   
		   }else{
			   
		   this.changeBorder.style.borderColor = target.out;
		   
		   if(target.isThumbs == false){
	
		    document.getElementById(target.id).style.background = target.backgroundOut;	 
		   
		    };  
			   
			   };
		   
		     };
		   
           };
		   
	   this.size = {
		 
		 width:$(this.jQueryID.parent).width(),
		 height:$(this.jQueryID.parent).height()
		 
		 };
		 
		this.timer = function(func,duration){

	    
        if(func != undefined){
		
		func();

		};

		setTimeout("this.timer("+func+",'"+duration+"')",duration); 
		
		}; 
		 
		this.effect = function(type,callback){
				
				if(this.jQuery){
				
				if(type == "fadeIn"){
				
				$(this.jQueryID.parent).hide().fadeIn("slow");
				
				  }else if(type == "fadeOut"){
					
					  $(this.jQueryID.parent).fadeOut(500);
					  
					  };
	            };
			  };
		   
	      this.update = function(dir){
		   
		  if(this.useRandomImages){
			
			this.randomNum       = Math.floor(Math.random() * this.source.length);
			this.parentImage.src = this.parentPath + this.source[this.randomNum];
			
			this.allE  = String(this.queue).split(",");
            this.allC = String(this.children).split(",");
			
			for(var f = 0; f < this.allE.length ; f++){
						
             this.thumbAll  = document.getElementById(this.allE[f]);
			 this.childAll  = document.getElementById(this.allC[f]);

			if(this.childAll.borderColors){
		   
		    this.thumbAll.style.borderColor = this.childAll.borderColor;
			
			if(this.isThumbs == false){
	
		    this.childAll.style.background = this.childAll.borderColor;	 
		   
		    };
		   
		     }else{
			   
		    this.thumbAll.style.borderColor = this.childAll.out;
			
			if(this.isThumbs == false){
	
		    this.childAll.style.background = this.backgroundOut;	 
		   
		      };	   
			   
			 };
					 
             this.childAll.selected = false;
					 
               };
			   
			 this._thumb       = document.getElementById(this.children[this.randomNum]);
			 this.changeBorder = document.getElementById(this._thumb.borderReference);
		     this.changeBorder.style.borderColor = this.over; 
			 
			 if(this.isThumbs == false){
			 
			 this.changeBorder.style.background  = this.backgroundOver; 
			 
			 };
			 
			 this._thumb.selected = true;
			  
                
			}else{
			
			if(dir === undefined || dir == null || dir == "" || dir == "next"){
				
			this.count++;
				
				
			if(this.count == this.source.length){
					
			this.count = 0;
					
			};
			
			}else if(dir == "prev"){
			
			if(this.count !== 0){
   
            this.count--;
     
           }else if(dir == "last"){
			   
			   this.count = this.source.length - 1;
   
		   }else if(dir == "first"){
			   
			   this.count = 0;
			   
		   }else{
			   
			   this.count = this.source.length - 1;
   
               };
	        };
			
			if(this.rail == false){
				
		   this.parentImage.src = this.parentPath + this.source[this.count];
		   
			}
			
			this.allE = String(this.queue).split(",");
            this.allC = String(this.children).split(",");
			
			for(var l = 0; l < this.allE.length ; l++){
						
             this.thumbAll  = document.getElementById(this.allE[l]);
			 this.childAll  = document.getElementById(this.allC[l]);

			if(this.childAll.borderColors){
		   
		    this.thumbAll.style.borderColor = this.childAll.borderColor;
			
			 if(this.isThumbs == false){
			 
			  this.childAll.style.background  = this.childAll.borderColor; 
			
			 };	
		   
		     }else{
			   
		    this.thumbAll.style.borderColor = this.childAll.out;
			
			 if(this.isThumbs == false){
			 
			this.childAll.style.background  = this.childAll.backgroundOut; 

			    };	   
			   
			 };
					 
             this.childAll.selected = false;
					 
               };
			   
			 this._thumb       = document.getElementById(this.children[this.count]);
			 this.changeBorder = document.getElementById(this._thumb.borderReference);
			 
			 if(this.rail){
				 
			  $(this.jQueryID.container).animate({marginLeft: "-" + this._thumb.railID},1000); 
			  this.count = this._thumb.count;
			  
			 }
			 
		     this.changeBorder.style.borderColor = this.over; 
			 
			  if(this.isThumbs == false){
			 
			 this._thumb.style.background  = this.childAll.backgroundOver; 
		
			 };
			 
			 this._thumb.selected = true;
			  
                };
			};
		  
		 this.enableLocation = function(bool){
			 
			 this.useLocation = bool;
			 
			   if(this.useLocation){
		  
		  document.location = "#" + _parentAnchor.id;
		  
		        };
			 };
          };
  
  
 com.lasagna.iComp.Image.prototype.thumbsURL = function(thumbs){
	 
	 if(typeof(thumbs) == 'number'){
		 
		 for(var g = 0; g < thumbs; g++){
		 
		 this.thumbs.push(g);
		 
		 };
		 
		 }else{
	 
	 this.thumbs = thumbs.split(",");
	 
	   };
     };

com.lasagna.iComp.Image.prototype.ImageURL = function(images){
	 
	 this.source = images.split(",");
	 
};

com.lasagna.iComp.Image.prototype.computeImages = function(len,name,ext,isRepeat){

		this.createExp = "";
		
		if(ext == "" || ext === null || ext === undefined || ext == "mixed"){
			
			ext = ".jpg";
			
			};

		for(var i = 0; i < len; i++){
		
		var _i = 1 + i;	
		
		if(isRepeat == true){
			
		this.createExp += String(name + ext + ",");
			
			}else if(ext == "mixed"){
				
				this.createExp += String(name);
				
			}else{
		
       if(name == "" || name === null || name === undefined){
		
		this.createExp += String(name + _i + ext + ",");
		
		}else{
			
		this.createExp += String(name + _i + ext + ",");	
			
		};
      };
    };
		
		this._createExp = this.createExp.slice(this.createExp.indexOf(this.createExp),this.createExp.length - 1);
        return this._createExp;
    };
