<!--
//
function getObj(name)
	{
	if (document.getElementById)
		{
		return document.getElementById(name);
		}
	else if (document.all)
		{
		return document.all[name];
		}
	else
		{
		return false;
		}
	}
//
function calcAge(type)
	{
	Mon = getObj(type+"_Mon").options[getObj(type+"_Mon").selectedIndex].value;
	Day = getObj(type+"_Day").options[getObj(type+"_Day").selectedIndex].value;
	Year = getObj(type+"_Year").options[getObj(type+"_Year").selectedIndex].value;

	dt = new Date();
	mn = dt.getMonth()+1;
	dy = dt.getDate();
	yr = dt.getFullYear();
	var age = yr - Year;
	
	if (dy < Day) --mn;
	if (mn < Mon) --age;
	getObj("age").firstChild.data = age;
	return true;
	}
//
function viewWindow()
	{
	obj = getObj("viewWindow");
	getObj("vwSpan1").firstChild.data = this.previousSibling.previousSibling.firstChild.data;
	getObj("vwSpan2").firstChild.data = this.previousSibling.previousSibling.previousSibling.firstChild.data;
	getObj("vwSpan3").className = "vwSpan";
	getObj("vwID").src = this.name;
	}
//
function add_new(scene)
	{
	index = getObj("ID_add").options[getObj("ID_add").selectedIndex].value;
	if (index!="choose" && incID[index] == 0)
		{
		incID[index] = addID[index];
		addP(index,scene);
		createP();
		}
	}
function add_newp(scene)
	{
	index = getObj("Prod_add").options[getObj("Prod_add").selectedIndex].value;
	if (index!="choose" && incIDp[index] == 0)
		{
		incIDp[index] = addIDp[index];
		addPp(index,scene);
		createPp();
		}
	}
//
function add_newl(scene)
	{
	index = getObj("Loc_add").options[getObj("Loc_add").selectedIndex].value;
	if (index!="choose" && incIDl[index] == 0)
		{
		incIDl[index] = addIDl[index];
		addPl(index,scene);
		createPl();
		}
	}
//
function adminPopWinID(folder)
	{
	if (folder)
		window.open('?pa=content&actn=prevDocs&folder=ID~'+folder,'ID','width=800,height=768,scrollbars=yes,left=0,top=0,screenX=0,screenY=0');
	else
		window.open('?pa=content&actn=prevDocs&folder='+this.name,'ID','width=800,height=768,scrollbars=yes,left=0,top=0,screenX=0,screenY=0');
	}
//
function adminPopWinRel()
	{
	window.open('?pa=content&actn=prevDocs&folder='+this.name,'RELEASE','width=800,height=768,scrollbars=yes,left=0,top=0,screenX=0,screenY=0');
	}
