function removeMenu()
{
document.getElementById("dhtmlgoodies_slidedown_menu").style.display="none";
}
//************************************************************************
//	Function used to clear the options and suggestions boxes in 
//	the main product view
//************************************************************************
function clearOptionBox(productsID) {
	myOptions = '&nbsp;';

	document.getElementById('showTheColors').innerHTML = '<a href="#" style="text-decoration:none; color:#000;" onclick="showColors(' + productsID + ');">COLOR OPTIONS ></a>';
	document.getElementById('showTheSuggestions').innerHTML = '<a href="#" style="text-decoration:none; color:#000;" onclick="showSuggestions(' + productsID + ');">SUGGESTIONS ></a>';	
	document.getElementById('optionBox').style.backgroundImage = myOptions;
	new Effect.Opacity('optionBox',{ duration: 0.0, from: 1.0, to: 0.0 });

}

function prodAppear(){

        var browser = navigator.userAgent.indexOf('MSIE');

  //new Effect.Opacity('slidingProduct1',{ duration: 0.1, from: 1.0, to: 0.0, delay: 0.1 });
//  new Effect.Move ('slidingProduct1',{ x: 407, y: 0, mode: 'relative', duration:0.0, delay: 0.1});
//  new Effect.Move ('slidingProduct1',{ x: -407, y: 0, mode: 'relative', duration:1.0, delay: 0.1});
 // new Effect.Opacity('slidingProduct1',{ duration: 0.1, from: 0.0, to: 1.0, delay: 0.3 });
 // new Effect.Move ('slidingProduct1',{ x: -407, y: 0, mode: 'relative', duration:1.1, delay: 1.5});

        if (browser == -1) {
					//new Effect.Move ('prodDetailsWrapper',{ x: -600, y: 0, mode: 'relative', duration:0.1, delay: 0.1});
        } else {
//					new Effect.Move ('prodDetailsWrapper',{ x: -600, y: 0, mode: 'relative', duration:0.1, delay: 0.1});
//					document.getElementById('prodDetailsWrapper').style.height = '400px';
        }

 // new Effect.Appear('prodDetails1',{ duration: 0.1, delay: 0.2 });
 // new Effect.Appear('prodDetails2',{ duration: 0.1, delay: 0.2 });

        noOfRotations = noOfRotations + 1;

 // new Effect.Appear('prodDetails3',{ duration: 2.0, delay: 1.0 });

  //new Effect.Appear ('scrollProds',{ duration:1.0, delay: 0.5 });

  var prodCount;// = String(document.getElementById('total_records').innerHTML); // loop stopper, product count
  var sdelay = String(1);         // first delay start time
  var dInt = String(0.25);    // delay
  var d = String(1.0);        //duration

  if (navigator.userAgent.indexOf('MSIE 6') != -1 || navigator.userAgent.indexOf('MSIE 7') != -1) {
  	prodCount = 0;
	mainImgCaption.style.padding = '0px 10px 0px 0px';
  }

	if (navigator.userAgent.indexOf('MSIE 6') != -1) {
		document.getElementById('body').style.height = '850px';
	}

//alert(navigator.userAgent);
/*

//  new Effect.Opacity('slidingProduct1',{ duration: 0.1, from: 1.0, to: 0.0, delay: 0.0 });
//  new Effect.Move ('slidingProduct1',{ x: 407, y: 0, mode: 'relative', duration:0.1, delay: 0.1});
  new Effect.Move ('slidingProduct1',{ x: 407, y: 0, mode: 'relative', duration:0.0, delay: 0.1});
//  new Effect.Opacity('slidingProduct1',{ duration: 0.1, from: 0.0, to: 1.0, delay: 3.0 });
//  new Effect.Opacity('slidingProduct1',{ duration: 0.1, from: 0.0, to: 1.0, delay: 0.1 });
//  new Effect.Move ('slidingProduct1',{ x: -407, y: 0, mode: 'relative', duration:1.1, delay: 1.5}); 

	if (browser == -1) {
	  new Effect.Move ('prodDetailsWrapper',{ x: -600, y: 0, mode: 'relative', duration:1.5});
	} else {
		document.getElementById('prodDetailsWrapper').style.height = '400px';
	}
//  new Effect.Appear('prodDetails1',{ duration: 2.0, delay: 1.0 }); 
//  new Effect.Appear('prodDetails2',{ duration: 2.0, delay: 1.0 }); 
  new Effect.Appear('prodDetails1',{ duration: 1.0, delay: 0.1 }); 
  new Effect.Appear('prodDetails2',{ duration: 1.0, delay: 0.1 }); 

//  new Effect.Move ('slidingProduct1',{ x: -407, y: 0, mode: 'relative', duration:1.1, delay: 3.1});
  new Effect.Move ('slidingProduct1',{ x: -407, y: 0, mode: 'relative', duration:1.1, delay: 0.1});
	noOfRotations = noOfRotations + 1;
		
 // new Effect.Appear('prodDetails3',{ duration: 2.0, delay: 1.0 }); 

//  new Effect.Appear ('scrollProds',{ duration:1.5, delay: 1.5 });
  new Effect.Appear ('scrollProds',{ duration:0.5, delay: 0.1 });

  var prodCount = String(document.getElementById('total_records').innerHTML); // loop stopper, product count
  var sdelay = String(1); 	  // first delay start time 
  var dInt = String(0.25);    // delay 
  var d = String(1.0);        //duration
*/

  for (i = 1; i <= parseInt(prodCount); i++) {
  	var elem = document.getElementById('prodImg'+i); // id of element to be passed
	
		if ( i == 1 ) {
	    	new Effect.Appear(elem,{ duration: parseFloat(d), delay: parseFloat(sdelay)  }); 
		} else {
			sdelay = (parseFloat(sdelay) + parseFloat(dInt));
			new Effect.Appear(elem,{ duration: parseFloat(d), delay: parseFloat(sdelay)  }); 
		}

  }

}

