function fadeWishDelay(productsImage) {

//alert(productsImage);
var wishListCart = document.getElementById('wishListCart');
wishListCart.innerHTML = wishListCart.innerHTML + '&nbsp;&nbsp;' + '<img width="47" src="' + productsImage + '_s.jpg">';

}

function processGetPost(){
var myajax=ajaxpack.ajaxobj
var myfiletype=ajaxpack.filetype
if (myajax.readyState == 4){ //if request of file completed
if (myajax.status==200 || window.location.href.indexOf("http")==-1){ //if request was successful or running script locally
//if (myfiletype=="txt")
//else

//alert (myajax.responseText);
if (myajax.responseText != '1') {
	new Effect.Opacity('wishListCart',{ duration: 0.5, from: 1.0, to: 0.0});	
	setTimeout('fadeWishDelay(\''+myfiletype+'\')', 600);  
	new Effect.Opacity('wishListCart',{ duration: 1.0, from: 0.0, to: 1.0, delay:0.5 }); 
}

}
}
}


function processLoadWishList() {
var myajax=ajaxpack.ajaxobj
var myfiletype=ajaxpack.filetype
var itemsArray;
if (myajax.readyState == 4){ //if request of file completed
if (myajax.status==200 || window.location.href.indexOf("http")==-1){ //if request was successful or running script locally

itemsArray = myajax.responseText.split(',');

new Effect.Opacity('wishListCart',{ duration: 0.5, from: 1.0, to: 0.0});	
for (i=0; i<itemsArray.length; i++) {
	sendItem = './images/' + itemsArray[i];
	setTimeout('fadeWishDelay(\''+sendItem+'\')', 600);  
}
new Effect.Opacity('wishListCart',{ duration: 1.0, from: 0.0, to: 1.0, delay:1.5 }); 

//}

}
}
}

function loadWishList(myfiletype, relPath) {
	var poststr = "";
	fullPath = relPath + "getWishList.php";
	ajaxpack.postAjaxRequest(fullPath, poststr, processLoadWishList, myfiletype);
	//new Effect.Opacity('wishListCart',{ duration: 0.5, from: 1.0, to: 0.0});	
	//setTimeout('fadeWishDelay(\''+myfiletype+'\')', 600);  
	//new Effect.Opacity('wishListCart',{ duration: 1.0, from: 0.0, to: 1.0, delay:0.5 }); 	
}

function fadeInWishList(myfiletype, relPath) {
	var wishListCart = document.getElementById('wishListCart');
    wishListCart.innerHTML = wishListCart.innerHTML + '&nbsp;<img width="47" src="' + relPath + myfiletype +'_s.jpg"/>'
}

function makearray(n){
  this.length = n;
  for(var i = 1; i <= n; i++)
  this[i] = 0;
  return this;
}
hexa = new makearray(16);
for(var i = 0; i < 10; i++) hexa[i] = i;
hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
hexa[13]="d"; hexa[14]="e"; hexa[15]="f";
function hex(i){
  if (i < 0) return "00";
  else if (i >255) return "ff";
  else return "" + hexa[Math.floor(i/16)] + hexa[i%16];
}
function setbgColor(r, g, b){
  var hr = hex(r); var hg = hex(g); var hb = hex(b);
  document.bgColor = "#"+hr+hg+hb;
}
function fade(sr, sg, sb, er, eg, eb, step){
  for(var i = 0; i <= step; i++){
	setbgColor(Math.floor(sr * ((step-i)/step) + er * (i/step)),
	Math.floor(sg * ((step-i)/step) + eg * (i/step)),
	Math.floor(sb * ((step-i)/step) + eb * (i/step)));
  }
}
function fadeLogo() {
new Effect.Appear('header',{ duration: 1.5, from: 0.0, to: 1.0 }); 
new Effect.Opacity('horizLine',{ duration: 1.0, from: 0.0, to: 1.0, delay: 0.0 }); 
new Effect.Move ('horizLine',{ x: -1000, y: 0, mode: 'relative', duration:0.0, delay:0.0});
new Effect.Move ('horizLine',{ x: 1000, y: 0, mode: 'relative', duration:1.0, delay:1.5});
}
function toggleLogo() {
new Effect.Appear('header',{ duration: 0.1, from: 0.0, to: 1.0 }); 
//new Effect.Opacity('horizLine',{ duration: 1.0, from: 0.0, to: 1.0, delay: 0.0 }); 
//new Effect.Move ('horizLine',{ x: -1000, y: 0, mode: 'relative', duration:0.0, delay:0.0});
//new Effect.Move ('horizLine',{ x: 1000, y: 0, mode: 'relative', duration:1.0, delay:1.5});
}

function fadeMenu() {
//initSlideDownMenu();
//new Effect.Appear('dhtmlgoodies_slidedown_menu',{ duration: 1.5, from: 0.0, to: 1.0, delay: 2.4 }); 
//new initSlideDownMenu();
}