//
function addP(index,scene)
	{
	main = document.createElement("SPAN");
	main.setAttribute("id", "main"+index);

	span = document.createElement("SPAN");
	span.style.visibility = "hidden";
	span.style.display = "none";
	span.appendChild(document.createTextNode(addOver[index]));
	main.appendChild(span);

	span = document.createElement("SPAN");
	span.style.visibility = 'hidden';
	span.style.display = 'none';
	span.appendChild(document.createTextNode(addOver2[index]));
	main.appendChild(span);

	input = document.createElement("INPUT");
	input.setAttribute("type", "hidden");
	input.setAttribute("name", "add_"+addID[index]);
	input.setAttribute("value", addID[index]);
	main.appendChild(input);

	span = document.createElement("SPAN");
	span.className = "tdCellb";
	if (scene!=false)
		{
		span.name = "http://www.mycontentengine.com/Performers/"+perfFolder[index]+"/"+perfFolder[index]+"60.jpg";
		ahref = "?pa=performers&actn=edit&2257ID="+incID[index];
		}
	else
		{
		span.name = "http://www.1000facials.com/Content/"+sceneFolder[index]+"/thumbs/"+sceneFolder[index]+"60.jpg";
		ahref = "?pa=content&actn=edit&sceneID="+incID[index];
		}
	if (scene!=null)
		{
		a = document.createElement("A");
		a.href = ahref;
		a.name = "ID~"+perfFolder[index]+"~"+sceneFolder[index];
		a.style.cursor = "hand";
		a.appendChild(document.createTextNode(addDisplay[index]));
		}
	else
		{
		a = document.createTextNode(addDisplay[index]);
		}
	span.appendChild(a);
	span.setAttribute("onmouseover", viewWindow, true);
	main.appendChild(span);

	if (addDisplay2[index])
		{
		span = document.createElement("SPAN");
		span.className = "tdCell2";
		span.appendChild(document.createTextNode(addDisplay2[index]));
		main.appendChild(span);
		}

	if (scene!=false)
		{
		if (addDisplay4[index] == 'YES')
			{
			span = document.createElement("SPAN");
			span.className = "checkLeft";
			a = document.createElement("A");
			a.name = "ID~"+perfFolder[index]+"~"+sceneFolder[index];
			a.style.cursor = "hand";
			a.onclick = adminPopWinID;
			img = document.createElement("IMG");
			img.setAttribute("src", "html/images/view.gif");
			img.style.width = 18;
			img.style.height = 14;
			img.style.border = 0;
			a.appendChild(img);
			span.appendChild(a);
			main.appendChild(span);
			}
		}

	if (addDisplay3[index] == 'YES')
		{
		span = document.createElement("SPAN");
		span.className = "check2";
		a = document.createElement("A");
		a.name = "REL~"+perfFolder[index]+"~"+sceneFolder[index];
		a.style.cursor = "hand";
		a.onclick = adminPopWinRel;
		img = document.createElement("IMG");
		img.setAttribute("src", "html/images/view.gif");
		img.style.width = 18;
		img.style.height = 14;
		img.style.border = 0;
		a.appendChild(img);
		span.appendChild(a);
		main.appendChild(span);
		}

	if (scene==true)
		{
		span = document.createElement("SPAN");
		span.className = "actions";
		span.style.width = 70;
		a = document.createElement("A");
		a.className = "button2";
		a.setAttribute("href", "#");
		a.setAttribute("id", index);
		a.setAttribute("onclick", remP, false);
		font = document.createElement("FONT");
		font.className = "buttonF";
		font.appendChild(document.createTextNode("remove"));
		a.appendChild(font);
		span.appendChild(a);
		main.appendChild(span);
		}
	getObj("included").appendChild(main);
	}
//
function addPp(index,scene)
	{
	main = document.createElement("SPAN");
	main.setAttribute("id", "mainp"+index);

	span = document.createElement("SPAN");
	span.style.visibility = "hidden";
	span.style.display = "none";
	span.appendChild(document.createTextNode(addOverp[index]));
	main.appendChild(span);

	span = document.createElement("SPAN");
	span.style.visibility = 'hidden';
	span.style.display = 'none';
	span.appendChild(document.createTextNode(addOver2p[index]));
	main.appendChild(span);

	input = document.createElement("INPUT");
	input.setAttribute("type", "hidden");
	input.setAttribute("name", "addp_"+addIDp[index]);
	input.setAttribute("value", addIDp[index]);
	main.appendChild(input);

	span = document.createElement("SPAN");
	span.className = "tdCellb";
	if (scene!=false)
		{
		span.name = "http://www.mycontentengine.com/producers/"+prodFolder[index]+"/"+prodFolder[index]+".jpg";
		ahref = "?pa=producers&actn=edit&prodID="+incIDp[index];
		}
	else
		{
		span.name = "http://www.1000facials.com/Content/"+sceneFolder[index]+"/thumbs/"+sceneFolder[index]+"60.jpg";
		ahref = "?pa=content&actn=edit&sceneID="+incIDp[index];
		}
	if (scene!=null)
		{
		a = document.createElement("A");
		a.href = ahref;
		a.name = "ID~"+prodFolder[index]+"~"+sceneFolderp[index];
		a.style.cursor = "hand";
		a.appendChild(document.createTextNode(addDisplayp[index]));
		}
	else
		{
		a = document.createTextNode(addDisplayp[index]);
		}
	span.appendChild(a);
	if (scene==false)
		span.setAttribute("onmouseover", viewWindow, true);
	main.appendChild(span);

	if (addDisplay2p[index])
		{
		span = document.createElement("SPAN");
		span.className = "tdCell2";
		span.appendChild(document.createTextNode(addDisplay2p[index]));
		main.appendChild(span);
		}

	if (scene==true)
		{
		span = document.createElement("SPAN");
		span.className = "actions";
		span.style.width = 70;
		a = document.createElement("A");
		a.className = "button2";
		a.setAttribute("href", "#");
		a.setAttribute("id", index);
		a.setAttribute("onclick", remPp, false);
		font = document.createElement("FONT");
		font.className = "buttonF";
		font.appendChild(document.createTextNode("remove"));
		a.appendChild(font);
		span.appendChild(a);
		main.appendChild(span);
		}
	getObj("includedp").appendChild(main);
	}