function prodChange(itemID){

  new Effect.Opacity('displayIndProduct',{ duration: 0.5, from: 0.1, to: 1.0, delay: 1.5 });

}

function roundNumber(num, dec) {
	var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
	return result;
}

function reloadContent(productsID, productsImage, productsPrice1, productsName, cpath, productsCategory) {

//Browser Support Code
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser does not support Ajax!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var productsDescription = document.getElementById('productsDescription');
			productsDescription.innerHTML = ajaxRequest.responseText;
		}
	}
	var queryString = "?productsID=" + productsID;
	ajaxRequest.open("GET", "getContent.php" + queryString, true);
	ajaxRequest.send(null); 

	var productsForm = document.getElementById('productsForm');

	var productsAddCart = document.getElementsByName('products_id');
    productsAddCart.innerHTML = productsID;
	
	var productsTitle = document.getElementById('productsTitle');
    productsTitle.innerHTML = productsName;
	
	var productsPrice = document.getElementById('priceVal');
    //productsPrice.innerHTML = 'PRICE: &nbsp; $' + productsPrice1;
	productsPrice1.innerHTML = roundNumber(productsPrice1,2);
	
	var TPT = document.getElementById('TPT');
	
	var slidingProduct1 = document.getElementById('slidingProduct1');
    slidingProduct1.innerHTML = '<img src="http://www.tateossian.com/images/' + TPT.innerHTML +'" />';

	var productsWishList = document.getElementById('productsWishList');
    productsWishList.innerHTML = '<a href="#" onclick="fadeWishList(' + productsID + ', \'./images/' + productsImage + '\', \'' + cpath + '\');"><img border="0" src="http://www.tateossian.com/images/viewProducts/wishList.jpg" /></a>';	
	//var productsWishList = document.getElementById('mainImgCaption');
	//mainImgCaption.innerHTML = '<a href="index2.php?view=browse&collectionID=' + productsID + '" style="text-decoration:none; color:#000; float:left; text-align:left;" >[»] VIEW COLLECTION</a><a href="#" style="text-decoration:none; color:#000; float:right;" onclick="zoomImage(' + productsID + ');">[»] ROTATE</a>';
		
    //new Effect.Opacity('displayIndProduct',{ duration: 0.5, from: 0.0, to: 1.0, delay: 1.5 });	
}

