//NEW:

//////////////////////////////////////////////////////////////
function portfolioObject(ID,vcLabel,txtCaption,vcThumbPath,vcImagePath) {
	this.ID = ID;
	this.vcLabel = vcLabel;
	this.txtCaption = txtCaption;
	this.vcThumbPath = vcThumbPath;
	this.vcImagePath = vcImagePath;

}

var imgArray = new Array();
var clicked = 0;
var tagCount = 0;

//////////////////////////////////////////////////////////////
function zoomIn(imgID,count) {

	var highest = (imgArray.length)-1;
	var lowest = 0;
	var nextIndex;
	var prevIndex;

	if(count==highest) {
		nextIndex = lowest;
		prevIndex = (parseInt(count)-1);
		}
	else if(count==lowest) {
		nextIndex = (parseInt(count)+1);
		prevIndex = highest;
		}
	else {
		nextIndex = (parseInt(count)+1);
		prevIndex = (parseInt(count)-1);
		}

	var thePortfolioObject = eval("portfolioObject" + imgID);
	var theImg = thePortfolioObject.vcImagePath;
	var theCaption = thePortfolioObject.txtCaption;
	var theLabel = thePortfolioObject.vcLabel;

	var thePreviousObjectID = imgArray[prevIndex];
	var theNextObjectID = imgArray[nextIndex];


	theCaption = theCaption.replace(/&lt;/g, "<");
	theCaption = theCaption.replace(/&gt;/g, ">");

	theLabel = theLabel.replace(/&lt;/g, "<");
	theLabel = theLabel.replace(/&gt;/g, ">");

	document.getElementById("zoom-image-1").innerHTML = "<img src='../../../../" + theImg + "'>";
	document.getElementById("zoom-1-price").innerHTML = theLabel;
	document.getElementById("zoom-1-additional-info").innerHTML = theCaption;

	document.getElementById("prevLink").href = "javascript:zoomIn('" + thePreviousObjectID + "','" + prevIndex + "')";
	document.getElementById("nextLink").href = "javascript:zoomIn('" + theNextObjectID + "','" + nextIndex + "')";



	document.getElementById("zoom-1").style.display = "block";
	//document.getElementById("cover").style.display = "block";
	window.scroll(0,0);

	}


//////////////////////////////////////////////////////////////
function activateAll() {

	deactivateAll();
	var arrLen = imgArray.length;
	var theImgID;

	for(i=0;i<arrLen;i++) {

			theImgID = "thumbBox" + imgArray[i];
			document.getElementById(theImgID).style.display = "inline";
		}
	document.getElementById("ptag0").style.fontWeight = "bold";

	clicked = 0;
	}


//////////////////////////////////////////////////////////////
function deactivateAll() {

	var arrLen = imgArray.length;
	var theImgID;

	for(i=0;i<arrLen;i++) {

			theImgID = "thumbBox" + imgArray[i];
			document.getElementById(theImgID).style.display = "none";
		}

	var theLinkID;
	var theLinkObj;

	for(h=1;h<=tagCount;h++) {

		theLinkID = "ptag" + h;
		theLinkObj = document.getElementById(theLinkID);

		if(theLinkObj) {
			theLinkObj.style.fontWeight = "normal";
			theLinkObj.style.fontSize = "8px";
			}

		}

	}


//////////////////////////////////////////////////////////////
function activateTag(id,num) {

	//if(clicked==0) {

			deactivateAll();

		//}

	var theArray = eval("tagArray" + id);
	var arrLen = theArray.length;
	var theImgID;

	for(i=0;i<arrLen;i++) {

			theImgID = "thumbBox" + theArray[i];
			document.getElementById(theImgID).style.display = "inline";
		}

	var theTagLinkID = "ptag" + num;
	//document.getElementById(theTagLinkID).href = "javascript:deactivateTag(" + id + ")";
	document.getElementById(theTagLinkID).style.fontWeight = "bold";
	document.getElementById(theTagLinkID).style.fontSize = "12px";
	document.getElementById("ptag0").style.fontWeight = "normal";
	clicked = 1;
}

//////////////////////////////////////////////////////////////
function deactivateTag(id) {

	//alert(id);

	var theArray = eval("tagArray" + id);
	var arrLen = theArray.length;
	var theImgID;

	for(i=0;i<arrLen;i++) {

			theImgID = "thumbBox" + theArray[i];
			document.getElementById(theImgID).style.display = "none";

		}

	var theTagLinkID = "ptag" + id;
	document.getElementById(theTagLinkID).href = "javascript:activateTag(" + id + ")";
	document.getElementById(theTagLinkID).style.fontWeight = "normal";
	document.getElementById(theTagLinkID).style.fontSize = "8px";

}

