/* Javscript - Sacastar.com */

var onAdd="-on";                

function autoRoll(Img,Event){
	if(!Img.onmouseout && Event == true) Img.onmouseout = function(){ autoRoll(Img) };
	imgExt = Img.src.substring(Img.src.lastIndexOf("."));
	imgName = Img.src.substring(0,Img.src.lastIndexOf("."));
	imgOn = imgName+onAdd+imgExt;
	if(imgName.indexOf(onAdd) != -1) imgName = imgName.substring(0,imgName.length-onAdd.length);
	imgOff = imgName+imgExt;
	if(Img.src.indexOf(onAdd) != -1) Img.src = imgOff;
	else Img.src = imgOn;
}

function autoRollEvents(){
	var imgTable = arguments[0].getElementsByTagName('img');
	for(var i=0; i<imgTable.length; i++){
		imgTable[i].onmouseout = null;
		if(imgTable[i].src.indexOf(onAdd) == -1) imgTable[i].onmouseover = function(){autoRoll(this,true)};
	}
}
function autoRollHeader(Img,imgTable){
	
	for(var i=0; i<imgTable.length; i++){
		
		imgTable[i].src=imgTable[i].src.replace(onAdd,"");
		
	}
	var imgExt = Img.src.substring(Img.src.lastIndexOf("."));
	var imgName = Img.src.substring(0,Img.src.lastIndexOf("."));
	if(Img.src.indexOf(onAdd) == -1) Img.src=imgName+onAdd+imgExt;
	
}

function autoRollEventsHeader(){
	//var imgTable = arguments[0].getElementsByTagName('img');
	var imgTable = $$('img','HeaderGenderTabImage');
	for(var i=0; i<imgTable.length; i++){
		
		imgTable[i].onmouseover = function(){autoRollHeader(this,imgTable)};
		
	}
	arguments[0].onmouseout= function(){
	     for(var i=0; i<imgTable.length; i++){
    		
		    imgTable[i].src=imgTable[i].src.replace(onAdd,"");
		    if(imgTable[i].getAttribute("default")=="yes") 
		    {
		        var imgExt = imgTable[i].src.substring(imgTable[i].src.lastIndexOf("."));
	            var imgName = imgTable[i].src.substring(0,imgTable[i].src.lastIndexOf("."));
	            imgTable[i].src = imgName+onAdd+imgExt;
		    }
    		
	    }
	};
}

/***** 30 - Field cleaner *****/
function fieldCleaner(field,message){
	if(field.value == message){
		field.value = '';
	}
}

/***** 40 - CustomBox *****/
function customBoxClick(id){
	if($(id,'input',0).checked == true){
		$S('del',$(id,'label',0),'on');
	} else {
		$S('add',$(id,'label',0),'on');
	}
}

/***** 50 - Fold / Unfold ******/
var foldTimer;
var foldSize = 20;
var foldSpeed = 30;
var maskObj;
var contObj;
var stopFold=false;
var isFolding=false;
var isUnFolding=false;
function fold(mask,cont){
	maskObj = mask;
	contObj = cont;
	foldEffect();
}
function foldEffect(){
	//isFolding=true;
	//if (stopFold && !isUnFolding)
	//{
//	    maskObj.style.height = contObj.offsetHeight+'px';
//	    return;
//	}
	//if (isUnFolding)
	//{
	//    isFolding=false;
	//    return;
	//}
	
	if((maskObj.offsetHeight+foldSize) < contObj.offsetHeight ){
		maskObj.style.height = (maskObj.offsetHeight+foldSize)+'px';
		
		    foldTimer = setTimeout('foldEffect();',foldSpeed);
	} else {
	    //isFolding=false
		maskObj.style.height = contObj.offsetHeight+'px';
		
		    
	}
}
function unFold(mask,cont){
	maskObj = mask;
	contObj = cont;
	unFoldEffect();
}
function unFoldEffect(){
//	isUnFolding=true;
//	if (stopFold && !isFolding)
//	{
//	    maskObj.style.height = '0';
//	    return;
//	}
//	if (isFolding)
//	{
//	    isUnFolding=false;
//	    return;
//	}
	
	if((maskObj.offsetHeight-foldSize) > 0){
		maskObj.style.height = (maskObj.offsetHeight-foldSize)+'px';
		
		    foldTimer = setTimeout('unFoldEffect();',foldSpeed);
		    
	} else {
	    
		maskObj.style.height = '0';
		if (maskObj.getAttribute('id')=='divSize')
		{
		    //fold($('divSize'),$('divSize','div',0));
		    var unFoldElt=getElement_By_Id("UnFolddivSize");

	        if (unFoldElt!=null)
		        unFoldElt.className="toFold";
		}
	}
}

