<!--
//*****************************************************************************************************
// This is a trade secret proprietary work of Ty A. Huynh, D/B/A Mainstream Media.
// All contents of this script file, the source code, HTML, and all associated web files
// including (but not limited to) image files, and Java applets are
// Copyright (c) 2001-2009 MainstreamMedia, All Rights Reserved.
// Reproduction of any material associated with MainstreamMedia, its websites, or supporting structures
// in part or whole is strictly prohibited.
// Unauthorized use, duplication, or distribution of materials by any means whatsoever is prohibited.
//*****************************************************************************************************
var E_AT = "@";
var DOMAIN = "MotoCore.Net";
var ROOTPATH = "/";
var gb_rte = document.getElementById && document.designMode;// && !dojo.isKhtml;
var gi_base_w = 955;
var gi_base_h = 600;
var gi_offset_dw = 0;
var gi_offset_dh = 0;
var gi_w = gi_base_w;
var gi_h = gi_base_h;
var gi_dx = 0; // Difference betw/actual and base width
var gi_dy = 0; // Difference betw/actual and base height
function preloadImages() {var d=document; if(d.images){ if(!d.mpre) d.mpre=new Array();var i,j=d.mpre.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)if (a[i].indexOf("#")!=0){ d.mpre[j]=new Image; d.mpre[j++].src=a[i];}}} 
function getObj(n, d) {var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);if(!x && d.getElementById) x=d.getElementById(n); return x;}
function getDoc(as_fr) {
	if (as_fr == "top") {if (top.opener) return top.opener.top.document; else return top.document;
	} else if (as_fr == "parent") { if (parent) return parent.document;	}
	var ldoc_x;
	if (window.frames[as_fr] == null) {
		var luo_x = getObj(as_fr);
		if (luo_x == null) return null;
		ldoc_x = luo_x.contentDocument;
	} else ldoc_x = window.frames[as_fr].document;
	return ldoc_x;
}
function getWin(as_fr) {
	if (as_fr == "top") { if (top.opener) return top.opener.top; else return top;
	} else if (as_fr == "parent") { if (parent) return parent; }
	var lwin_x;
	if (window.frames[as_fr] == null) {
		var luo_x = getObj(as_fr);
		if (luo_x == null) return null;
		lwin_x = luo_x.contentWindow;
	} else lwin_x = window.frames[as_fr].window;
	return lwin_x;
}
function getDocHeight() {
    var luo_d = document;
    return Math.max(
        Math.max(luo_d.body.scrollHeight, luo_d.documentElement.scrollHeight),
        Math.max(luo_d.body.offsetHeight, luo_d.documentElement.offsetHeight),
        Math.max(luo_d.body.clientHeight, luo_d.documentElement.clientHeight)
    );
}
function thisPageURL() { var li_a = location.href.lastIndexOf("/"); if (li_a == -1) return location.href; else return location.href.substring(li_a+1); }
function getOffsetTop(auo_x) {
	var li_top = auo_x.offsetTop; var luo_op = auo_x.offsetParent;
	while(luo_op != document.body) { li_top += luo_op.offsetTop; luo_op = luo_op.offsetParent; }
	return li_top;// + gi_offset_dh;
}
function getOffsetLeft(auo_x) {
	var li_left = auo_x.offsetLeft; var luo_op = auo_x.offsetParent;
	while(luo_op != document.body) { li_left += luo_op.offsetLeft; luo_op = luo_op.offsetParent; }
	return li_left;// + gi_offset_dw;
}
function runScript(as_fr, as_scr) {
	if (as_fr == "top")
		try {top.eval(as_scr);} catch(err) {alert("Error executing top{"+as_scr+"}\n\n"+err.toString()+"\n\nTry closing browser and coming back.");}
	else {
		var luo_w = getWin(as_fr);
		try { if (luo_w == null) window.eval(as_scr); else luo_w.eval(as_scr) } catch(err) {alert("Error executing {"+as_scr+"}\n\n"+err.toString());}
	}
	return true;
}
function raiseButton(auo_x) {
	var luo_e = window.event.srcElement; className = luo_e.className;
	if (className == 'rteimg' || className == 'rteimglowered') { luo_e.className = 'rteimgraised'; }
}
function normalButton(auo_x) {
	var luo_e = window.event.srcElement; className = luo_e.className;
	if (className == 'rteimgraised' || className == 'rteimglowered') { luo_e.className = 'rteimg'; }
}
function lowerButton(auo_x) {
	var luo_e = window.event.srcElement; className = luo_e.className;
	if (className == 'rteimg' || className == 'rteimgraised') { luo_e.className = 'rteimglowered'; }
}
var gi_curr_menu = -1;
function getQS() {
	var ls_url = "";
	if (location.href) ls_url += location.href;
	else if (document.url) ls_url += document.url;
	else return ls_url;
	var li_i = ls_url.indexOf("?");
	if (li_i < 0) return "";
	else return ls_url.substring(li_i + 1);}
