function WriteFlashWithID(strID,SWFPath,SWFWidth,SWFHeight,SWFParams) {
	try {
		var str = '\n';
		var NewParams = '';
		str+='	<object name="' + strID + '" id="' + strID + '" type="application\/x-shockwave-flash" data="' + SWFPath + '" width="' + SWFWidth + '" height="' + SWFHeight + '" title="">\n';
		str+='		<param name="wmode" value="transparent">\n';
		str+='		<param name="movie" value="' + SWFPath + '">\n';
		if(typeof(SWFParams) != "undefined"){
			var SWFParamsArray = SWFParams.split(';');
			for (var i=0; i<SWFParamsArray.length; i++) {
				var EachParam = SWFParamsArray[i].split('|');
				NewParams+='		<param name="' + EachParam[0] + '" VALUE="' + EachParam[1] + '">\n';
			}
			str+=NewParams;
		}
		str+='	<\/object>\n';
		document.write(str);
	} catch(e) {}
}



function WriteFlash(SWFPath,SWFWidth,SWFHeight,SWFParams) {
	try {
		var str = '\n';
		var NewParams = '';
		str+='	<object type="application\/x-shockwave-flash" data="' + SWFPath + '" width="' + SWFWidth + '" height="' + SWFHeight + '" title="">\n';
		str+='		<param name="wmode" value="transparent">\n';
		str+='		<param name="movie" value="' + SWFPath + '">\n';
		if(typeof(SWFParams) != "undefined"){
			var SWFParamsArray = SWFParams.split(';');
			for (var i=0; i<SWFParamsArray.length; i++) {
				var EachParam = SWFParamsArray[i].split(',');
				NewParams+='		<param name="' + EachParam[0] + '" VALUE="' + EachParam[1] + '">\n';
			}
			str+=NewParams;
		}
		str+='	<\/object>\n';
		document.write(str);
	} catch(e) {}
}





// Pop-up window at 500x400
function PopWin500x400(url) {
	newWindow = window.open(url,"","toolbar=no,location=no,scrollbars=yes,width=500,height=400");
}

// Generic Pop-up window where you pass width and height
function PopWin(url,strWidth,strHeight) {
	newWindow = window.open(url,"","toolbar=no,location=no,scrollbars=yes,width="+strWidth+",height="+strHeight);
}




// Folders View Gallery Functions

// Set the variable outside of the functions
var OldThumb;
var CurrentPos;

function ShowBigImg(pos,thumbImg) {
	try {
		var spacerPath = "/files/images/std/spacer.gif";
		var tmpWidth;
		var tmpHeight;

		// Reset large photo to new image
		var BigPhoto = window.document.getElementById("BigPhoto");
		BigPhoto.src = spacerPath;

		// Pass in the thumbnail image you've clicked, then set the old one to clear the class, then set the class on the one you clicked
		var NewThumb = thumbImg;
		if(OldThumb==undefined){
		}else{
			var OldThumbImg = document.getElementById(OldThumb);
			OldThumbImg.className = "";
		}
		var NewThumbImg = document.getElementById(NewThumb);
		NewThumbImg.className = "Sel";

		OldThumb = NewThumb;
		CurrentPos = pos;

		BigPhoto.src = AllImgs[pos];
	} catch(e) {}
}

function SimplePrevNext(ArrayName,PN){
	try{
		ArrayCount = parseInt(eval(ArrayName + ".length"));
		ArrayPos = parseInt(CurrentPos);
		CollectionPos = parseInt(ArrayPos + 1);

		if(PN=="P"){
			if(ArrayPos==0 || ArrayPos==undefined){
				PrevArrayPos = parseInt(ArrayCount-1);
				PrevCollectionPos = ArrayCount;
			}else{
				PrevArrayPos = parseInt(ArrayPos-1);
				PrevCollectionPos = parseInt(CollectionPos-1);
			}
			NewArrayPos = PrevArrayPos
			NewCollectionPos = PrevCollectionPos
		}else{

			if(CollectionPos>=ArrayCount){
				NextArrayPos = parseInt(0);
				NextCollectionPos = parseInt(1);
			}else{
				NextArrayPos = parseInt(ArrayPos+1);
				NextCollectionPos = parseInt(CollectionPos+1);
			}
			NewArrayPos = NextArrayPos
			NewCollectionPos = NextCollectionPos
		}

		NewThumb = "Thumb_" + NewArrayPos;
		ShowBigImg(NewArrayPos,NewThumb);
	}catch(e){}
}