/***** 60 - Scrolls *****/
var scrollTimer;
var scrollSpeed = 10;
var scrolLDelay = 20;

function scroll(item,maskHeight,contentHeight,toolHeight){
	item.ratio = maskHeight/contentHeight;
	item.maskHeight = maskHeight;
	item.contentHeight = contentHeight;
	item.trackHeight = maskHeight-(toolHeight*2);
	item.trackStart = toolHeight;
	item.barHeight = item.trackHeight*item.ratio;
	item.barRatio = item.barHeight/item.maskHeight;
	item.trackMax = item.trackHeight-item.barHeight-toolHeight*2;
}

function scrollUp(index){
	if(($('scroll'+index,'div',0).offsetTop+scrollSpeed) < 0){
		$('scroll'+index,'div',0).style.top = ($('scroll'+index,'div',0).offsetTop+scrollSpeed)+'px';
		scrollTimer = setTimeout('scrollUp('+index+');', scrolLDelay);
	} else {
		$('scroll'+index,'div',0).style.top = '0';
	}
	updateScrollBar(index);
}
function scrollDown(index){
	if(($('scroll'+index,'div',0).offsetTop-scrollSpeed) > ($('scroll'+index).offsetHeight-$('scroll'+index,'div',0).offsetHeight)){
		$('scroll'+index,'div',0).style.top = ($('scroll'+index,'div',0).offsetTop-scrollSpeed)+'px';
		scrollTimer = setTimeout('scrollDown('+index+');', scrolLDelay);
	} else {
		$('scroll'+index,'div',0).style.top = ($('scroll'+index).offsetHeight-$('scroll'+index,'div',0).offsetHeight)+'px';
	}
	updateScrollBar(index);
}
function updateScrollBar(index){
	var newDelta = Math.floor(-$('scroll'+index,'div',0).offsetTop*$('scroll'+index).barRatio)+$('scroll'+index).trackStart;
	$('scroll'+index+'Tools','div',1).style.top = newDelta+'px';
}

/***** 70 - Product View *****/
var coeffZoom='4';
function viewProduct(id){
	var viewerId = id.split('Thumb')[0]
	var thumbIndex = id.split('Thumb')[1]
	//var coeffZoom='2';
	var productId='';
	try
	{
	    coeffZoom=getElement_By_Id("ViewInfos_CoeffZoom").value;
	    productId=getElement_By_Id("ViewInfos_ProductId").value;
	}
	catch(ex)
	{}
	
	var objFlash = getElement_By_Id("productFlash");
    
    if(objFlash!=null){
        //var myFlashObject = new FlashObject(productId, $(viewerId+'Thumb'+thumbIndex).src.replace('/thumbs/','/big/'),coeffZoom, 8,false);
        var myFlashObject = new FlashObject(productId, $(viewerId+'Thumb'+thumbIndex).src.replace('/thumbs/','/big/').replace('PI_',''),coeffZoom, 8,false);

        myFlashObject.write("productFlash");
    }
	//$(viewerId+'View','img',0).src = $(viewerId+'Thumb'+thumbIndex).src.replace('/thumbs/','/big/');
}
var FlashObject = function(prd, src, zoom, ver, isZoomVig, isCarousselBrand, fromFamille, id) {
    this.prd = prd;
    this.zoom = zoom;
    this.isZoomVig = isZoomVig;
    this.src = src;
    this.version = ver;
    this.params = new Object();
    this.addParam('quality', 'high'); // default to high
    this.doDetect = getQueryParamValue('detectflash');
    this.flashPath = "http://cache.sarenza.com/V4/";
    this.imagePath = "";
    this.isCarousselBrand = isCarousselBrand;
    this.fromFamille = fromFamille;
    this.idControl = id;
}

