var nf=0
var nb=0
var p=68
var tb1=30
var tb2=214
var lb1=50
var lb2=174
var wb1=74
var wb2=24
var hb1=151
var hb2=48
var tf1=30
var tf2=214
var lf1=150
var lf2=241
var wf1=83
var wf2=27
var hf1=150
var hf2=48
var fmoving=0
var bmoving=0

function sfinit(){
	if (fmoving==0 && bmoving==0){
		if (document.all){
			sfb.style.top=tb1
			sfb.style.left=lb1
			sfb.style.width=wb1
			sfb.style.height=hb1
			sff.style.top=tf1
			sff.style.left=lf1
			sff.style.width=wf1
			sff.style.height=hf1
			sf20.style.visibility="hidden"
			sf02.style.visibility="hidden"
			sf22.style.visibility="hidden"
			sff.style.visibility="visible"
			sfb.style.visibility="visible"
		}
		else if (document.layers){
			document.layers.photoarea.document.sfb.moveTo(lb1,tb1)
			document.layers.photoarea.document.sff.moveTo(lf1,tf1)
			document.layers.photoarea.document.sf20.visibility="hide"
			document.layers.photoarea.document.sf02.visibility="hide"
			document.layers.photoarea.document.sf22.visibility="hide"
			document.layers.photoarea.document.sff.visibility="show"
			document.layers.photoarea.document.sfb.visibility="show"
		}
	}
}

function move_sff(){
	if (document.all){
		if (sff.style.visibility=="visible"){
			fmoving=1
			sff.style.top=tf1+(tf2-tf1)*nf/p
			sff.style.left=lf1+(lf2-lf1)*nf/p
			sff.style.width=wf1*(100-nf)/100
			sff.style.height=hf1*(100-nf)/100
			if (nf<p){
				nf=nf+1
				setTimeout("move_sff()",10)
			}
			else{
				fmoving=0
				if(sf02.style.visibility=="visible"){
					sf22.style.visibility="visible"
				}
				else{
					sf20.style.visibility="visible"
				}
				sff.style.visibility="hidden"
				nf=0
			}
		}
		else{
			alert("Already built up")
		}
	}
	else if (document.layers){
		if (document.layers.photoarea.document.sff.visibility=="show"){
			fmoving=1
			document.layers.photoarea.document.sff.moveTo(lf1+(lf2-lf1)*nf/p,tf1+(tf2-tf1)*nf/p)
			if (nf<p){
				nf=nf+1
				setTimeout("move_sff()",10)
			}
			else{
				fmoving=0
				if(document.layers.photoarea.document.sf02.visibility=="show"){
					document.layers.photoarea.document.sf22.visibility="show"
				}
				else{
					document.layers.photoarea.document.sf20.visibility="show"
				}
				document.layers.photoarea.document.sff.visibility="hide"
				nf=0
			}
		}
		else{
			alert("Already built up")
		}
	}
}

function move_sfb(){
	if (document.all){
		if (sfb.style.visibility=="visible"){
			bmoving=1
			sfb.style.top=tb1+(tb2-tb1)*nb/p
			sfb.style.left=lb1+(lb2-lb1)*nb/p
			sfb.style.width=wb1*(100-nb)/100
			sfb.style.height=hb1*(100-nb)/100
			if (nb<p){
				nb=nb+1
				setTimeout("move_sfb()",10)
			}
			else{
				bmoving=0
				if(sf20.style.visibility=="visible"){
					sf22.style.visibility="visible"
				}
				else{
					sf02.style.visibility="visible"
				}
				sfb.style.visibility="hidden"
				nb=0
			}
		}
		else{
			alert("Already built up")
		}
	}
	else if (document.layers){
		if (document.layers.photoarea.document.sfb.visibility=="show"){
			bmoving=1
			document.layers.photoarea.document.sfb.moveTo(lb1+(lb2-lb1)*nb/p,tb1+(tb2-tb1)*nb/p)
			if (nb<p){
				nb=nb+1
				setTimeout("move_sfb()",10)
			}
			else{
				bmoving=0
				if(document.layers.photoarea.document.sf20.visibility=="show"){
					document.layers.photoarea.document.sf22.visibility="show"
				}
				else{
					document.layers.photoarea.document.sf02.visibility="show"
				}
				document.layers.photoarea.document.sfb.visibility="hide"
				nb=0
			}
		}
		else{
			alert("Already built up")
		}
	}
}