//
function addPl(index,scene)
	{
	main = document.createElement("SPAN");
	main.setAttribute("id", "mainl"+index);

	span = document.createElement("SPAN");
	span.style.visibility = "hidden";
	span.style.display = "none";
	span.appendChild(document.createTextNode(addOverl[index]));
	main.appendChild(span);

	span = document.createElement("SPAN");
	span.style.visibility = 'hidden';
	span.style.display = 'none';
	span.appendChild(document.createTextNode(addOver2l[index]));
	main.appendChild(span);

	input = document.createElement("INPUT");
	input.setAttribute("type", "hidden");
	input.setAttribute("name", "addp_"+addIDl[index]);
	input.setAttribute("value", addIDl[index]);
	main.appendChild(input);

	span = document.createElement("SPAN");
	span.className = "tdCellb";
	if (scene!=false)
		{
		span.name = "http://www.mycontentengine.com/locations/"+locFolder[index]+"/"+locFolder[index]+".jpg";
		ahref = "?pa=locations&actn=edit&locID="+incIDl[index];
		}
	else
		{
		span.name = "http://www.1000facials.com/Content/"+sceneFolder[index]+"/thumbs/"+sceneFolder[index]+"60.jpg";
		ahref = "?pa=content&actn=edit&sceneID="+incIDl[index];
		}
	if (scene!=null)
		{
		a = document.createElement("A");
		a.href = ahref;
		a.name = "ID~"+locFolder[index]+"~"+sceneFolderl[index];
		a.style.cursor = "hand";
		a.appendChild(document.createTextNode(addDisplayl[index]));
		}
	else
		{
		a = document.createTextNode(addDisplayl[index]);
		}
	span.appendChild(a);
	if (scene==false)
		span.setAttribute("onmouseover", viewWindow, true);
	main.appendChild(span);

	if (addDisplay2l[index])
		{
		span = document.createElement("SPAN");
		span.className = "tdCell2";
		span.appendChild(document.createTextNode(addDisplay2l[index]));
		main.appendChild(span);
		}

	if (scene==true)
		{
		span = document.createElement("SPAN");
		span.className = "actions";
		span.style.width = 70;
		a = document.createElement("A");
		a.className = "button2";
		a.setAttribute("href", "#");
		a.setAttribute("id", index);
		a.setAttribute("onclick", remPl, false);
		font = document.createElement("FONT");
		font.className = "buttonF";
		font.appendChild(document.createTextNode("remove"));
		a.appendChild(font);
		span.appendChild(a);
		main.appendChild(span);
		}
	getObj("includedl").appendChild(main);
	}
//
function remP()
	{
	obj = getObj("main"+this.id);
	while (obj.hasChildNodes() == true) obj.removeChild(obj.childNodes[0]);
	obj.removeNode();
	incID[this.id] = 0;
	createP();
	}
//
function remPp()
	{
	obj = getObj("mainp"+this.id);
	while (obj.hasChildNodes() == true) obj.removeChild(obj.childNodes[0]);
	obj.removeNode();
	incIDp[this.id] = 0;
	createPp();
	}
//
function remPl()
	{
	obj = getObj("mainl"+this.id);
	while (obj.hasChildNodes() == true) obj.removeChild(obj.childNodes[0]);
	obj.removeNode();
	incIDl[this.id] = 0;
	createPl();
	}
//
function createP()
	{
	obj = getObj("ID_add")
	while (obj.hasChildNodes() == true) obj.removeChild(obj.childNodes[0]);
	for (index=0; index<addDisplay.length; index++)
		{
		if (incID[index] == 0)
			obj.add( new Option(addDisplay[index],index,false,false), index);
		}
	obj.add( new Option("Choose a Performer...","choose",false,false), false);
	obj.options[0].selected = "selected";
	}
