var newfacetagbefore
var newfacetagafter
var faceurl
var newfacetag
var facewidth=100
var faceheight=100
var facewidthnew=100
var faceheightnew=100

function initonload() {
	document.all.bodycontainer.style.posLeft=x_faceandbody
	document.all.bodycontainer.style.posTop=y_faceandbody
	document.all.facecontainer.style.posLeft=x_faceandbody
	document.all.facecontainer.style.posTop=y_faceandbody
	document.all.controlcontainer.style.posLeft=x_control
	document.all.controlcontainer.style.posTop=y_control
	document.all.formcontainer.style.posLeft=x_form
	document.all.formcontainer.style.posTop=y_form
}
	
function changeface(thissample) {
	newfacetagbefore="<img src=\""
	newfacetagafter="\" border=0>"
	faceurl=thissample
	newfacetag=newfacetagbefore+faceurl+newfacetagafter
	facecontainer.innerHTML=newfacetag
	facewidth=parseInt(document.all.facecontainer.offsetWidth)
	faceheight=parseInt(document.all.facecontainer.offsetHeight)
	facewidthnew=facewidth
	faceheightnew=faceheight
}

function addface() {
	newfacetagbefore="<img src=\""
	newfacetagafter="\" border=0>"
	faceurl=document.f.addfaceurl.value			
	newfacetag=newfacetagbefore+faceurl+newfacetagafter
	facecontainer.innerHTML=newfacetag
	facewidth=parseInt(document.all.facecontainer.offsetWidth)
	faceheight=parseInt(document.all.facecontainer.offsetHeight)
	facewidthnew=facewidth
	faceheightnew=faceheight
}

function changebody(thisurl) {
	bodycontainer.innerHTML="<img src=\""+thisurl+"\" border=0>"
}

function moveface(thisdirection) {
	if (thisdirection=="upfast") {
		document.all.facecontainer.style.posTop-=10
	}
	if (thisdirection=="downfast") {
		document.all.facecontainer.style.posTop+=10
	}
	if (thisdirection=="leftfast") {
		document.all.facecontainer.style.posLeft-=10
	}
	if (thisdirection=="rightfast") {
		document.all.facecontainer.style.posLeft+=10
	}
	if (thisdirection=="upslow") {
		document.all.facecontainer.style.posTop-=1
	}
	if (thisdirection=="downslow") {
		document.all.facecontainer.style.posTop+=1
	}
	if (thisdirection=="leftslow") {
		document.all.facecontainer.style.posLeft-=1
	}
	if (thisdirection=="rightslow") {
		document.all.facecontainer.style.posLeft+=1
	}
}

function resizeface(thiszoom) {
	if (thiszoom=="bigger") {
		facewidthnew*=1.03
	}
	if (thiszoom=="smaller") {
		facewidthnew*=0.97
	}
	newfacetagbefore="<img src=\""
	newfacetagafter="\" border=0 width="+facewidthnew+">"
	newfacetag=newfacetagbefore+faceurl+newfacetagafter
	facecontainer.innerHTML=newfacetag
}

if (document.all) {
	window.onload=initonload
}

if (!document.all) {
	alert("Your browser does not support Magic Transformer.")
}