function fadeActions() {
/* first animation */
	
if (document.getElementById('scroller')) {
	document.getElementById('scroller').style.backgroundColor='#59504E';
}

new Effect.Appear('tateossian',{ duration: 2.0, from: 0.0, to: 1.0, delay:0.0 }); 
new Effect.Move ('tateossian',{ x: -255, y: 0, mode: 'relative', duration:8.0, delay:1.0});
new Effect.Opacity('tateossian',{ duration: 1.5, from: 1.0, to: 0.0, delay:6.0 });
new Effect.Fade ('tateossian',{ duration: 0.1, delay:7.5, from: 0.0, to: 0.0 }); 

/* second animation */
new Effect.Appear('tateossian1',{ duration: 3.0, from: 0.0, to: 1.0, delay:7.6}); 
new Effect.Move ('tateossian1',{ x: 255, y: 0, mode: 'relative', duration:8.0, delay:10.0});
new Effect.Opacity('tateossian1',{ duration: 1.5, from: 1.0, to: 0.0, delay:16.0 });
new Effect.Fade ('tateossian1',{ duration: 0.1, delay:17.5, from: 0.0, to: 0.0 }); 

/* third animation */
new Effect.Appear('tateossian2',{ duration: 3.0, from: 0.0, to: 1.0, delay:17.6 }); 
new Effect.Move ('tateossian2',{ x: -255, y: 0, mode: 'relative', duration:8.0, delay:21.0});
}

function fadeActions2() {
/* first animation */
	
if (document.getElementById('scroller')) {
	document.getElementById('scroller').style.backgroundColor='#59504E';
}

new Effect.Appear('tateossian',{ duration: 4.0, from: 0.0, to: 1.0, delay:0.0 }); 
new Effect.Move ('tateossian1',{ x: -255, y: 0, mode: 'relative', duration:6.0, delay:1.0});
new Effect.Appear('tateossian1',{ duration: 3.0, from: 0.0, to: 1.0, delay:2.0 }); 
new Effect.Opacity('tateossian',{ duration: 2.0, from: 1.0, to: 0.0, delay:3.0 });
new Effect.Fade ('tateossian1',{ duration: 2.0, from: 1.0, to: 0.0, delay:5.0 }); 

new Effect.Appear('tateossian2',{ duration: 4.0, from: 0.0, to: 1.0, delay:5.0 }); 
new Effect.Move ('tateossian3',{ x: 255, y: 0, mode: 'relative', duration:6.0, delay:6.0});
new Effect.Appear('tateossian3',{ duration: 3.0, from: 0.0, to: 1.0, delay:7.0 }); 
new Effect.Opacity('tateossian2',{ duration: 2.0, from: 1.0, to: 0.0, delay:8.0 });
new Effect.Fade ('tateossian3',{ duration: 2.0, from: 1.0, to: 0.0, delay:10.0 }); 

new Effect.Appear('tateossian4',{ duration: 4.0, from: 0.0, to: 1.0, delay:10.0 }); 
new Effect.Move ('tateossian5',{ x: -255, y: 0, mode: 'relative', duration:6.0, delay:11.0});
new Effect.Appear('tateossian5',{ duration: 3.0, from: 0.0, to: 1.0, delay:12.0 }); 
new Effect.Opacity('tateossian4',{ duration: 2.0, from: 1.0, to: 0.0, delay:13.0 });
//new Effect.Fade ('tateossian5',{ duration: 2.0, from: 1.0, to: 0.0, delay:15.0 }); 

new Effect.Appear('rightcolumndown',{ duration: 2.0, from: 0.0, to: 1.0, delay:16.0 }); 

//new Effect.Fade ('tateossian3',{ duration: 1.0, delay:45, from: 1.0, to: 0.0 }); 


/* second animation */
/*
new Effect.Appear('tateossian1',{ duration: 3.0, from: 0.0, to: 1.0, delay:7.6}); 
new Effect.Move ('tateossian1',{ x: 255, y: 0, mode: 'relative', duration:8.0, delay:10.0});
new Effect.Opacity('tateossian1',{ duration: 1.5, from: 1.0, to: 0.0, delay:16.0 });
new Effect.Fade ('tateossian1',{ duration: 0.1, delay:17.5, from: 0.0, to: 0.0 }); 
*/

/* third animation */
//new Effect.Appear('tateossian1',{ duration: 3.0, from: 0.0, to: 1.0, delay:17.6 }); 
//new Effect.Move ('tateossian1',{ x: -255, y: 0, mode: 'relative', duration:8.0, delay:21.0});
}

function fadeCollection() {
/* collections page */
/* third animation */
new Effect.Appear('collection',{ duration: 1.0, delay:0.0  }); 

}

function fadeCollectionMove() {
/* collections page */
/* third animation */
new Effect.Move ('collection',{ x: -360, y: 0, mode: 'relative', duration:4.0, delay:0.0});
document.getElementById('collection').id="collectionOff";

}

function fadeWishList(itemID, itemImage, itemPath, itemLev2Cat) {
//function fadeWishList() {	
var productsID = itemID;
var productsImage = itemImage;
var productsPath = itemPath;
var productsLev = itemLev2Cat;

var poststr = "wishID=" + productsID + "&cpath=" + productsPath + "&level2Cat=" + productsLev;
ajaxpack.postAjaxRequest("addToWishList.php", poststr, processGetPost, productsImage);

//var productWishList = document.getElementById('productWishList');
//productWishList.innerHTML = '&nbsp;';
////new Effect.Opacity('wishListCart',{ duration: 0.5, from: 1.0, to: 0.0});
	
////setTimeout('fadeWishDelay(\''+productsImage+'\')', 600);  

////new Effect.Opacity('wishListCart',{ duration: 1.0, from: 0.0, to: 1.0, delay:0.5 }); 
}
