//CLEARS THE DEFAULT CONTENTS OF A TEXT FIELD
function clear_box(thisbox,thistext){
	if(thisbox.value==thistext){
		thisbox.value=""
	}
}

//FILLS AN EMPTY TEXT FIELD WITH ITS DEFAULT CONTENT
function fill_box(thisbox,thistext){
	if(thisbox.value==""){
		thisbox.value=thistext
	}
}

function search_submit(thistext,andsubmit){
	if(document.forms["searchform"].search_text.value!="" && document.forms["searchform"].search_text.value!=thistext){
		if(document.location.toString().indexOf("search.asp")==-1){
			MM_openBrWindow(document.forms["searchform"].action,document.forms["searchform"].target,"status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+640+",height="+480+"",1)
		}
		if(andsubmit==1){
			document.forms["searchform"].submit()
		}else{
			return true;
		}
	}else{
		return false;	
	}
}

function change_search_opener_location(tothis){
	window.opener.document.location=tothis	
}

function MM_openBrWindow(theURL,winName,features) { //v2.0

	itemClicked()

	
	
 	 x=window.open(theURL,winName,features);
  
	x.focus()
	if (typeof window.pageYOffset!="undefined"){
		timMoveID=setInterval("timescroll()",50)
	
	}
}

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 float_page(thisone,w,h){
	
	if(typeof thisone!="undefined"){
		targ=thisone.href
		//if(targ!="javascript:;" && targ!="javascript:;" && targ.substr(0,5)!="http:" && targ.substr(0,4)!="www."){
		if(targ!="javascript:;"){
			wname="floater"
			win_targ=targ
			
			if(targ.indexOf("feedback_form.asp")!=-1){
				if(win_targ.indexOf("document_title")==-1){
					ob=FIND("document_title")
					if(typeof ob!="undefined"){
						
						pos1=win_targ.indexOf("?")
						leftstr=win_targ.substr(0,pos1)
						rightstr=win_targ.substr(pos1+1,win_targ.length)
						dt=ob.innerText
						ob2=FIND("general_title")
						if(typeof ob2!="undefined"){
							if(ob2.innerText.indexOf("opinion")!=-1){
								dt=ob2.innerText+": "+dt
							}
						}
						win_targ=leftstr+"?document_title="+dt+"&"+rightstr
						
						
					}
				}
				wname="feedback"
			}
			
			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
			
		}
		
	}
}

function float_simple_page(thisone,w,h){
	
	if(typeof thisone!="undefined"){
		targ=thisone.href
		//if(targ!="javascript:;" && targ!="javascript:;" && targ.substr(0,5)!="http:" && targ.substr(0,4)!="www."){
		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=no,scrollbars=no,resizable=no,width="+w+",height="+h+"",1)
			
			thisone.href=win_targ
			
		}
		
	}
}

function thumb_over(thisone){
	thisone.parentNode.style.overflow="visible"
}

function thumb_off(thisone){
	thisone.parentNode.style.overflow="hidden"
}

function galert(thisstr){
	if(is_debugging=="1"){
		alert(thisstr)
	}
}