top.window.moveTo(0,0); if (document.all) { top.window.resizeTo(screen.availWidth,screen.availHeight);} else if (document.layers||document.getElementById) {if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){top.window.outerHeight = screen.availHeight;top.window.outerWidth = screen.availWidth;}}



////Menu///////////////////////

var bustcachevar=0 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadstatustext="<img src='/images/loading.gif' /> Requesting content..."

////NO NEED TO EDIT BELOW////////////////////////
var loadedobjects=""
var defaultcontentarray=new Object()
var bustcacheparameter=""

function ajaxpage(url, containerid, targetobj)
{
	var page_request = false
	if (window.XMLHttpRequest) 
	page_request = new XMLHttpRequest()
	else 
		if (window.ActiveXObject)
		{ // if IE
			try {
				page_request = new ActiveXObject("Msxml2.XMLHTTP")
			      } 
			catch (e)
			{
				try
				{
					page_request = new ActiveXObject("Microsoft.XMLHTTP")
				}
			catch (e){}
			}
		}
	else
	return false

	var ullist=targetobj.parentNode.parentNode.getElementsByTagName("li")

	for (var i=0; i<ullist.length; i++)
		ullist[i].className=""  

	targetobj.parentNode.className="selected"  

	if (url.indexOf("#default")!=-1)
	{ 
		document.getElementById(containerid).innerHTML=defaultcontentarray[containerid]
		return
	}

	document.getElementById(containerid).innerHTML=loadstatustext

	page_request.onreadystatechange=function()
	{
		loadpage(page_request, containerid)
	}

	if (bustcachevar) 
		bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()

		page_request.open('GET', url+bustcacheparameter, true)

	page_request.send(null)

}

function loadpage(page_request, containerid)
{
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
	document.getElementById(containerid).innerHTML=page_request.responseText
}

function savedefaultcontent(contentid)
{
	if (typeof defaultcontentarray[contentid]=="undefined") 
	defaultcontentarray[contentid]=document.getElementById(contentid).innerHTML
}

function startajaxtabs()
{

	for (var i=0; i<arguments.length; i++)
	{ 
		var ulobj=document.getElementById(arguments[i])
		var ulist=ulobj.getElementsByTagName("li") 

		for (var x=0; x<ulist.length; x++)
		{ 
			var ulistlink=ulist[x].getElementsByTagName("a")[0]
			if (ulistlink.getAttribute("rel"))
			{
				var modifiedurl=ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")
				ulistlink.setAttribute("href", modifiedurl) 
				savedefaultcontent(ulistlink.getAttribute("rel")) 
				ulistlink.onclick=function()
				{
					ajaxpage(this.getAttribute("href"), this.getAttribute("rel"), this)
					return false
				}
				if (ulist[x].className=="selected")
				{
					ajaxpage(ulistlink.getAttribute("href"), ulistlink.getAttribute("rel"), ulistlink) 
				}
			}
		}
	}
}


////Expand///////////////////////

var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined")
revivecontent()
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate



// Totop//

var message="<div id='topmsg' style='position:absolute; visibility:hidden'><a href='#top' title='To the Top of this Page'><img src='/images/totop.png' border=0></a><br/><a title='To this Chapter&quot;s Table of Contents Page' href='/accounting-process/'><img src='/images/menu-page.png' border=0></a></div>"

var displaymode=1

var displayduration=0

var ie=document.all

var ieNOTopera=document.all&&navigator.userAgent.indexOf("Opera")==-1

function regenerate() 
{window.location.reload() }

function regenerate2()
{if (document.layers) setTimeout("window.onresize=regenerate",400) }

var which=0

if (ie||document.getElementById) document.write(message)

var topmsg_obj=ie? document.all.topmsg : document.getElementById? document.getElementById("topmsg") : document.topmsg

function positionit()
{
var dsocleft=ie? document.body.scrollLeft : pageXOffset
var dsoctop=ie? document.body.scrollTop : pageYOffset
var window_width=ieNOTopera? document.body.clientWidth : window.innerWidth-20
var window_height=ieNOTopera? document.body.clientHeight : window.innerHeight

if (ie||document.getElementById)
{
topmsg_obj.style.left=parseInt(dsocleft)+window_width/2-topmsg_obj.offsetWidth/2 + 265
topmsg_obj.style.top=parseInt(dsoctop)+parseInt(window_height)-topmsg_obj.offsetHeight-160
}
else 
if (document.layers)
{
topmsg_obj.left=dsocleft+window_width/2-topmsg_obj.document.width/2 + 265
topmsg_obj.top=dsoctop+window_height-topmsg_obj.document.height-160
}
}

function setmessage()
{
if (displaymode==2&&(!display_msg_or_not()))
return
if (document.layers)
{
topmsg_obj=new Layer(window.innerWidth)
regenerate2()
topmsg_obj.document.write(message)
topmsg_obj.document.close()
positionit()
topmsg_obj.visibility="show"
if (displayduration!=0)
setTimeout("topmsg_obj.visibility='hide'",displayduration)
}
else
{
positionit()
topmsg_obj.style.visibility="visible"
if (displayduration!=0)
setTimeout("topmsg_obj.style.visibility='hidden'",displayduration)
}

setInterval("positionit()",100)
}

function get_cookie(Name) 
{
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) 
{
offset = document.cookie.indexOf(search)
if (offset != -1) 
{
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function display_msg_or_not()
{
if (get_cookie("displaymsg")=="")
{
document.cookie="displaymsg=yes"
return true
}
else
return false
}

if (document.layers||ie||document.getElementById)
window.onload=setmessage


///////Contact_Recommend//////

function contact ()
{
window.open("/general/contact.php", "", "width=515,height=450,top=100,left=200");
}

function recommend ()
{
window.open("/general/recommend.php", "", "width=500,height=415,top=100,left=200");
}



//////////////////disable select//////////////////////

var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){

if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)

return false

}

function reEnable(){

return true

}

if (typeof document.onselectstart!="undefined")

document.onselectstart=new Function ("return false")

else{

document.onmousedown=disableselect
document.onmouseup=reEnable

}





document.write('<LINK REL="SHORTCUT ICON" HREF="/favicon.ico">');
document.write('<META HTTP-EQUIV="Pragma" CONTENT="no-cache">');


