function reloadImage(productsID) {
	
	//document.getElementById('prodDetails2').style.width="378px";
	
	var mainImgCaption = document.getElementById('mainImgCaption');

    mainImgCaption.innerHTML = '<a target="_top" href="http://www.tateossian.com/index2.php?view=browse&collectionID=' + productsID + '" style="text-decoration:none; color:#000; float:left; text-align:left;display:none" >> VIEW COLLECTION</a><a href="#" style="text-decoration:none; color:#000; float:right;" onclick="returnImage(' + productsID + ');">[<span style="font-size:1.2em">»</span>] ROTATE</a>';


	var slidingProduct1 = document.getElementById('slidingProduct1');
    slidingProduct1.innerHTML = '<img src="http://www.tateossian.com/images/viewProducts/zoomImage' + productsID + '_in.jpg" />';
    //new Effect.Opacity('displayIndProduct',{ duration: 0.5, from: 0.0, to: 1.0, delay: 1.5 });	
}

function makeImageSmaller(productsID) {
	
	//document.getElementById('prodDetails2').style.width="288px";
	//reloadImage(productsID);	
	var mainImgCaption = document.getElementById('mainImgCaption');
    mainImgCaption.innerHTML = '<a target="_top" href="http://www.tateossian.com/index2.php?view=browse&collectionID=' + productsID + '" style="text-decoration:none; color:#000; float:left; text-align:left;display:none" >> VIEW COLLECTION</a><a href="#" style="text-decoration:none; color:#000; float:right;" onclick="zoomImage(' + productsID + ');">> ROTATE</a>';

	var slidingProduct1 = document.getElementById('slidingProduct1');
    slidingProduct1.innerHTML = '<img src="http://www.tateossian.com/images/viewProducts/zoomImage' + productsID + '.jpg" />';
    //new Effect.Opacity('displayIndProduct',{ duration: 0.5, from: 0.0, to: 1.0, delay: 1.5 });	
}

function resetReloadTimeout() {
	reloadTimeout = 0;	
}

var reloadTimeout = 0;

function loadContentItem(itemID, itemImage, itemPrice, itemName, itemPath, itemCategory) {


	if (reloadTimeout == 0) {
		reloadTimeout = 1;	
			
		var productsID = itemID;
		var productsImage = itemImage;
		var productsName = itemName;
		var productsPrice = itemPrice;
		var productsPath = itemPath;
		var productsCategory = itemCategory;
	
		//clearOptionBox(productsID);
	
		new Effect.Opacity('slidingProduct1',{ duration: 0.2, from: 1.0, to: 0.0, delay: 0.0 });
		new Effect.Opacity('prodDetailsWrapper',{ duration: 0.2, from: 1.0, to: 0.0 });
		new Effect.Move ('prodDetailsWrapper',{ x: 800, y: 0, mode: 'relative', duration:0.1, delay: 0.2});
		new Effect.Opacity('prodDetailsWrapper',{ duration: 0.1, from: 0.0, to: 1.0, delay: 0.3 });
		new Effect.Move ('prodDetailsWrapper',{ x: -800, y: 0, mode: 'relative', duration:1.5, delay: 0.4});	
	
		new Effect.Opacity('slidingProduct1',{ duration: 0.1, from: 1.0, to: 0.0, delay: 0.0 });
		new Effect.Move ('slidingProduct1',{ x: offset + 407, y: 0, mode: 'relative', duration:0.1, delay: 0.1});
		new Effect.Opacity('slidingProduct1',{ duration: 0.1, from: 0.0, to: 1.0, delay: 1.5 });	
		new Effect.Move ('slidingProduct1',{ x: -407, y: 0, mode: 'relative', duration:1.1, delay: 1.6});
		offset = 0;
		noOfRotations = 1;
		//setTimeout('reloadContent(\''+productsID+'\', \''+productsImage+'\', \''+productsPrice+'\', \''+productsName+'\', \''+productsPath+'\', \''+productsCategory+'\')', 800);  
		setTimeout('resetReloadTimeout()',2500); //this disables the loader from accidentally loading another item until the previous finishes.  set at 2.5 seconds
	} 
}

