function float_page(thisone,w,h){
	
	if(typeof thisone!="undefined"){
		targ=thisone.href
		
		if(targ!="javascript:;"){
			wname="floater"
			win_targ=targ
			
			
			
			thisone.target=wname
			thisone.href="javascript:;"
			if(typeof w=="undefined" || w==0){
				w=588
			}
			if(typeof h=="undefined" || h==0){
				h=588
			}
			
			
			MM_openBrWindow(win_targ,wname,"status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+w+",height="+h+"",1)
			
			thisone.href=win_targ
			
		}
		
	}
}

var open_expander=""
var open_expander_trigger=""



function divchange(thisname,start_mode){
	
	ob=FIND(thisname)

	thistrigger=thisname+"_link"
	trigger_ob=FIND(thistrigger)

	
	if(typeof ob!="undefined"){
		if(typeof ob.mode=="undefined" && typeof start_mode!="undefined"){
			ob.mode=start_mode
		}
		
		if(ob.mode==1){
			ob.mode=0
			ob.style.visibility="hidden"
			//ob.style.overflow="hidden"
			ob.style.display="none"
			if(typeof trigger_ob!="undefined" && trigger_ob!=null){
				open_expander_trigger=""
				open_expander=""
				
				trigger_ob.className="expander_closed"
				change_diagram("overall",thisname)
				current_diagram_area="overall"
			}
		}else{
		
			ob.mode=1
			ob.style.visibility="visible"
			//ob.style.overflow="visible"

			ob.style.display="block"
			
			if(typeof trigger_ob!="undefined"  && trigger_ob!=null){
				
				trigger_ob.className="expander_open"
				if(open_expander!=""){
					old_ob=FIND(open_expander)
					old_ob.mode=0
					old_ob.style.visibility="hidden"
					old_ob.style.display="none"
					
					old_trigger_ob=FIND(open_expander_trigger)
					old_trigger_ob.className="expander_closed"
				}
				
				open_expander_trigger=thistrigger
				open_expander=thisname
				
				
				change_diagram(thisname)
				
				
			}
			
		}
	}
}

function FIND(item) {
	if (document.all) return(document.all[item]);
	if (document.getElementById) return(document.getElementById(item));
	return(false);
}



function load_actions(){
	//CHECK TO SEE WHTA PAGE THIS IS, TO DETERMIN THE NAME OF THE IFRAME
	var loc=document.location.toString()
	var if_name=""
	if(loc.indexOf("recipe_splash.asp")!=-1){
		if_name="recipe_splash"
	}
	if(loc.indexOf("index.asp")!=-1){
		if_name="recipe_holder"
	}
	if_ob=FIND("hidden_iframe")
	if(typeof if_ob!="undefined" && !!if_ob){
		//THIS SHOULD POINT TO FILE ON HCA SITE
		
		window.frames["hidden_iframe"].document.location="http://bhf.parallel.co.uk/hca_bhf_assets/hca_bhf_resize_iframe.html?h="+(document.body.scrollHeight+15)+"&if_name="+if_name
	}
	
}


var currentTop=0
var clickCheck=0
var timMoveID=0

window.onscroll=scrollcheck

function timescroll(){
	window.clearInterval(timMoveID)
	timMoveID=0

	scrollcheck()
}
function scrollcheck(){

	if(clickCheck==0){
		if (typeof window.pageYOffset=="undefined"){ //must be ie
			currentTop=document.body.scrollTop
		}else{
			currentTop=window.pageYOffset
	
		}
	}else{

		clickCheck=0
		if (typeof window.pageYOffset=="undefined"){ //must be ie
			document.body.scrollTop=currentTop
		}else{
		
			window.scroll(0,currentTop)
		}

	}

}

function itemClicked(){

	if (typeof window.pageYOffset=="undefined"){ //must be ie
		if(document.body.scrollTop==0){
			clickCheck=0
		}else{
			clickCheck=1
		}
	}else{

		if(window.pageYOffset==0){
		
			clickCheck=0
		}else{
			clickCheck=1
			currentTop=window.pageYOffset
		}
	}
}

function open_recipe(theURL){
	tp=10
	lft=10
	pos=0
	
	if(typeof window.screenX =="undefined"){
	
		if(typeof window.screenTop !="undefined"){
		
			tp=window.screenTop+10
			lf=window.screenLeft+10
			pos=1
		}
	}else{
	
		tp=window.screenY+10
		lf=window.screenX+10
		pos=1
	}
	tp=tp-50
	lf=lf-150
	
	features="status=yes,scrollbars=yes,resizable=yes,width=760,height=600"
	
	if(pos==1){
		if(features!=""){
			features=features+",top="+tp+",left="+lf
		}else{
			features=features+"top="+tp+",left="+lf
		}
	}
	
	
	itemClicked()
 	x=window.open(theURL,"recipedetails",features);
	x.focus()
	if (typeof window.pageYOffset!="undefined"){
		timMoveID=setInterval("timescroll()",50)
	}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0 with scroll fix

tp=10
	lft=10
	pos=0
	
	if(typeof window.screenX =="undefined"){
	
		if(typeof window.screenTop !="undefined"){
		
			tp=window.screenTop+10
			lf=window.screenLeft+10
			pos=1
		}
	}else{
	
		tp=window.screenY+10
		lf=window.screenX+10
		pos=1
	}
	
	if(pos==1){
		if(features!=""){
			features=features+",top="+tp+",left="+lf
		}else{
			features=features+"top="+tp+",left="+lf
		}
	}
	
	
	 itemClicked()
  x=window.open(theURL,winName,features);
x.focus()
if (typeof window.pageYOffset!="undefined"){
	timMoveID=setInterval("timescroll()",50)
	}
}

function printpage() {
window.print();  
}


