function frameSize(size)  {
	document.frmLightboxNames.frmFrameSize.value = size
	document.frmLightboxNames.action = "default.asp"
	document.frmLightboxNames.target = "_top"
	document.frmLightboxNames.submit()
}

function addLb()  {
	document.frmFolders.action = "/designers/addLb.asp"
	document.frmFolders.submit()
}

function deleteLb()  {
	if (confirm("  Are you sure you want to delete \nthis LightBox and all of its contents?"))  {
		document.frmFolders.action = "deleteLb.asp"
		document.frmFolders.submit()
	}
}

function editLogo(id,imageId)  {	
	document.frmFolders.lbImageId.value = imageId
	document.frmFolders.editId.value = id

	document.frmFolders.action = "lbOptions.asp#"+ id
	document.frmFolders.submit()
}	
	
function moveTheLogo(frmLogoId)  {
	document.frmFolders.frmMoveLogo.value = "change"
	document.frmFolders.lbImageId.value = frmLogoId
	document.frmFolders.submit()
}

function viewLogo(logoName,logoId)  {
	document.frmLightboxNames.action = "default.asp"
	document.frmLightboxNames.target = "_top"
	document.frmLightboxNames.frmCurrentFolder.value = escape(logoName)
	document.frmLightboxNames.frmLogoId.value = logoId
	document.frmLightboxNames.frmFrameSize.value = "min"
	document.frmLightboxNames.submit()
}

function lbManager(currentFolder)  {
	document.frmLightboxNames.frmFrameSize.value = "min"
	document.frmLightboxNames.action = "default.asp?options="+ escape(currentFolder)
	document.frmLightboxNames.target = "_top"
	document.frmLightboxNames.submit()
}
	
function removeLogo(lbImagesId)  {
	if (document.location.href.indexOf("lbOptions") > 0)   {
		document.frmFolders.removeLogo.value = lbImagesId
		document.frmFolders.submit()
	}
	else  {
		document.frmLightboxNames.removeLogo.value = lbImagesId
		document.frmLightboxNames.submit()
	}
}

function test()  {
	document.frmFolders.submit();
}




	
	
	


function recIcon(iconHref, iconUrl, tipUrl, altText)
{
	this.iconUrl = new Image();
	this.iconUrl.src = iconUrl;

	this.tipUrl  = new Image();
	this.tipUrl.src  = tipUrl;
	this.altText = altText;
	this.iconHref = iconHref;
}

function addIcon(iconUrl, tipUrl, altText)
{
	addHrefIcon("", iconUrl, tipUrl, altText);
}

function addHrefIcon(iconHref, iconUrl, tipUrl, altText)
{
	iconList[iconList.length] = new recIcon(iconHref, 
	"../../images/" + iconUrl + ".gif", 
	"../images/" + tipUrl + ".gif", 
	altText)
}

function setTip(iRow, strUrl)
{
	var tip = eval("document.images['tipslot"+iRow+"']")
	tip.src = strUrl;
	return true;
}

function setRollover(tipIdx, tipImage, tipText)
{
	setTip(tipIdx, tipImage.src);
	return onText(tipText);
}

function tipOver(iRow, iCol)
{
	return setRollover(iRow, iconList[iCol].tipUrl, iconList[iCol].altText);
}

function tipClearer(iRow)
{
	StatusOff();
	return setTip(iRow, "../../images/roll_blank.gif");
}

function WriteIcons(iRow, iCol, iVS)
{
	if (typeof(iVS) == "undefined") iVS = 3;	// Optional
	var strMouseOut = " onmouseout=tipClearer(" + iRow + ")";
	var strMouseOn  = " onmouseover=\"return tipOver(" + iRow + ",";
	var strOut = "";
	for (var i = 0; i < iconList.length; i++) {
		strOut += "<a" + strMouseOn + i + ")\"" + strMouseOut + " " + iconList[i].iconHref + ">"
		strOut += "<img width=19 height=19 border=0 hspace=3 vspace=" + iVS +" src=" + iconList[i].iconUrl.src + " name=imgIcon" + iRow + iCol + i + " alt='" + iconList[i].altText + "'></a>";
	}
	document.write(strOut);
}	//--- is_rollover 
var iconList = new Array();

function frameLoad()
{
	var strParam = "hdnSync=";
	if (parent.location.href.lastIndexOf("?") != -1) {
		strParam = "&" + strParam;
	} else {
		strParam = "?" + strParam;
	}
	parent.location.href = parent.location.href + strParam;
}