//
function createPp()
	{
	obj = getObj("Prod_add")
	while (obj.hasChildNodes() == true) obj.removeChild(obj.childNodes[0]);
	for (index=0; index<addDisplayp.length; index++)
		{
		if (incIDp[index] == 0)
			obj.add( new Option(addDisplayp[index],index,false,false), index);
		}
	obj.add( new Option("Choose a Producer...","choose",false,false), false);
	obj.options[0].selected = "selected";
	}
//
function createPl()
	{
	obj = getObj("Loc_add")
	while (obj.hasChildNodes() == true) obj.removeChild(obj.childNodes[0]);
	for (index=0; index<addDisplayl.length; index++)
		{
		if (incIDl[index] == 0)
			obj.add( new Option(addDisplayl[index],index,false,false), index);
		}
	obj.add( new Option("Choose a Location...","choose",false,false), false);
	obj.options[0].selected = "selected";
	}
//
function setAll(obj)
	{
	var div = getObj("wsSet");
	for(var i = 0; i < div.childNodes.length; i++)
		{
		if (obj.checked == true)
			div.childNodes[i].childNodes[0].checked = true;
		else
			div.childNodes[i].childNodes[0].checked = false;
		}
	}
//
function charCount(obj,climit,id)
	{
	msg = '';
	x = obj.value.length + 1;
	if (x > climit)
		{
		y = x - climit;
		document.getElementById(id).style.color="#CC0000";
		document.getElementById(id).style.fontWeight="bold";
		msg = "["+x+"] You have exceded the maximum character count by "+y+" characters";
		}
	else
		msg = "["+x+"]";
	document.getElementById(id).childNodes[0].nodeValue = msg;
	}
//
function setCharCount(txt,climit,id)
	{
	msg = '';
	x = document.getElementById(txt).value.length;
	if (x > climit)
		{
		y = x - climit;
		document.getElementById(id).style.color="#CC0000";
		document.getElementById(id).style.fontWeight="bold";
		msg = "["+x+"] You have exceded the maximum character count by "+y+" characters";
		}
	else
		msg = "["+x+"]";
	document.getElementById(id).childNodes[0].nodeValue = msg;
	}
//
function visible(id,xx)
	{
	if (getObj(id).style.visibility == "hidden")
		{
		xx.firstChild.data = "-";
		getObj(id).style.visibility = '';
		getObj(id).style.display = '';
	//	getObj(id).focus();
		}
	else
		{
		xx.firstChild.data = "+";
		getObj(id).style.visibility = 'hidden';
		getObj(id).style.display = 'none';
		}
	}
//
function hideThumb(thumb)
	{
	obj = getObj(thumb);
	obj.style.visibility = 'hidden';
	obj.style.display = 'none';
	obj.style.top = obj.offsetTop;
	obj.style.left = obj.offsetLeft;
	}

function showThumb(thumb,yy)
	{
	obj = getObj(thumb);
	obj.style.visibility = '';
	obj.style.display = '';
	obj.style.position='absolute';
	obj.style.top = obj.offsetTop;
	obj.style.left = yy;
//	obj.style.left = obj.offsetLeft+yy;
	}
//
//function xxshowThumb(folder)
//	{
//	getObj("adminVwID").src = "http://members.1000facials.com/Content/"+folder+"/thumbs/"+folder+"60.jpg";
//	}
//
//function showThumbP(folder)
//	{
//	getObj("adminVwID").src = "http://members.1000facials.com/Content/2257/"+folder+"/"+folder+"60.jpg";
//	}
//
function display_triangle(element)
	{
	getObj(element).style.visibility = '';
	}
//
function hide_triangle(element)
	{
	if (navLeft != element)
		getObj(element).style.visibility = 'hidden';
	}
//
function display_note(element,Over,x,y)
	{
	obj = getObj(element);
	xx = obj.offsetTop + x;
	txt = obj.nextSibling.firstChild.data;

	obj = getObj(Over);
	obj.className = 'xxx2';
	obj.style.position='absolute';
	obj.style.top = event.clientY-10;	//xx;
//alert(event.clientX + 20 + obj.offsetWidth);
	if ((event.clientX + 20 + obj.offsetWidth) > document.body.clientWidth)
		obj.style.left = document.body.clientWidth - obj.offsetWidth - 180;
	else
		obj.style.left = event.clientX+20;	//y;
//alert(obj.style.left);
	obj.firstChild.data = txt;
	}