function jumpTo(as_url, ab_top) { if (ab_top) top.location.href = as_url; else location.href = as_url;}
function getVar(as_var,auo_d,as_f) {
	if (!auo_d) auo_d = document;
	if (!auo_d.forms) return null;
	var luo_f = null;
	if (as_f) { luo_f = auo_d.forms[as_f]; if (luo_f == null) return null; }
	else if (document.pageform) luo_f = document.pageform; 
	else if (!auo_d.forms[0]) return null;
	else luo_f = auo_d.forms[0];
	if (!luo_f.elements) return null;
	return luo_f.elements[as_var];}
function getValue(as_var,auo_d,as_f) {
	var luo_x = getVar(as_var,auo_d,as_f);
	var ls_r = null;
	if (luo_x && luo_x.type) {
		if (luo_x.type.indexOf("radio") != -1) {
			var li_i;
			for (li_i = 0; li_i < luo_x.length; li_i++) {
				if (luo_x[li_i].checked) { ls_r = luo_x[li_i].value; break;}
			}
		} else if (luo_x.type.indexOf("select") != -1) {
			ls_r = luo_x.options[luo_x.selectedIndex].value;
		} else
			ls_r = luo_x.value;
	}
	return ls_r;}
function setValue(as_var,as_val,auo_d,as_f) {
	var luo_x = getVar(as_var,auo_d,as_f);
	if (luo_x) luo_x.value = as_val;}
function setSelect(as_var,as_val,auo_d,as_f) {
	var luo_x;
	if (as_var.type) luo_x = as_var;
	else {
		luo_x = getVar(as_var,auo_d,as_f);
		if (luo_x == null) {
			alert("form element '"+as_var+"' does not exist!");
			return;
		}
	}
	if (luo_x.type.indexOf("select") == -1) {
		alert("form element '"+as_var+"' is type '"+luo_x.type+"', not a select!");
		return;
	}
	var li_i;
	for (li_i = luo_x.options.length - 1; li_i >= 0; li_i--) {
		if (luo_x.options[li_i].value == as_val) {
			luo_x.selectedIndex = li_i;
			return;
		}
	}
}
function getInt(as_var,auo_d,as_f) {
	var ls_v=getValue(as_var,auo_d,as_f);
	if (ls_v == null) return 0;
	var li_v = parseInt(ls_v);
	if (isNaN(li_v)) return 0;
	else return li_v;
}
function getBoolean(as_var,auo_d,as_f) {
	var ls_v=getValue(as_var,auo_d,as_f);
	if (ls_v == null) return false;
	return ls_v == "Y";
}
function setBoolean(as_var,ab_t,auo_d,as_f) {
	var luo_x = getVar(as_var,auo_d,as_f);
	if (luo_x) luo_x.value = ab_t ? "Y" : "N";}