var FOP = FlashObject.prototype;
FOP.addParam = function(name, value) { this.params[name] = value; }
FOP.getParams = function() { return this.params; }
FOP.getParam = function(name) { return this.params[name]; }

FOP.getParamTags = function() {
 var paramTags = "";
 for (var param in this.getParams()) {
 paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';
 }
 return (paramTags == "") ? false:paramTags;
}

FOP.getHTML = function(width, height) {
    var flashHTML = "";
    //flashHTML += '<object type="application/x-shockwave-flash" data="/webapp/wcs/stores/servlet/Hermes1/commun/produits/' + this.cat + '/int/flash/zoom.swf" width="534" height="476" id="">';
    //flashHTML += '<param name="movie" value="/webapp/wcs/stores/servlet/Hermes2/commun/produits/' + this.cat + '/int/flash/zoom.swf" />';
    //flashHTML += '<param name="FlashVars" value="xmlProduct=<product id=\'' + this.prd + '\' img=\'/webapp/wcs/stores/servlet/Hermes3/commun/produits/' + this.cat + '/int/detail/' + this.prd + '.jpg\' imgzoom=\'/webapp/wcs/stores/servlet/Hermes4/commun/produits/' + this.cat + '/int/zoom/' + this.prd + '.jpg\' />" />';
    if (width == undefined || width == '')
        width = 652;
    if (height == undefined || height == '')
        height = 50;
    if (this.isCarousselBrand) {

        if (this.fromFamille) {
            flashHTML += '<OBJECT id="" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" data="http://cache.sarenza.com/V4/carouselBrands-6522.swf">';
            flashHTML += '<PARAM value="http://cache.sarenza.com/V4/carouselBrands-6522.swf" name="movie" />';
        }
        else {
            flashHTML += '<OBJECT id="" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" data="http://cache.sarenza.com/V4/carouselBrands-652.swf">';
            flashHTML += '<PARAM value="http://cache.sarenza.com/V4/carouselBrands-652.swf" name="movie" />';
        }

        flashHTML += '<PARAM value="playWhenGTH=14&xmlBrands=<icons home=\'' + getElement_By_Id("carouselBrandFlashHiddenHome" + this.idControl).value + '\' urlImage=\'' + getElement_By_Id("carouselBrandFlashHiddenUrlImages" + this.idControl).value + '\'>' + getElement_By_Id("carouselBrandFlashHiddenImages" + this.idControl).value + '</icons> " name="FlashVars" />';
        flashHTML += '<PARAM value="transparent" name="wmode" />';
        flashHTML += '<PARAM NAME="AllowScriptAccess" VALUE="always">';
        flashHTML += '</OBJECT>';
        getElement_By_Id("carouselBrandFlashHiddenImages" + this.idControl).value = "";
        return flashHTML;
    }

    if (!this.isZoomVig) {
        //    flashHTML += '<object type="application/x-shockwave-flash" data="' + this.flashPath + 'zoom.swf" width="380" height="253" id="">';
        //    flashHTML += '<param name="movie" value="' + this.flashPath + 'zoom.swf" />';
        //    flashHTML += '<param name="FlashVars" value="xmlProduct=<product id=\'' + this.prd + '\' CoeffZoom=\''+ this.zoom+'\' img=\''+this.imagePath+this.src+'\'  />" />';//ajouter imgzoom=\''+this.imagePath+this.src+'\' en cas ou on a une image HD 
        //
        flashHTML += '<object type="application/x-shockwave-flash" data="' + this.flashPath + 'zoomV4.swf" width="380" height="253" id="">';
        flashHTML += '<param name="movie" value="' + this.flashPath + 'zoomV4.swf" />';
        var splitedSrc = this.src.split('/');
        flashHTML += '<param name="FlashVars" value="xmlProduct=<product id=\'' + this.prd + '\' CoeffZoom=\'' + this.zoom + '\' img=\'' + this.imagePath + this.src + '\' imgzoom=\'' + this.imagePath + this.src.replace(splitedSrc[splitedSrc.length - 1], 'HD_' + splitedSrc[splitedSrc.length - 1]) + '\'   />" />'; //ajouter imgzoom=\''+this.imagePath+this.src+'\' en cas ou on a une image HD 

    }
    else {
        flashHTML += '<object type="application/x-shockwave-flash" data="' + this.src.toString().split('_img/productsV4/')[0] + 'V4/zoom.swf" width="360" height="240" id="">';
        flashHTML += '<param name="movie" value="' + this.src.toString().split('_img/productsV4/')[0] + 'V4/zoomVig.swf" />';
        flashHTML += '<param name="FlashVars" value="xmlProduct=<product id=\'' + this.prd + '\'  img=\'' + this.imagePath + this.src + '\'  />" />'; //ajouter imgzoom=\''+this.imagePath+this.src+'\' en cas ou on a une image HD 
    }
    flashHTML += '<param name="wmode" value="transparent">'
    flashHTML += '</object>';
    return flashHTML;
}