//
function hide_note(element,Over)
	{
//	if (navLeft != element)
		getObj(Over).className = 'xxx1';
	}
//
//function hide_border(current,element)
//	{
//	if (current != element && navButton != element)
//		{
//		obj = getObj(element);
//		obj.style.backgroundColor = "#FFFFFF";
//		obj.firstChild.style.color = "#87877E";
//		}
//	}
//
//function display_border(current,element)
//	{
//	if (current != element)
//		{
//		obj = getObj(element);
//		obj.style.backgroundColor = "#eeeeee";
//		obj.firstChild.style.color = "#87877E";
//		}
//	}
//
function js_PopWin(url,name,options)
	{
//	var ContextWindow = window.open(url,name,options);
//	ContextWindow.opener = this;
//	ContextWindow.focus();

	msgWindow=open(url,name,options);
	if (msgWindow.opener == null) msgWindow.opener = self;
	msgWindow.focus();
	}
//
function js_RefreshOriginalWindow(url)
	{
	if ((window.opener == null) || (window.opener.closed))
		{
		var OriginalWindow = window.open(url);
		OriginalWindow.opener = this;
		OriginalWindow.focus();
		}
	else
		{
		window.opener.location=url;
		window.opener.focus();
		}
	}
//
function betaMsg()
	{
	document.write("<div style='position:absolute; top:0px; left:0px; width:40px; height:30px; background-color:#004444;'>");
	document.write("</div>");
	}
//
function MM_swapImgRestore()
	{							//v3.0
	var i,x,a=document.MM_sr;
	for(i=0; a && i<a.length && (x=a[i]) && x.oSrc;i++)
		x.src=x.oSrc;
	}
//
function MM_findObj(n, d)
	{							//v4.01
	var p,i,x;
	if(!d) d=document;
	if((p=n.indexOf("?"))>0 && parent.frames.length)
		{
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
		}
	if(!(x=d[n]) && d.all) x=d.all[n];
	for (i=0; !x && i<d.forms.length; i++) x=d.forms[i][n];
	for (i=0; !x && d.layers && i<d.layers.length; i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
//
function MM_swapImage()
	{							//v3.0
	var i,j=0,x,a=MM_swapImage.arguments;
	document.MM_sr=new Array;
	for(i=0; i<(a.length-2); i+=3)
		if ((x=MM_findObj(a[i])) != null)
			{
			document.MM_sr[j++]=x;
			if(!x.oSrc) x.oSrc=x.src;
			x.src=a[i+2];
			}
	}
//
function MM_preloadImages()
	{							//v3.0
	var d=document;
	if(d.images)
		{
		if(!d.MM_p) d.MM_p = new Array();
		var i, j=d.MM_p.length, a=MM_preloadImages.arguments;
		for(i=0; i<a.length; i++)
			if (a[i].indexOf("#") != 0)
				{
				d.MM_p[j] = new Image;
				d.MM_p[j++].src = a[i];
				}
		}
	}
//
function changeimage(towhat,url)
	{
	if (document.images)
		{
		document.images.targetimage.src=towhat.src
		gotolink=url
		}
	}
//
function warp()
	{
	window.location=gotolink
	}
//
var myimages=new Array()

var gotolink="#"
//
function preloadimages()
	{
	for (i=0;i<preloadimages.arguments.length;i++)
		{
		myimages[i]=new Image()
		myimages[i].src=preloadimages.arguments[i]
		}
	}
//
function MM_reloadPage(init)
	{  //reloads the window if Nav4 resized
	if (init==true) with (navigator)
		{
		if ((appName=="Netscape")&&(parseInt(appVersion)==4))
			{
			document.MM_pgW=innerWidth;
			document.MM_pgH=innerHeight;
			onresize=MM_reloadPage;
			}
		}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}
//
MM_reloadPage(true);

if (self != top) // anti-hijacking frame buster code
    top.location.replace(self.location);
//   
function frameJammer_hp()
	{
	var framedPage = location.search;
	if (framedPage.length > 1)
		{
		framedPage = framedPage.substring(1);
		var theSplit = framedPage.lastIndexOf('~');
		var thePage = framedPage.substring(0,theSplit);
		var theFrame = framedPage.substring(theSplit+1);
		eval("top."+ theFrame+".location.replace('"+ thePage+"')");
		}
	}
//
//-->