function initPage() {
	if (dojo.isIE) {
		gi_w = document.body.clientWidth;
		gi_h = document.body.clientHeight;
		if (gi_w > gi_base_w) gi_dx = gi_w - gi_base_w;
		if (gi_h > gi_base_h) gi_dy = gi_h - gi_base_h;		
	} else {
//document.title = "iWH("+window.innerWidth+","+window.innerHeight+") oWH("+document.width+","+document.height+")";
		gi_w = document.width;
		gi_h = window.innerHeight;
		if (dojo.isMozilla) gi_h -= 15; // Firefox often does not report correct dimensions
		if (gi_w > gi_base_w) gi_dx = gi_w - gi_base_w;
		if (gi_h > gi_base_h) gi_dy = gi_h - gi_base_h;		
	}
		
//	flushPage(); // This function defined per page
}
function processRate(as_o,ai_type,ai_rate,as_class,as_o2) {
	if (as_o == null || as_o.length == 0 || as_o == "0") {alert("Please login or create an account to rate this."); return;}
	else if (as_o == "-") {alert("Sorry, but you may not rate your own items."); return;}
	if (as_class == null) as_class = "Thing";
	var ls_d = "divrate" + as_o + "_" + ai_type;
	var ls_u0 = "link?c=rate&type=" + ai_type + "&rating=" + ai_rate + "&class=" + escape(as_class);
//	alert("processRate("+as_o+","+ai_type+","+ai_rate+","+as_class+","+as_o2+")\ndiv("+ls_d+")\nurl("+ls_u0+")");
	dojo.xhrGet(intoNode(ls_d, ls_u0 + "&obj=" + as_o));
	if (as_o2 != null && as_o2.length > 0 && as_o2 != "0") {
		ls_d = "divrate" + as_o2 + "_" + ai_type;
		dojo.xhrGet(intoNode(ls_d, ls_u0 + "&obj=" + as_o2));
	}
}
function refreshTop() {
	var luo_d = window.opener ? window.opener.document : document;
	if (luo_d.pageform) luo_d.pageform.submit(); // 'safe' refresh
	else luo_d.location.reload(true); return; // 'hard' refresh might submit previous form action
}
function refreshPage(as_d) {
	if (as_d == null) {
		if (document.pageform) document.pageform.submit(); // 'safe' refresh
		else document.location.reload(true); return; // 'hard' refresh might submit previous form action
	}
	var ldoc_b = getDoc(as_d);
	if (ldoc_b == null) { alert("No '"+as_d+"' document"); return;}
	if (ldoc_b.pageform) ldoc_b.pageform.submit();
	else ldoc_b.location.reload(true);
}
function stripHTML(as_htm) {
	var ls_r = as_htm.replace(/(<([^>]+)>)/ig,""); ls_r = ls_r.replace(/\r\n/g," "); ls_r = ls_r.replace(/\n/g," "); ls_r = ls_r.replace(/\r/g," "); ls_r = trim(ls_r);
	return ls_r;
}
function writeMTA(as_a, as_n, as_d) {
	if (as_a == null || as_a.length == 0) as_a = "CoreMaster";
	if (as_d == null || as_d.length == 0) as_d = DOMAIN;
	if (as_n == null || as_n.length == 0) as_n = as_a + E_AT + as_d;
	document.write("<a href=\"mailto:");
	document.write(as_a);
	document.write(E_AT);
	document.write(as_d);
	document.write("\">");
	document.write(as_n);
	document.write("</a>");
}
function getHTML(auo_x) {
	if (auo_x == null) return null;
	if (auo_x.innerHTML) return auo_x.innerHTML; else return null;
}
function setHTML(auo_x, as_htm) {
	if (auo_x == null) return;
	if (auo_x.innerHTML) auo_x.innerHTML = as_htm;
}
function closeThis() {
	if (window.parent) {
		if (window.parent.opener) window.parent.opener.focus();
		window.parent.close();
		return;
	}
	if (window.opener) window.opener.focus();
	window.close();
}
function trim(as_x) {
   if (typeof as_x != "string") return as_x;
   var ls_r = as_x;
   var ls_ch = ls_r.substring(0, 1);
   while (ls_ch == " ") {
      ls_r = ls_r.substring(1, ls_r.length);
      ls_ch = ls_r.substring(0, 1);
   }
   ls_ch = ls_r.substring(ls_r.length - 1, ls_r.length);
   while (ls_ch == " ") {
      ls_r = ls_r.substring(0, ls_r.length - 1);
      ls_ch = ls_r.substring(ls_r.length - 1, ls_r.length);
   }
   while (ls_r.indexOf("  ") != -1) {
      ls_r = ls_r.substring(0, ls_r.indexOf("  ")) + ls_r.substring(ls_r.indexOf("  ") + 1, ls_r.length);
   }
   return ls_r;
}
function logout(ab_x) {
	if (!ab_x) { alert("Guest sessions do not logout.\nThank you for trying."); return;}
	if (document.logoutform) document.logoutform.submit();
}
function setBody(as_url) { document.location.href = as_url; }
function setTopBody(as_url) { top.document.location.href = as_url; }
function doFormAction(auo_form,as_act,as_obj,as_oid) {
	if (auo_form == null) {if (document.pageform) auo_form = document.pageform; else auo_form = document.forms[0];}
	else if ((typeof auo_form) == "string") { auo_form = document.forms[auo_form]; if (auo_form == null) {alert("Form not defined"); return;}}
	if (as_act != null && auo_form.act != null) auo_form.act.value = as_act;
	if (as_obj != null && auo_form.obj != null) auo_form.obj.value = as_obj;
	if (as_oid != null && auo_form.oid != null) auo_form.oid.value = as_oid;
	auo_form.submit();
}
function popUpImg(as_i,ai_w,ai_h) {
	if (as_i == null || as_i == "0") return;
	var li_w = 900;
	var li_h = 720;
	if (ai_w != null) {
		if (ai_w < 430)
			li_w = 480;
		else if (ai_w <= 800)
			li_w = ai_w + 50;
	}
	if (ai_h == null) {
		if (ai_h < 300)
			li_h = 380;
		else if (ai_h <= 800)
			li_h = ai_h + 50;
	}
		
	var ls_args = "obj="+as_i;
	if (document.pageform && document.pageform.curr && document.pageform.curr.value > "")
		ls_args += "&p="+document.pageform.curr.value;
	popUpScroll("imgpopup",ls_args,li_w,li_h,as_i);
}
function getWinScrollX() {
	if (dojo.isIE) {
		if (document.compatMode == "CSS1Compat")
			return document.body.parentNode.scrollLeft;
		else
			return document.body.scrollLeft;
	} else
		return window.scrollX;
}
function getWinScrollY() {
	if (dojo.isIE) {
		if (document.compatMode == "CSS1Compat")
			return document.body.parentNode.scrollTop;
		else
			return document.body.scrollTop;
	} else
		return window.scrollY;
}
function popUpWindow(as_c,as_args,ai_w,ai_h,as_id) {
	if (as_c == null) return;
	if (ai_w == null) ai_w = 630;
	if (ai_h == null) ai_h = 540;
	if (as_id == null) as_id = as_c;
	var ls_url = "link?c="+as_c;
	if (as_args != null) ls_url += "&"+as_args;
	var ls_opener = "width="+ai_w+",height="+ai_h+",resizable=yes,scrollbars=yes";
	var luo_w = window.open(ls_url,as_id,ls_opener);
	if (document.window != null && !luo_w.opener)
		luo_w.opener = document.window;
	luo_w.focus();
}
function popUpScroll(as_c,as_args,ai_w,ai_h,as_id) {
	if (as_c == null) return;
	if (ai_w == null) ai_w = 630;
	if (ai_h == null) ai_h = 540;
	if (as_id == null) as_id = as_c;
	
	var luo_pl = dojo.byId("poplayer");
	if (luo_pl == null) {alert("Popup layer not found!"); return;}
	var li_sy = getWinScrollY();
	var li_t = (gi_h / 2) - (ai_h / 2) + li_sy;
	var li_l = (gi_w / 2) - (ai_w / 2);
//alert("popUp; gw("+gi_w+") gh("+gi_h+") w("+ai_w+") h("+ai_h+") sy("+li_sy+") x("+li_l+") y("+li_t+")");
	if (li_t < 0) li_t = 0;
	if (li_l < 0) li_l = 0;
	
	var ls_url = "link?c="+as_c;
	if (as_args != null) ls_url += "&"+as_args;
	dojo.xhrGet(intoNode("poplayer", ls_url));
	dojo.style("popbglayer", {"height":getDocHeight() , "visibility":"visible"});
	dojo.style(luo_pl, {"width":ai_w , "height":ai_h , "top":li_t , "left":li_l , "visibility":"visible"});
}
function submitPopUp(auo_f) {
	if (auo_f == null) auo_f = document.popform;
	dojo.xhrPost(postIntoScript("poplayer", auo_f, "link"));
}
function closePopUp() {
	setStyle("poplayer", "visibility", "hidden");
	setStyle("popbglayer", "visibility", "hidden");
}
function toggleSel(as_id,as_sel,as_f) {
	if (as_f == null) as_f = "minibform";
	var luo_f = getObj(as_f);
	if (luo_f == null) alert("'"+as_f+"' not defined");
	if (!luo_f.idsel) alert("'"+as_f+"'.idsel not defined");
	if (as_id == null || as_id.length == 0) return;
	if (as_sel == null) as_sel = "0";
	var luo_idsel = luo_f.idsel;
	var ls_v = luo_idsel.value;
	var ls_ids = as_id + ":" + as_sel;
	var lb_on = false;
	var luo_val;
	var li_i;
	if (ls_v != null && ls_v.length > 0) {
		luo_vals = ls_v.split(",");
		for (li_i = luo_vals.length - 1; li_i >= 0; li_i--) {
			if (luo_vals[li_i] == ls_ids) lb_on = true;
		}
	}
	var luo_sp = getObj("id"+as_id+"sel"+as_sel);
	if (luo_sp == null) alert("'id"+as_id+"sel"+as_sel + "' not defined");
	if (lb_on) {
		luo_idsel.value = "";
		for (li_i = luo_vals.length - 1; li_i >= 0; li_i--) {
			ls_v = luo_vals[li_i];
			if (ls_v != ls_ids) {
				if (luo_idsel.value.length != 0) luo_idsel.value += ",";
				luo_idsel.value += ls_v;
			}
		}
		if (luo_sp != null && luo_sp.style) luo_sp.style.background = "";
	} else {
		if (luo_idsel.value.length != 0) luo_idsel.value += ",";
		luo_idsel.value += ls_ids;
		if (luo_sp != null && luo_sp.style) luo_sp.style.background = "#ffff00";
	}
}
function noLink() {
	alert("This link is masked for security reasons.");
}
function setStyle(as_id, as_s, ai_c, ab_ie_only) {
	if (!ab_ie_only || dojo.isIE) dojo.style(as_id, as_s, ai_c);
	return true;
}
function loadIntoNode(data, xhr){
	if(xhr.args.node){ xhr.args.node.innerHTML = data;}
}
function loadAsScript(data, xhr){
	if (data != null && data.length > 0) {
		if (data.toString().charAt(0) == '<') { document.write(data); document.close(); } else { window.eval(data);}
	}
}
function intoNode(as_node, as_url){
	return { url: as_url, node: dojo.byId(as_node), load: loadIntoNode };
}
function postIntoNode(as_node, auo_form, as_url){
	return { form: auo_form, url: as_url, node: dojo.byId(as_node), load: loadIntoNode };
}
function postIntoScript(as_node, auo_form, as_url){
	return { form: auo_form, url: as_url, load: loadAsScript };
}
var gb_mq_active = false; var guo_mq; var gi_mq_h, gi_mq_ah = '';
var gi_waitscroll = 2000; //milliseconds
var gi_mq_speed = 2;
var gi_mq_pause = 1; //pause onmousever (0=no 1=yes)
var gi_mq_copy = gi_mq_speed; var gi_mq_pspeed=(gi_mq_pause==0)? gi_mq_copy: 0;
var guo_mqt = null;
function scrollMQ(){if (parseInt(guo_mq.style.top)>(gi_mq_ah*(-1)+8)) guo_mq.style.top=parseInt(guo_mq.style.top)-gi_mq_copy+"px"; else guo_mq.style.top=parseInt(gi_mq_h)+8+"px";}
function startMQ(){ guo_mq=dojo.byId("mq_inner"); if (guo_mq == null) return; guo_mq.style.top=0; gi_mq_h=dojo.byId("mq_outer").offsetHeight; gi_mq_ah=guo_mq.offsetHeight; if (dojo.isOpera || navigator.userAgent.indexOf("Netscape/7")!=-1){ guo_mq.style.height=gi_mq_h+"px"; guo_mq.style.overflow="scroll"; return;} setTimeout('guo_mqt=setInterval("scrollMQ()",100)', gi_waitscroll); }
function stopMQ(){if (guo_mqt != null) { clearInterval(guo_mqt); guo_mqt = null;}}
function setImgPreview(as_src, ai_w, ai_h) {
	var luo_i = getObj("img_preview");
	if (luo_i == null) return;
	if (as_src == null) as_src = "/images/spacer.gif";
	luo_i.src = as_src;
	if (ai_w != null) luo_i.width = ai_w;
	if (ai_h != null) luo_i.height = ai_h;
}
function setPreview(auo_img) {
	var luo_l = dojo.byId('layer_imgpreview');
	if (luo_l == null) return;
	var li_lx = getOffsetLeft(auo_img) + (auo_img.offsetWidth);
	var li_ly = getOffsetTop(auo_img) - (luo_l.offsetHeight) - 7;
	dojo.style(luo_l, {"left":li_lx, "top":li_ly, "visibility":"visible"});
	setImgPreview(auo_img.src);
	return;
}
function hidePreview() {
	dojo.style("layer_imgpreview", "visibility", "hidden");
}
function hiliteIcon(ab_on, as_icon, as_curr_var) {
	if (as_curr_var) {
		var ls_s=("var xx='img_icon_'+"+as_curr_var+"; var gx=dojo.byId(xx); if (gx) {dojo.style(gx,'opacity',0.7);} "+as_curr_var+"='"+as_icon+"';");
//		alert(ls_s);
		window.eval(ls_s);
	}
	if (!ab_on) return;
	var luo_i = dojo.byId('img_icon_'+as_icon);
	if (luo_i) dojo.style(luo_i,'opacity',1.0);
}
//Drop Down/Overlapping Content: http://www.dynamicdrive.com
var dropdowncontent={
	disableanchorlink: true,
	hidedivmouseout: [true, 200],
	ajaxloadingmsg: "Loading content. Please wait...",
	ajaxbustcache: true,

	getposOffset:function(what, offsettype){
		return (what.offsetParent)? what[offsettype]+this.getposOffset(what.offsetParent, offsettype) : what[offsettype]
	},

	isContained:function(m, e){
		var e=window.event || e
		var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
		while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
		if (c==m)
			return true
		else
			return false
	},

	show:function(anchorobj, subobj, e){
		if (!this.isContained(anchorobj, e) || (e && e.type=="click")){
			var e=window.event || e
			if (e.type=="click" && subobj.style.visibility=="visible"){
				subobj.style.visibility="hidden"
				return
			}
			if (!subobj.dropposition) {
				var ls_dp = subobj.getAttribute("droppos");
				if (ls_dp == null) subobj.dropposition = new Array("left","top");
				else subobj.dropposition = ls_dp.split("-");
			}
			var horizontaloffset=((subobj.dropposition[0]=="left")? -(subobj.offsetWidth-anchorobj.offsetWidth) : 0) + gi_offset_dw; //calculate user added horizontal offset
			var verticaloffset=((subobj.dropposition[1]=="top")? -subobj.offsetHeight : anchorobj.offsetHeight) + gi_offset_dh; //calculate user added vertical offset
//			subobj.style.left=getOffsetLeft(anchorobj) + horizontaloffset + "px"
//			subobj.style.top=getOffsetTop(anchorobj) + verticaloffset+"px"
			subobj.style.left=this.getposOffset(anchorobj, "offsetLeft") + horizontaloffset + "px";
			subobj.style.top=this.getposOffset(anchorobj, "offsetTop") + verticaloffset + "px";
			subobj.style.clip=(subobj.dropposition[1]=="top")? "rect(auto auto auto 0)" : "rect(0 auto 0 0)" //hide drop down box initially via clipping
			subobj.style.visibility="visible"
			subobj.startTime=new Date().getTime()
			subobj.contentheight=parseInt(subobj.offsetHeight)
			if (typeof window["hidetimer_"+subobj.id]!="undefined") //clear timer that hides drop down box?
				clearTimeout(window["hidetimer_"+subobj.id])
			this.slideengine(subobj, (subobj.dropposition[1]=="top")? "up" : "down")
		}
	},

	curveincrement:function(percent){
		return (1-Math.cos(percent*Math.PI)) / 2 //return cos curve based value from a percentage input
	},

	slideengine:function(obj, direction){
		var elapsed=new Date().getTime()-obj.startTime //get time animation has run
		if (!obj.glidetime) {
			obj.glidetime = parseInt(obj.getAttribute("glidetime"));
			if (isNaN(obj.glidetime)) obj.glidetime = 300;
		}
		if (elapsed<obj.glidetime){ //if time run is less than specified length
			var distancepercent=(direction=="down")? this.curveincrement(elapsed/obj.glidetime) : 1-this.curveincrement(elapsed/obj.glidetime)
			var currentclip=(distancepercent*obj.contentheight)+"px"
			obj.style.clip=(direction=="down")? "rect(0 auto "+currentclip+" 0)" : "rect("+currentclip+" auto auto 0)"
			window["glidetimer_"+obj.id]=setTimeout(function(){dropdowncontent.slideengine(obj, direction)}, 10)
		}
		else{ //if animation finished
			obj.style.clip="rect(0 auto auto 0)"
		}
	},

	hide:function(activeobj, subobj, e){
		if (!dropdowncontent.isContained(activeobj, e)){
			window["hidetimer_"+subobj.id]=setTimeout(function(){
				subobj.style.visibility="hidden"
				subobj.style.left=subobj.style.top=0
				clearTimeout(window["glidetimer_"+subobj.id])
			}, dropdowncontent.hidedivmouseout[1])
		}
	},

	hidediv:function(subobjid){
		document.getElementById(subobjid).style.visibility="hidden"
	},

	ajaxconnect:function(pageurl, divId){
		var page_request = false
		var bustcacheparameter=""
		if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc
			page_request = new XMLHttpRequest()
		else if (window.ActiveXObject){ // if IE6 or below
			try {
			page_request = new ActiveXObject("Msxml2.XMLHTTP")
			} 
			catch (e){
				try{
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e){}
			}
		}
		else
			return false
		document.getElementById(divId).innerHTML=this.ajaxloadingmsg //Display "fetching page message"
		page_request.onreadystatechange=function(){dropdowncontent.loadpage(page_request, divId)}
		if (this.ajaxbustcache) //if bust caching of external page
			bustcacheparameter=(pageurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
		page_request.open('GET', pageurl+bustcacheparameter, true)
		page_request.send(null)
	},

	loadpage:function(page_request, divId){
		if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
			document.getElementById(divId).innerHTML=page_request.responseText
		}
	},

 init:function(anchorid, pos, glidetime, revealbehavior){
		var anchorobj=document.getElementById(anchorid)
		var subobj=document.getElementById(anchorobj.getAttribute("rel"))
		var subobjsource=anchorobj.getAttribute("rev")
		if (subobjsource!=null && subobjsource!="")
			this.ajaxconnect(subobjsource, anchorobj.getAttribute("rel"))
		subobj.dropposition=pos.split("-")
		subobj.glidetime=glidetime || 1000
		subobj.style.left=subobj.style.top=0
		if (typeof revealbehavior=="undefined" || revealbehavior=="mouseover"){
			anchorobj.onmouseover=function(e){dropdowncontent.show(this, subobj, e)}
			anchorobj.onmouseout=function(e){dropdowncontent.hide(subobj, subobj, e)}
			if (this.disableanchorlink) anchorobj.onclick=function(){return false}
		}
		else
			anchorobj.onclick=function(e){dropdowncontent.show(this, subobj, e); return false}
		if (this.hidedivmouseout[0]==true) //hide drop down DIV when mouse rolls out of it?
			subobj.onmouseout=function(e){dropdowncontent.hide(this, subobj, e)}
	}
}//END_DROPDOWN
// -->