function link(form) 
{        
	var s = location.href;
	var i = s.lastIndexOf("?");
	if (i != -1) s = s.substring(0, i)
	var myindex=form.selList.selectedIndex;
	if (form.selList.options[myindex].value != "0")
		location.href = s + form.selList.options[myindex].value;
}

function minimizeView(minimize)
{
	var s = parent.location.href;
	var i = s.lastIndexOf("?");
	if (i != -1)
		s = s.substring(0, i)
	if (minimize)
		s = s + "?minimizeView=1";
	else
		s = s + "?minimizeView=0";
		
	var elTopFrame = GetFrame("top");	
	if (elTopFrame != null) {
		var hrefTopFrame = elTopFrame.document.location.href;
		i = hrefTopFrame.lastIndexOf("detail.asp");
		if (i != -1)
			s = s + "&detailView=1";
	}	
	parent.location.href = s;
}	

function maximizeView(orderView)
{
	var s = parent.location.href;
	var i = s.lastIndexOf("?");
	if (i != -1)
		s = s.substring(0, i)
	if (orderView)
		s = s + "?orderView=1&minimizeView=0";
	else
		s = s + "?lightboxView=1&minimizeView=0";

	var elTopFrame = GetFrame("top");	
	if (elTopFrame != null) {
		var hrefTopFrame = elTopFrame.document.location.href;
		i = hrefTopFrame.lastIndexOf("detail.asp");
		if (i != -1)
			s = s + "&detailView=1";
	}	
	parent.location.href = s;
}	

function StatusOff()
{ 
	return onText(""); 
}
 
function onText(str)
{ 
	window.status = str; 
	return true; 
}

function lightboxSelected()
{
	var elLightboxesForm = GetForm("frmLightboxNames")
	if (elLightboxesForm != null) {
		elLightboxesForm.submit();
	}
}

function thumbPicked(imageNumber)
{
	var elTopFrame = GetFrame("top");	
	if (elTopFrame != null) {
		elTopFrame.document.location.href = "../search/detail.asp?source=lightbox" + "&imageID=" + imageNumber;
	}
}


var detail = new Image();
detail.src = "../images/search/roll_detail.gif";
function thumbOver(n)	{	return setRollover(n, detail, "View image details"); }

function viewLightbox(lightboxID)
{
//	parent.location.href = "../search/lightbox.asp?source=viewLightbox" + "&lbid=" + lightboxID;
	var strSearch = parent.location.search;
	var strQueryString = ""
	if (strSearch.length > 1)
	{
// look for selDisplayPerPage and selDisplayStyle in the query string:
		var strSearchPairs = strSearch.slice(1).split("&");
		for (var strPair in strSearchPairs)
		{
			var strNameValue = strSearchPairs[strPair].split("=");
			if (strNameValue[0] == "selDisplayPerPage" || strNameValue[0] == "selDisplayStyle")
			{
				strQueryString += "&" + strNameValue[0] + "=" + strNameValue[1];
			}
		}
	}
	parent.location.href = "../search/lightbox.asp?lbid=" + lightboxID + strQueryString;
}

function GetForm(frmName)
{
	el = GetFormInDocument(document, frmName);
	if (el != null) return el; 

	if (document.all == null)
		for (var i = 0; i < document.layers.length; i++) {
			el = GetFormInDocument(document.layers[i].document, frmName);
			if (el != null) return el;
		}
	return null;
}

function GetFormInDocument(inDoc, frmName)
{
	var elForm = null;
	with (inDoc) {

		elForm = forms[frmName];
		if (elForm != null) return elForm;

		for (var i = 0; i < forms.length; i++) {
			if (forms[i].name == frmName)
				return forms[i];
		}

		if (inDoc.all == null)
			for (var i = 0; i < inDoc.layers.length; i++) {
				el = GetFormInDocument(inDoc.layers[i].document, frmName);
				if (el != null) return el;
			}
	}
	return null;
}

function GetFrame(frameName)
{	
	with (parent)
		for (var i = 0; i < frames.length; i++)
			if (frames[i].name == frameName)
				return frames[i];
	return null;
}

function ViewImage_New(strImageID){
    var logoWindow = '';
	PopUpURL = "/logo_details.asp?qstr=" + strImageID
//	logoWindow = window.open(PopUpURL,"ImageView","width=340,height=590,left=5,top=5,resizable,scrollbars=no");
	logoWindow = window.open(PopUpURL,"ImageView","width=340,height=590,left=5,top=5,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no");
	if (!logoWindow.opener) logoWindow.opener = parent;
	logoWindow.focus();
}