FOP.write = function(elementId, width, height) {
    if (detectFlash(this.version) || this.doDetect == 'false') {
        if (elementId)
            document.getElementById(elementId).innerHTML = this.getHTML(width, height, "_" + elementId.toString().split("-")[1]);

    }
    else {

        if (elementId) {
            if (this.isCarousselBrand)
                return;
            if (!this.isZoomVig)
                document.getElementById(elementId).innerHTML = "<img src=" + this.imagePath + this.src + " width=\"380\" height=\"253\" id=visuprd>";
            else
                document.getElementById(elementId).innerHTML = "<img src=" + this.imagePath + this.src + " width=\"360\" height=\"240\" id=visuprd>";
        }


    }
}

/* ---- detection functions ---- */
function getFlashVersion() {
 var flashversion = 0;
 if (navigator.plugins && navigator.mimeTypes.length) {
    
    var x = navigator.plugins["Shockwave Flash"];
    
    if(x && x.description) {
        var y = x.description;
              
        flashversion = parseInt(y.substr(y.indexOf('.')-2,2),10);
    }
 } else {
    result = false;
    
    for(var i = 15; i >= 3 && result != true; i--){
        execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
        flashversion = i;
    }  
 }
 return flashversion;
}

function detectFlash(ver) {
 
 return (getFlashVersion() >= ver) ? true:false;
 }
 // get value of query string param
function getQueryParamValue(param) {
 var q = document.location.search || document.location.href.split("#")[1];
 if (q) {
 var detectIndex = q.indexOf(param +"=");
 var endIndex = (q.indexOf("&", detectIndex) > -1) ? q.indexOf("&", detectIndex) : q.length;
 if (q.length > 1 && detectIndex > -1) {
 return q.substring(q.indexOf("=", detectIndex)+1, endIndex);
 } else {
 return "";
 }
 }
}

function changeFlash(prd,src){
 var myFlashObject = new FlashObject(prd, src,coeffZoom, 8,false);
 myFlashObject.write("GrandVisuel");
}

/***** 75 - Layer adds *****/
function openBasketAdd(){
	if($$('div','basketAdd')[0]){
		$$('div','basketAdd')[0].style.visibility = 'visible';
	}
}
function closeBasketAdd(){
	if($$('div','basketAdd')[0]){
		$$('div','basketAdd')[0].style.visibility = 'hidden';
	
		 //getElement_By_Id("viewer0View").onmousemove = move;
    
	}
}