function zoomImage(itemID) {

	var productsID = itemID;
	
	// wipe effect
	new Effect.Opacity('prodDetails2',{ duration: 0.2, from: 1.0, to: 0.0 });

	new Effect.Move ('prodDetails2',{ x: 400, y: 0, mode: 'relative', duration:0.1, delay: 0.25});
	new Effect.Opacity('prodDetails2',{ duration: 0.1, from: 0.0, to: 1.0, delay: 0.3 });
	new Effect.Move ('prodDetails2',{ x: -400, y: 0, mode: 'relative', duration:1.0, delay: 0.4});
	  
	setTimeout('reloadImage(\''+productsID+'\')', 800);  
	
}

function resetRotationTimeout() {
	rotationTimeout = 0;	
}

noOfRotations = 0;
offset = 0;
var rotationTimeout = 0;

function rotateImage(itemID) {

	if (rotationTimeout==0) {
		
		rotationTimeout = 1;

		var productsID = itemID;
	
		noOfRotations = noOfRotations+1;
		if (noOfRotations>3) {
			setTimeout('resetRotationTimeout()',2200); //this disables the loader from accidentally loading another item until the previous finishes.  set at 2.5 seconds
			new Effect.Move ('slidingProduct1',{ x: -407, y: 0, mode: 'relative', duration:1.1, delay: 0.0});
			new Effect.Opacity('slidingProduct1',{ duration: 0.1, from: 1.0, to: 0.0, delay: 1.1 });
			new Effect.Move ('slidingProduct1',{ x: offset + 814, y: 0, mode: 'relative', duration:0.1, delay: 1.2});
			new Effect.Opacity('slidingProduct1',{ duration: 0.1, from: 0.0, to: 4.0, delay: 1.3 });
			new Effect.Move ('slidingProduct1',{ x: -407, y: 0, mode: 'relative', duration:1.1, delay: 1.4});
			noOfRotations=1;
			offset=0;
			//alert(noOfRotations);
		} else {
			setTimeout('resetRotationTimeout()',1300); //this disables the loader from accidentally loading another item until the previous finishes.  set at 2.5 seconds
			new Effect.Move ('slidingProduct1',{ x: -407, y: 0, mode: 'relative', duration:1.1, delay: 0.0});	
			offset = offset + 407;
		}

	}
	
}

function returnImage(itemID) {

	var productsID = itemID;
	
	// wipe effect
	new Effect.Opacity('prodDetails2',{ duration: 0.2, from: 1.0, to: 0.0 });

	new Effect.Move ('prodDetails2',{ x: 400, y: 0, mode: 'relative', duration:0.1, delay: 0.25});
	new Effect.Opacity('prodDetails2',{ duration: 0.1, from: 0.0, to: 1.0, delay: 0.3 });
	new Effect.Move ('prodDetails2',{ x: -400, y: 0, mode: 'relative', duration:1.5, delay: 0.4});


	setTimeout('makeImageSmaller(\''+productsID+'\')', 800);  
	
}

function scrollImgMove(dir,count){

	var cPos = document.getElementById('curPos2');
	var cPosBeg = document.getElementById('curPos2Begin');
	var cPosEnd = document.getElementById('curPos2End');
	
  	var prodCount = document.getElementById('total_records').innerHTML; // loop stopper, product count
 	//alert(prodCount);
    
//	if (cPos.value <= 0){
//		document.getElementById('scrollLeft').onclick = "";
//	} else if (cPos.value >= parseInt(maxPos)){
//		document.getElementById('scrollRight').onclick = "";
//	} else {
//		document.getElementById('scrollRight').onclick = scrollImgMove(dir);
//		document.getElementById('scrollLeft').onclick = scrollImgMove(dir);
//	}
	var bName = navigator.appName;
	var bVer = navigator.appVersion;

	if (dir == 'left'){
		if (parseInt(cPos.innerHTML) > 7){
			//if (bName=='Microsoft Internet Explorer' && bVer.match("MSIE 6.0") == 'MSIE 6.0') {
			if (bName=='Microsoft Internet Explorer' && bVer.match("MSIE 6.0") == 'MSIE 6.0'){	
					new Effect.Move ('scrollImgWrapperMover',{ x: 658, y: 0, mode: 'relative', duration:1, delay:0.0});
			} else {
					new Effect.Move ('scrollImgWrapperMover',{ x: 651, y: 0, mode: 'relative', duration:1, delay:0.0});
			}
			cPos.innerHTML = String(parseInt(cPos.innerHTML)-7);   //we want these to load when the box is clicked
			cPosBeg.innerHTML = String(parseInt(cPosBeg.innerHTML)-7);
			if ((parseInt(cPosEnd.innerHTML)-7) < prodCount) {
				cPosEnd.innerHTML = String(prodCount);	
			} else {
				cPosEnd.innerHTML = String(parseInt(cPosEnd.innerHTML)-7);	
			}			
			
			document.getElementById('scrollLeft').onclick = "";
			document.getElementById('scrollRight').onclick = "";
			setTimeout("document.getElementById('scrollRight').className = 'scrollRight'", 1000);		
			setTimeout("document.getElementById('scrollRight').onclick = function(){scrollImgMove('right'," + prodCount + ")}", 1000);
			if (parseInt(cPos.innerHTML) == 7) {
				document.getElementById('scrollLeft').className = 'scrollLeftDis';
			} else {
				document.getElementById('scrollLeft').className = 'scrollLeft';
				setTimeout("document.getElementById('scrollLeft').onclick = function(){scrollImgMove('left'," + prodCount + ")}", 1000);
			}
		} else if (parseInt(cPos.innerHTML) <= 7){
			document.getElementById('scrollRight').className = 'scrollRight';		
		} 
	} else {
		if (parseInt(cPos.innerHTML) < prodCount){
			
			//if (bName=='Microsoft Internet Explorer' && bVer.match("MSIE 6.0") == 'MSIE 6.0') {
			if (bName=='Microsoft Internet Explorer' && bVer.match("MSIE 6.0") == 'MSIE 6.0'){	
				new Effect.Move ('scrollImgWrapperMover',{ x: -658 , y: 0, mode: 'relative', duration:1, delay:0.0});
			} else {
				new Effect.Move ('scrollImgWrapperMover',{ x: -651 , y: 0, mode: 'relative', duration:1, delay:0.0});
			}
			
			cPos.innerHTML = String(parseInt(cPos.innerHTML)+7);
			cPosBeg.innerHTML = String(parseInt(cPosBeg.innerHTML)+7);
			if ((parseInt(cPosEnd.innerHTML)+7) > prodCount) {
				cPosEnd.innerHTML = String(prodCount);	
			} else {
				cPosEnd.innerHTML = String(parseInt(cPosEnd.innerHTML)+7);	
			}	
			
			document.getElementById('scrollLeft').onclick = "";
			document.getElementById('scrollRight').onclick = "";
			setTimeout("document.getElementById('scrollLeft').className = 'scrollLeft';", 1000);
			setTimeout("document.getElementById('scrollLeft').onclick = function(){scrollImgMove('left'," + prodCount + ")}", 1001);
			if (parseInt(cPos.innerHTML) >= prodCount){
				document.getElementById('scrollRight').className = 'scrollRightDis';
			} else {
				document.getElementById('scrollRight').className = 'scrollRight';
				setTimeout("document.getElementById('scrollRight').onclick = function(){scrollImgMove('right'," + prodCount + ")}", 1000);
			}
		} else if (parseInt(cPos.innerHTML) >= (prodCount)){
			document.getElementById('scrollLeft').className = 'scrollLeft';
		}
	}
}