function openBasketSummary(){
	if($$('div','summary basketSummary scrolling')[0]){
	    getElement_By_Id("divTerminerCommande").style.display="none";
		$$('div','summary basketSummary scrolling')[0].style.visibility = 'visible';
	    basketLineItems = ReadCookie("BasketLineItems");
        if (basketLineItems!="") {
            basketLineItems = basketLineItems.split(";");
            if (basketLineItems.length >5 ) {
                getElement_By_Id("scrollBasketPrev").style.visibility="visible";
                getElement_By_Id("scrollBasketNext").style.visibility="visible";
            }
        }
	}
}
function closeBasketSummary(){
	if($$('div','summary basketSummary scrolling')[0]){
		getElement_By_Id("divTerminerCommande").style.display="block";
		$$('div','summary basketSummary scrolling')[0].style.visibility = 'hidden';
	    getElement_By_Id("scrollBasketPrev").style.visibility="hidden";
		getElement_By_Id("scrollBasketNext").style.visibility="hidden";
	}
}

function openSelectionSummary(){
	if($$('div','selectionSumamry')[0]){
		getElement_By_Id("divTerminerCommande").style.display="none";
		$$('div','selectionSumamry')[0].style.visibility = 'visible';
		if($$('li','selection')[0].getElementsByTagName('img')[0].src.indexOf(onAdd) == -1){
			autoRoll($$('li','selection')[0].getElementsByTagName('img')[0],false);
		}
	}
}
function closeSelectionSummary(){
	if($$('div','selectionSumamry')[0]){
		$$('div','selectionSumamry')[0].style.visibility = 'hidden';
		if($$('li','selection')[0].getElementsByTagName('img')[0].src.indexOf(onAdd) != -1){
			autoRoll($$('li','selection')[0].getElementsByTagName('img')[0],false);
		}
	}
}

/***** 80 - Tabs *****/
var lastTab = -1;

function showTab(index){
	if(lastTab != -1){
		$('tab'+lastTab,'div',0).style.visibility = 'hidden';
		$S('del',$('tab'+lastTab,'a',0),'on');
	}
	$('tab'+index,'div',0).style.visibility = 'visible';
	$S('add',$('tab'+index,'a',0),'on');
	lastTab = index;
}

var lastAltTab = -1;

function showAltTab(index){
	if(lastAltTab != -1){
		$('tabAlt'+lastAltTab+'Cont').style.display = 'none';
		autoRoll($('tabsAltLinks','li',lastAltTab,'img',0),false);
	}
	$('tabAlt'+index+'Cont').style.display = 'block';
	autoRoll($('tabsAltLinks','li',index,'img',0),false);
	lastAltTab = index;
}

/***** 85 - Comments *****/
var lastComment = -1;
var commentCount = 0;

function showComment(index){
	if(lastComment != -1){
		$('comment'+lastComment).style.display = 'none';
	}
	$('comment'+index).style.display = 'block';
	buildCommentPager(index);
	lastComment = index;
}

function buildCommentPager(index){
	if(commentCount > 1){
		var prevClass = 'prevOn';
		var prevAction = 'javascript:showComment('+(index-1)+');';
		var nextClass = 'nextOn';
		var nextAction = 'javascript:showComment('+(index+1)+');';
		if(index == 0){
			prevClass = 'prevOff';
			prevAction = '#0';
		}
		if(index == commentCount-1){
			nextClass = 'nextOff';
			nextAction = '#0';
		}
		var commentPagerCh = '';
		commentPagerCh += '<a class="'+prevClass+'" href="'+prevAction+'"></a>';
		commentPagerCh += '<span>'+(index+1)+'/'+commentCount+'</span>';
		commentPagerCh += '<a class="'+nextClass+'" href="'+nextAction+'"></a>';
		$('commentPager').innerHTML = commentPagerCh;
	}
}

/***** 99 - onLoad *****/
var object = new Array();