function initImgMove(count){

	var cPos = document.getElementById('curPos2');
	var cPosBeg = document.getElementById('curPos2Begin');
	var cPosEnd = document.getElementById('curPos2End');
	
  	var prodCount = document.getElementById('total_records').innerHTML; // loop stopper, product count
	var bName = navigator.appName;
	var bVer = navigator.appVersion;

	if (bName=='Microsoft Internet Explorer' && bVer.match("MSIE 6.0") == 'MSIE 6.0'){	
		for (var i=1;i<=count;i=i+7) {
			if (count > i) {
				new Effect.Move ('scrollImgWrapperMover',{ x: -658 , y: 0, mode: 'relative', duration:0, delay:0.0});
				cPos.innerHTML = String(parseInt(cPos.innerHTML)+7);
				cPosBeg.innerHTML = String(parseInt(cPosBeg.innerHTML)+7);
				if ((parseInt(cPosEnd.innerHTML)+7) > prodCount) {
					cPosEnd.innerHTML = String(prodCount);	
				} else {
					cPosEnd.innerHTML = String(parseInt(cPosEnd.innerHTML)+7);	
				}	
			}
		}
	} else {
		for (var i=1;i<=count;i=i+7) {
			if (count > i+6) {
				new Effect.Move ('scrollImgWrapperMover',{ x: -651 , y: 0, mode: 'relative', duration:0, delay:0.0});
				cPos.innerHTML = String(parseInt(cPos.innerHTML)+7);
				cPosBeg.innerHTML = String(parseInt(cPosBeg.innerHTML)+7);
				if ((parseInt(cPosEnd.innerHTML)+7) > prodCount) {
					cPosEnd.innerHTML = String(prodCount);	
				} else {
					cPosEnd.innerHTML = String(parseInt(cPosEnd.innerHTML)+7);	
				}	
			}
		}
	}

	document.getElementById('scrollLeft').onclick = "";
	document.getElementById('scrollRight').onclick = "";
	if (count>7) {
		setTimeout("document.getElementById('scrollLeft').onclick = function(){scrollImgMove('left'," + prodCount + ")};", 101);
		document.getElementById('scrollLeft').className = 'scrollLeft';
	}
	if (Math.floor((count-1)/7)<Math.floor((prodCount-1)/7)) {
		setTimeout("document.getElementById('scrollRight').onclick = function(){scrollImgMove('right'," + prodCount + ")}", 100);
		document.getElementById('scrollRight').className = 'scrollRight';
	} else {
		document.getElementById('scrollRight').className = 'scrollRightDis';
	}

}