function Slide(N,oCont){
	this.N  = N;
	this.S  = 1.1;
	this.object = new Array();
    this.AutoRun=true;
	this.CObj = function (parent,N){

		this.parent = parent;
		this.N = N;
		this.obj = parent.frm[N];
		this.tit = this.obj.getElementsByTagName("div")[0];
		
		this.div = this.obj.getElementsByTagName("div")[1];
		this.div.style.visibility = "hidden";
		this.y0 = N * 18;
		this.Y1 = this.y0;
		this.obj.style.top = Math.round(this.y0) + 'px';
		this.obj.style.height = Math.round(parent.H - (parent.NF-1) * 18 - 3) + 'px';
		this.obj.style.visibility = "visible";
		this.obj.parent = this;
		this.run = false;
       
		this.move = function(){
			with(this){
				dy = (y1-y0)/parent.S;
				if(Math.abs(dy)>.1){
					y0+=dy;
					obj.style.top = Math.round(y0) + 'px';;
					setTimeout("object["+parent.N+"].object["+N+"].move();", 16);
				} else {
					run = false;
					if(dy>0)div.style.visibility="hidden";
					else if(N>0)parent.object[N-1].div.style.visibility="hidden";
				}
			}
		}
       
	   
		
		this.obj.onmouseover = function(){
			with(this.parent){
				if(!run){
					run = true;
					div.style.visibility="visible";
					
					for(i=0;i<parent.NF;i++)parent.object[i].tit.className = "titleHomeGender";
					tit.className = "titleHomeGender_o";
					for(i=0;i<=N;i++){
						parent.object[i].y1 = i*25;
						parent.object[i].move();
					}
					for(i=N+1;i<parent.NF;i++){
						parent.object[i].y1 = parent.H-(parent.NF-i)*25;
						parent.object[i].move();
					}
				}
			}
		}
		
		
	}

	this.divFrm = document.getElementById(oCont);
	if (this.divFrm!=null)
	{
	    
	    this.divFrm.onmouseout = function(){
		    this.setAttribute("AutoRun","true");
		}
		this.divFrm.onmouseover = function(){
		    this.setAttribute("AutoRun","false");
		}
	    this.H = this.divFrm.offsetHeight;
	    this.frm = this.divFrm.getElementsByTagName("span");
	    this.NF = this.frm.length;
	    for(i=0; i < this.NF; i++) this.object[i] = new this.CObj(this, i);
	    this.object[0].obj.onmouseover();
    	
	    //window.setTimeout("this.object[1].obj.MoveFunction();",5000);
	    this.S = 10;
	}
}
function AutoRun(i)
{
  
    if(i>=object[0].object.length)
        i=0;
    if(object[0].divFrm.getAttribute("AutoRun")==null || object[0].divFrm.getAttribute("AutoRun")=="true")
        object[0].object[i].obj.onmouseover();
    
    window.setTimeout("AutoRun("+(i+1)+");",4000);
}


var objectSarenzaSlide;
function SarenzaSlide(data,oCont,speed,useopacity){
  
  objectSarenzaSlide=new MainSarenzaSlide(data,oCont,speed,useopacity);
  

}
function MainSarenzaSlide(data,oCont,speed,useopacity)
{
  this.divFrm = document.getElementById(oCont);
  this.data=data;
  
  this.speed=speed;
  this.useopacity=useopacity;
  this.principalImage=this.divFrm.getElementsByTagName("img")[0];
  
  this.principalLink=this.divFrm.getElementsByTagName("a")[0];
  this.thumbnails=new Array();
  this.StopAutoRun=false;
  
  this.principalImage.onmouseover=function()
  {
    objectSarenzaSlide.StopAutoRun=true;
  }
  
  this.principalImage.onmouseleave=function()
  {
    objectSarenzaSlide.StopAutoRun=false;
  }
  this.principalImage.onmouseout=function()
  {
    objectSarenzaSlide.StopAutoRun=false;
  }
  
  this.autoRun=function(i){
  
    
    if(i>=this.thumbnails.length)
        i=0;
    if(!this.StopAutoRun)
        this.thumbnails[i].move();
    
    window.setTimeout("objectSarenzaSlide.autoRun("+(i+1)+")",this.speed);
   
    
  }
  this.thumbnail=function(image,parent)
  {
    this.image=image;
    this.parent=parent;
    this.image.onmouseover=function()
    {
        parent.StopAutoRun=true;
        if(parent.useopacity)
        {
            for(var i=0;i<parent.thumbnails.length;i++)
            {
                parent.thumbnails[i].image.style.filter="alpha(opacity:50)";
                parent.thumbnails[i].image.style.opacity=0.5;
            }
            image.style.filter="alpha(opacity:100)";
            image.style.opacity=1;
        }
        parent.principalLink.href=image.parentNode.href;
        parent.principalLink.target=image.parentNode.target;
        parent.principalImage.src=image.src.replace(/t(\.[^\.]+)$/, '$1');
    }
    this.image.onmouseleave=function()
    {
        parent.StopAutoRun=false;
    }
    this.image.onmouseout=function()
    {
        parent.StopAutoRun=false;
    }
    this.move=function()
    {
        if(parent.useopacity)
        {
            for(var i=0;i<parent.thumbnails.length;i++)
            {
                parent.thumbnails[i].image.style.filter="alpha(opacity:50)";
                parent.thumbnails[i].image.style.opacity=0.5;
            }
            image.style.filter="alpha(opacity:100)";
            image.style.opacity=1;
        }
        parent.principalLink.href=image.parentNode.href;
        parent.principalLink.target=image.parentNode.target;
        parent.principalImage.src=image.src.replace(/t(\.[^\.]+)$/, '$1');
        
    }
  }
  if(this.divFrm)
  {
    var  slideshowThumbnails=document.createElement("div");
    slideshowThumbnails.className="slideshow-thumbnails";
    slideshowThumbnails.style.overflow="hidden";
    var  slideshowThumbnailsUL=document.createElement("ul");
    var i=0;
    for(image in data)
    {
        var  slideshowThumbnailsLI=document.createElement("li");        
        var  slideshowThumbnailsA=document.createElement("a");
        slideshowThumbnailsA.href=data[image].href?data[image].href:"";
        slideshowThumbnailsA.target=data[image].target?data[image].target:"";
        var  slideshowThumbnailsIMG=document.createElement("img");
        slideshowThumbnailsIMG.src=image.replace(/(\.[^\.]+)$/, 't$1');
        if(this.useopacity)
        {
            slideshowThumbnailsIMG.style.filter="alpha(opacity:50)";
            slideshowThumbnailsIMG.style.opacity=0.5;
        }
        this.thumbnails[i]=new this.thumbnail(slideshowThumbnailsIMG,this);
        
        
        slideshowThumbnailsA.appendChild(slideshowThumbnailsIMG);
        slideshowThumbnailsLI.appendChild(slideshowThumbnailsA);
        slideshowThumbnailsUL.appendChild(slideshowThumbnailsLI);
        i++;
    }
    slideshowThumbnails.appendChild(slideshowThumbnailsUL);
    this.divFrm.appendChild(slideshowThumbnails);
    this.autoRun(0);
    
  }
}

window.onload = function(){
	
	 
	
	
	// 86 - Navigation
	if($("navTop"))  
	{
	    var nodes = $("navTop").getElementsByTagName("li");

	    for (var i=0;i<nodes.length;i++) {
		    if (nodes[i].parentNode.tagName=="UL") {
    		
		/*	    nodes[i].onmouseover = function () {
				
					  Element.addClassName(this, "menu"+i);

			        try {
				    this.getElementsByTagName("ol")[0].style.visibility = "visible";
				    var img = this.getElementsByTagName("img")[0];
				    if(img.src.indexOf(onAdd) == -1) { autoRoll(img,true); };
				    } catch(ex){}
			    }
			    nodes[i].onmouseout = function () {
				 Element.removeClassName(this, "menu"+i);
				    try {
				    this.getElementsByTagName("ol")[0].style.visibility = "hidden";
				    } catch(ex){}
			    }
				*/
		    }
	    }
	}

	//*************************
	//AfterInitPage();                     
	 
}