//************************************************************************
//	Function used to load the color options image into the  
//	the main product view
//************************************************************************
function loadOptionBoxColors() {
	var bName = navigator.appName;
	var bVer = navigator.appVersion;
	
	document.getElementById('showTheColors').style.display = "none";
	document.getElementById('showTheSuggestions').style.display = "";
	document.getElementById('optionBox').innerHTML='';

	if (document.getElementById('colorItems')) {
		for (var i=0; i <= document.getElementById('colorItems').innerHTML; i++) {
			myCImg = 'color' + i + 'Image';
			myCID = 'color' + i + 'ID';

			if (document.getElementById('color' + i + 'ID')) {
//				myLink = "<a target='_top' href='http://www.tateossian.com/catalog/product_info.php?view=browse&level2Cat=" + document.getElementById('level2Cat').innerHTML + "&wishString=" + document.getElementById('wishString').innerHTML + "&cpath=" + document.getElementById('cpath').innerHTML + "&category_id="  + document.getElementById('category_id').innerHTML +  "&products_id=" + document.getElementById('color' + i + 'ID').innerHTML + "&currency=" + querySt('currency') + "'>";
				myLink = "<a target='_top' href='http://www.tateossian.com/catalog/product_info.php?view=browse&level2Cat=" + document.getElementById('level2Cat').innerHTML + "&wishString=" + document.getElementById('wishString').innerHTML + "&cpath=" + document.getElementById('cpath').innerHTML + "&category_id="  + document.getElementById('category_id').innerHTML +  "&products_id=" + document.getElementById('color' + i + 'ID').innerHTML + "'>";
			}
			if (self.location.href.match(/\/wholesale\//)) {
				myLink = myLink.replace(/\/catalog\//,'/wholesale/');
			}

			//if (bName=='Microsoft Internet Explorer'){	
			//	document.getElementById('optionBox').innerHTML = document.getElementById('optionBox').innerHTML + myLink + '<img width="81px" border=0 src="./images/' + document.getElementById('color' + i + 'Image').innerHTML + '" /></a>';
			//} else {
			if (document.getElementById('color' + i + 'ID')) {
				document.getElementById('optionBox').innerHTML = document.getElementById('optionBox').innerHTML + myLink + '<img width="90px" border=0 src="http://www.tateossian.com/images/' + document.getElementById('color' + i + 'Image').innerHTML + '" /></a>';
			}
			//}
		}
	}
}

//************************************************************************
//	Function used to load the suggestions image into the  
//	the main product view
//************************************************************************
function loadOptionBoxSuggestions() {

	var bName = navigator.appName;
	var bVer = navigator.appVersion;
	
	
	//clearOptionBox(productsID);
	////myOptions = 'url(./images/viewProducts/related/colors' + itemImage + '_m.jpg)';
	//new Effect.Opacity('optionBox',{ duration: 0.2, from: 0.0, to: 1.0, delay: 0.0 });
	
	//document.getElementById('showTheSuggestions').innerHTML = '<a href="#" style="text-decoration:none; color:#000;" onclick="showSuggestions(' + productsID + ');">SUGGESTIONS ></a>';		
	document.getElementById('showTheColors').style.display = "";
	document.getElementById('showTheSuggestions').style.display = "none";
	document.getElementById('optionBox').innerHTML='';

	for (var i=0; i <= document.getElementById('sugItems').innerHTML; i++) {
		mySImg = 'sug' + i + 'Image';
		mySID = 'sug' + i + 'ID';

		if (document.getElementById('sug' + i + 'ID')) {
			myLink = "<a target='_top' href='http://www.tateossian.com/catalog/product_info.php?view=browse&level2Cat=" + document.getElementById('level2Cat').innerHTML + "&wishString=" + document.getElementById('wishString').innerHTML + "&cpath=" + document.getElementById('cpath').innerHTML + "&category_id="  + document.getElementById('category_id').innerHTML +  "&products_id=" + document.getElementById('sug' + i + 'ID').innerHTML + "'>";
		}
		if (self.location.href.match(/\/wholesale\//)) {
			myLink = myLink.replace(/\/catalog\//,'/wholesale/');
		}
		//if (bName=='Microsoft Internet Explorer'){	
		//	document.getElementById('optionBox').innerHTML = document.getElementById('optionBox').innerHTML + myLink + '<img width="81px" border=0 src="./images/' + document.getElementById('sug' + i + 'Image').innerHTML + '" /></a>';
		//} else {
		if (document.getElementById('sug' + i + 'ID')) {
			if (i > 0) {
				document.getElementById('optionBox').innerHTML = document.getElementById('optionBox').innerHTML + myLink + '<img width="90px" border=0 src="http://www.tateossian.com/images/' + document.getElementById('sug' + i + 'Image').innerHTML + '" style="border-left:1px solid #EAF2F2;"/></a>';	
			} else {
				document.getElementById('optionBox').innerHTML = document.getElementById('optionBox').innerHTML + myLink + '<img width="90px" border=0 src="http://www.tateossian.com/images/' + document.getElementById('sug' + i + 'Image').innerHTML + '"/></a>';	
			}
		}
		//}
	
	}
	
}

//************************************************************************
//	Function used to fade in the suggestions image for  
//	the main product view
//************************************************************************
function showSuggestions() {
	//var productsID = itemID;
	//var productsImage = itemImage;
	
	setTimeout('loadOptionBoxSuggestions()', 500);  
}

//************************************************************************
//	Function used to fade in the color options image for  
//	the main product view
//************************************************************************
function showColors() {
	//var productsID = itemID;
	//var productsImage = itemImage;
	
	setTimeout('loadOptionBoxColors()', 500); 
}

function querySt(ji) {
	hu = window.location.search.substring(1);
	gy = hu.split("&");
	for (i=0;i<gy.length;i++) {
		ft = gy[i].split("=");
		if (ft[0] == ji) {
			return ft[1];
		}
	}
}
