/*---- dt tools v2.3 *//*
Written by: David Tsuji
Help: dt.flodge.com
Last Updated: Tuesday 23 May 2006 : 1127
*/

function dt_error() { try{window.status="Old browser software. Please upgrade."}catch(e){} }

/* ---- BROWSER DETECTION */
function Is () {
    // convert all characters to lowercase to simplify testing
	var agt=navigator.userAgent.toLowerCase();

	// *** BROWSER VERSION ***
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	this.nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
				&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
				&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
	this.nav2 = (this.nav && (this.major == 2));
	this.nav3 = (this.nav && (this.major == 3));
	this.nav4 = (this.nav && (this.major == 4));
	this.nav4up = (this.nav && (this.major >= 4));
	this.navonly      = (this.nav && ((agt.indexOf(";nav") != -1) ||
						  (agt.indexOf("; nav") != -1)) );
	this.nav6 = (this.nav && (this.major == 5));
	this.nav6up = (this.nav && (this.major >= 5));
	this.gecko = (agt.indexOf('gecko') != -1);
	this.ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	this.ie3    = (this.ie && (this.major < 4));
	this.ie4    = (this.ie && (this.major == 4) && (agt.indexOf("msie 4")!=-1) );
	this.ie4up  = (this.ie  && (this.major >= 4));
	this.ie5    = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) );
	this.ie5_5  = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") !=-1));
	this.ie5up  = (this.ie  && !this.ie3 && !this.ie4);
	this.ie5_5up =(this.ie && !this.ie3 && !this.ie4 && !this.ie5);
	this.ie6    = (this.ie && (this.major == 4) && (agt.indexOf("msie 6.")!=-1) );
	this.ie6up  = (this.ie  && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5);

	this.opera = (agt.indexOf("opera") != -1);
	this.opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
	this.opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
	this.opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
	this.opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
	this.opera5up = (this.opera && !this.opera2 && !this.opera3 && !this.opera4);

	// *** PLATFORM ***
	this.win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
	this.win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
	this.win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
	this.winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
	this.win32 = (this.win95 || this.winnt || this.win98 || 
					((this.major >= 4) && (navigator.platform == "Win32")) ||
					(agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));
	this.winme = ((agt.indexOf("win 9x 4.90")!=-1));
	this.win2k = ((agt.indexOf("windows nt 5.0")!=-1));
	this.mac    = (agt.indexOf("mac")!=-1);
	
	// *** PRESET JSA VARS ***
	this.get_ok		= this.nav6up || (this.ie && this.win) || this.opera5up;
	this.get_good	= this.win && this.ie5up;

}
var is;
is = new Is();

/* ---- */

/*---- dt.tools */
dt_toolbox = function() {
	this.attachEvent = function(obj, evt, func) {
		try {
			obj.attachEvent(evt,func);
		} catch(e) {
			try { obj.addEventListener(evt.split("on").join(""),func,false) }catch(e){dt_error()}
		}
	}
	this.detachEvent = function(obj, evt, func) {
		try {
			obj.detachEvent(evt, func);
		} catch(e) {
			try { obj.removeEventListener(evt.split("on").join(""),func) }catch(e){dt_error()}
		}
	}
	this.getPosition = function(o) {
		var x, y;
		
		try {
			x = (o.getBoundingClientRect().left -2) + document.body.scrollLeft;
			y = (o.getBoundingClientRect().top -2) + document.body.scrollTop;
		} catch(e) {
			try {
				x = document.getBoxObjectFor(o).x;
				y = document.getBoxObjectFor(o).y;
			}catch(e) {
				
				try {
					notie_getx = function(p_el) {
						while (p_el.tagName.toLowerCase() == "a") p_el = p_el.firstChild;
						var _xPos = p_el.offsetLeft, _tempEl = p_el.offsetParent;
				
						while ( _tempEl != null ) {
							_xPos += _tempEl.offsetLeft;
							_tempEl = _tempEl.offsetParent;
						}
						return _xPos;
					}
					
					notie_gety = function(p_el) {
						while (p_el.tagName.toLowerCase() == "a") p_el = p_el.firstChild;
						var _yPos = p_el.offsetTop, _tempEl = p_el.offsetParent;
				
						while ( _tempEl != null ) {
							_yPos += _tempEl.offsetTop;
							_tempEl = _tempEl.offsetParent;
						}
						return _yPos;
					}
					x = notie_getx(o);
					y = notie_gety(o);

				} catch(e) {
					x = 0;
					y = 0;
				}
			}
		}
		
		o._x = x;
		o._y = y;
	
	}
	this.flyouts = function() {
		dt.flyouts.fo_arr = new Array();
		dt.attachEvent(window, "onload", dt.flyouts.onload);
	}
	this.flyouts.onload = function() {
		var menu_o;

		try {
			menu_o = document.getElementsByName("fomenu");
			for (var i=0;i<menu_o.length;i++) dt.flyouts.init(menu_o[i]);
		} catch(e) {}

		if (dt.flyouts.hasRun != true) {
			try {	dt.attachEvent(document.body, "onclick", dt.flyouts.kill)					}catch(e){}
			try {	dt.attachEvent(window, "onresize", dt.flyouts.fixPositionsAfterEvent)		}catch(e){}
			try {	dt.attachEvent(window, "onscroll", dt.flyouts.fixPositionsAfterEvent)		}catch(e){}
		}
		
		//-- So the events do not keep attaching
		dt.flyouts.hasRun = true;
	}
	this.flyouts.fixPositionsAfterEvent = function() {
		try { clearInterval(dt.flyouts.fixpos_iid) }catch(e){}
		dt.flyouts.fixpos_iid = setInterval(dt.flyouts.fixPositions, 100);
	}
	this.flyouts.fixPositions = function() {
		var menu_o, flyout_o;
		
		try { clearInterval(dt.flyouts.fixpos_iid) }catch(e){}
		
		menu_o = document.getElementsByName("fomenu");
		for (var i=0;i<menu_o.length;i++) {
			try {
				var foba = navigator.userAgent.toLowerCase();
				var pos_definition_arr = new Array();
				flyout_o = menu_o[i];
				dt.getPosition(flyout_o);
				mpos = flyout_o.getAttribute("foposition").split(",");
				switch(mpos.length) {
					case 2:
						pos_definition_arr.push(0);
						pos_definition_arr.push(1);
					break;
					case 4:
						if ((foba.indexOf("msie") != -1) && (foba.indexOf("opera") == -1)) {
							pos_definition_arr.push(0);
							pos_definition_arr.push(1);
						} else {
							pos_definition_arr.push(2);
							pos_definition_arr.push(3);
						}
					break;
					default:
						if ((foba.indexOf("msie") != -1) && (foba.indexOf("opera") == -1)) {
							pos_definition_arr.push(0);
							pos_definition_arr.push(1);
						} else if (	(foba.indexOf('mozilla')!=-1) && (foba.indexOf('spoofer')==-1)
									&& (foba.indexOf('compatible') == -1) && (foba.indexOf('opera')==-1)
									&& (foba.indexOf('webtv')==-1) && (foba.indexOf('hotjava')==-1)
									&& (foba.indexOf('safari')==-1) ) {
							pos_definition_arr.push(2);
							pos_definition_arr.push(3);
						} else {
							pos_definition_arr.push(4);
							pos_definition_arr.push(5);
						}
					break;
				}
				if (!parseInt(mpos[pos_definition_arr[0]])) {
					if (mpos[pos_definition_arr[0]].indexOf("this") != -1) mpos[pos_definition_arr[0]] = mpos[pos_definition_arr[0]].replace("this", "flyout_o._x");
					mpos[pos_definition_arr[0]] = eval(mpos[pos_definition_arr[0]]);
				}
				if (!parseInt(mpos[pos_definition_arr[1]])) {
					if (mpos[pos_definition_arr[1]].indexOf("this") != -1) mpos[pos_definition_arr[1]] = mpos[pos_definition_arr[1]].replace("this", "flyout_o._y");
					mpos[pos_definition_arr[1]] = eval(mpos[pos_definition_arr[1]]);
				}
				document.getElementsByName(flyout_o.getAttribute("fomenu"))[0].style.left = mpos[pos_definition_arr[0]]+"px";
				document.getElementsByName(flyout_o.getAttribute("fomenu"))[0].style.top = mpos[pos_definition_arr[1]]+"px";
			}catch(e){}
		}
	}
	this.flyouts.show = function() {
		var o = dt.flyouts.fo_arr[0];
		//dt.flyouts.fixPositions();
		try {
			
			while(o.getAttribute("fochildof")!=null) {
				o = document.getElementsByName(o.getAttribute("fochildof"))[0];
				dt.flyouts.fo_arr.push(o);
			}
			
		}catch(e){}
		
		for (var i=0; i<dt.flyouts.fo_arr.length; i++) {
			dt.flyouts.fo_arr[i].style.visibility = "visible";
		}

		dt.flyouts.showHideSelects("hidden");
		try { clearInterval(dt.flyouts.check_iid) }catch(e){}
		dt.flyouts.check_iid = setInterval(dt.flyouts.hide, 1500);
	}
	this.flyouts.init = function(flyout_o) {
		var sticky_bln = false;

		// Used in the vertical navs where the flyouts double as sticky static navs
		//if (o.getAttribute("stickonurl")) if (location.href.match(o.getAttribute("stickonurl"))) sticky_bln = true;
		if (flyout_o.getAttribute("fomenu") == null) {

			try {
				if (dt.flyouts.hasRun != true) dt.attachEvent(flyout_o, "onmouseover", dt.flyouts.kill);
			} catch(e){}
			
		} else if (flyout_o.getAttribute("fomenu") && sticky_bln == false) {

			/*---- Fix Positions */
			dt.flyouts.fixPositions();
			/*---- Fix Positions */

			/*---- Mouse Events */
				//-- Flyout elements
				fo_over_fn = function() {
					var this_o, exist_bln = false;
					try { this_o = event.srcElement } catch(e) { this_o = this }
					try { while (!this_o.getAttribute("fomenu")&&this_o.parentNode) this_o = this_o.parentNode } catch(e){}
					if (dt.flyouts.fo_arr[0] != document.getElementsByName(this_o.getAttribute("fomenu"))[0])
						dt.flyouts.kill();
					dt.flyouts.over_bln = true;
					dt.flyouts.fo_arr.push(document.getElementsByName(this_o.getAttribute("fomenu"))[0]);
					dt.flyouts.show();
				}
		
				fo_out_fn = function() {
					dt.flyouts.over_bln = false;
				}
				
				//-- Flyout elements
				fo_el_over_fn = function() {
					dt.flyouts.over_bln = true;
				}
				
				fo_el_out_fn = function() {
					dt.flyouts.over_bln = false;
				}
				
				//-- Apply mouse events
				if (dt.flyouts.hasRun != true) {
					dt.attachEvent(flyout_o, "onmouseover", fo_over_fn);
					dt.attachEvent(flyout_o, "onmouseout", fo_out_fn);
					try {
						dt.attachEvent(document.getElementsByName(flyout_o.getAttribute("fomenu"))[0], "onmouseover", fo_el_over_fn);
						dt.attachEvent(document.getElementsByName(flyout_o.getAttribute("fomenu"))[0], "onmouseout", fo_el_out_fn);
					} catch(e){}
				}
			/*---- Mouse Events */

		}
	}
	this.flyouts.kill = function(fn) {
		for (var i=0; i<dt.flyouts.fo_arr.length; i++) {
			
			dt.flyouts.fo_arr[i].style.visibility = "hidden";
			
		}
		dt.flyouts.fo_arr = new Array();
		dt.flyouts.over_bln = false;
		try { clearInterval(dt.flyouts.check_iid) } catch(e){}
		dt.flyouts.check_iid = null;
		dt.flyouts.showHideSelects("visible");
	}
	this.flyouts.hide = function() {
		if (dt.flyouts.over_bln != true) dt.flyouts.kill();
	}
	this.flyouts.showHideSelects = function() {
		try {
			for (var i=0; (select_o=document.getElementsByTagName("SELECT")[i]); i++)
				select_o.style.visibility = type;
		} catch(e){}
	}
	this.connect = function(url,my_form,func,dt_loading_anime) {
		var oargs = new Array(), xmlhttp, form_str="", field_type;
		
		(!dt_loading_anime) ? dt_loading_anime = "dt_loading_anime" : void(0);
		
		clearInterval(dt.connect.timeout_iid);
		try { document.getElementsByName(dt_loading_anime)[0].style.visibility="visible" } catch(e) {}
	
		// Collate and format form data if it exists
		if (my_form) {
			name_fn = function(f) {
				if (f.getAttribute("id")!="") return f.getAttribute("id");
				else return f.getAttribute("name");
			}
			ampersand_fn = function(i) { if (i<(my_form.length-1)) return "&"; else return "" }
			for (var i=0; i<my_form.length; i++) {
				try { field_type = my_form[i].type } catch(e){field_type="none"}
				switch (field_type.toLowerCase()) {
					case "checkbox":
						if (my_form[i].checked)
							form_str += name_fn(my_form[i]) + "=" + escape(my_form[i].value) + ampersand_fn(i);
					break;
					
					case "radio":
						if (my_form[i].checked)
							form_str += name_fn(my_form[i]) + "=" + escape(my_form[i].value) + ampersand_fn(i);
					break;
					
					default:
						form_str += name_fn(my_form[i]) + "=" + escape(my_form[i].value) + ampersand_fn(i);
					break;
				}
			}
		}

		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(f) {
				try {
					xmlhttp = new XMLHttpRequest();
				} catch (g) {}
			}
		}

		done_fn = function() {
			var write_error_bln;
			hide_anime_fn = function() {try { document.getElementsByName(dt_loading_anime)[0].style.visibility="hidden" } catch(e) {}}
			if (xmlhttp.readyState==4) {
				clearInterval(dt.connect.timeout_iid);
				if (	xmlhttp.responseText.match(/Microsoft VBScript runtime error/)!=null ||
						xmlhttp.responseText.match(/runtime error/)!=null ||
						xmlhttp.responseText.match(/line \d/)!=null ||
						xmlhttp.responseText.match(/Variable is undefined/)!=null ||
						xmlhttp.responseText.match(/The page cannot be found/)!=null ||
						xmlhttp.responseText.match(/HTTP Error/)!=null ||
						xmlhttp.responseText.match(/ADODB.Recordset error/)!=null ||
						xmlhttp.responseText.match(/Microsoft JET Database Engine error/)!=null
						) write_error_bln = true;
				if (xmlhttp.status==200&&write_error_bln!=true) {
					hide_anime_fn();
					try { func(xmlhttp.responseText) } catch(e) {}
				} else {
						
					var shadow = dt.shadow.show(80);
					shadow.innerHTML = "<p align=\"center\"><span style=\"border:1px solid #000;margin-top:30px;padding:10px;width:500px;background-color:#FFFFFF\"><p style=\"font-size:20px;font-weight:bold\">server error</p>"+xmlhttp.responseText+"<p style=\"color:#FF0000;cursor:hand\" onclick=\"dt.shadow.hide()\">close</p></span></p>";
					
					hide_anime_fn();

				}
			}
		}

		try {
			window.attachEvent();
			xmlhttp.onreadystatechange = done_fn;
		} catch (e) {
			xmlhttp.onreadystatechange = function() { done_fn() }
		}
		
		//-- Fix cache
		var cache_id = new Date();
		cache_id = cache_id.getTime();
		url += (url.match("\\?")) ? "&cache_id=" + cache_id : "?cache_id=" + cache_id;
		//-- Fix cache
		
		if (my_form) {
			xmlhttp.open("POST",url,true);
			xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			xmlhttp.send(form_str);
		} else {
			xmlhttp.open("GET",url,true);
			xmlhttp.send(null);		
		}
		timeout_fn = function() {
			clearInterval(dt.connect.timeout_iid);
			window.status = "There was an error connecting to the server - try again in a few minutes";
		}
		dt.connect.timeout_iid = setInterval(timeout_fn, 20000);
	}
	this.shadow = function(){}
	this.shadow.show = function(opacity_num) {
		/*
		[WRITTEN]	JSA DIGITAL (David Tsuji) | www.jsa.com.au
		[VERSION]	1.0.0 CREATE SHADOW
		*/
		
		var o, opacity_arr = new Array("00","11","22","33","44","55","66","77","88","99","A1","A9","B1","B9","C1","C9","D1","D9","E1","FF");
		
		opacity_num = (parseFloat(opacity_num)) ? opacity_num : 90;
		
		try { dt.shadow.hide() } catch(e) {}
		
		try {
			for (var i=0; i<document.getElementsByTagName("SELECT").length; i++) {
				s = document.getElementsByTagName("SELECT")[i];
				s.style.display = "none";
			}
		} catch(e) {}
		
		try {
			document.body.insertAdjacentHTML("afterBegin", ""+
			"<span id=\"shadow\" name=\"shadow\" onclick=\"null\" style=\"position:absolute;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#"+opacity_arr[Math.round(opacity_num/5)]+"000000', EndColorStr='#"+opacity_arr[Math.round(opacity_num/5)]+"000000');opacity:"+(opacity_num/100)+";-moz-opacity:"+(opacity_num/100)+";\">"+
			"</span>");

			o = document.getElementsByName("shadow")[0];
			try {
				with (o.style) {
					backgroundColor="#000000";
					filter="alpha(opacity="+(opacity_num)+")";
				}
			} catch(e) {}
			
			reset_shadow_pos = function() {
				var db = document.body, o = document.getElementsByName("shadow");
				if (o.length>0) {
					o=o[0];
					o.style.width	= db.clientWidth;
					o.style.height	= db.clientHeight;
					o.style.left	= db.scrollLeft;
					o.style.top		= db.scrollTop;
				}
			}

			// OnMove Events
			o.style.backgroundImage = "url(images/filler.gif)";
			dt.attachEvent(window, "onresize", reset_shadow_pos);
			dt.attachEvent(window, "onscroll", reset_shadow_pos);
			reset_shadow_pos();
			o.style.height = document.body.clientHeight;
			o.style.width = document.body.clientWidth;
			return o;
		} catch(e) {}
	}
	this.shadow.hide = function() {
		var s;
		try {
			dt.detachEvent(window, "onresize", reset_shadow_pos);
			dt.detachEvent(window, "onscroll", reset_shadow_pos);
		}catch(e){}
		try {
			document.getElementsByName("shadow")[0].removeNode(true);
		} catch(e) {}
		try {
			for (var i=0; i<document.getElementsByTagName("SELECT").length; i++) {
				s = document.getElementsByTagName("SELECT")[i];
				s.style.display = "inline";
			}
		} catch(e) {}
	}
	this.upload = function(){}
	this.upload.show = function(src, func, valid_arr, args, extra_form_data, _target) {
		var db = document.body, valid_bln = false, valid_files_arr;
		var o_dte = new Date(), o_txt = "div_uploader";
		var hidden_fields="";
		try { valid_files_arr = valid_arr.split(",") } catch(e){}
		try {
			for (var i=0; i<extra_form_data.split("&").length; i++) {
				hidden_fields +=	"<input type=\"hidden\" name=\""+extra_form_data.split("&")[i].split("=")[0]+"\""+
									" id=\""+extra_form_data.split("&")[i].split("=")[0]+"\""+
									" value=\"" + extra_form_data.split("&")[i].split("=")[1]+"\">";
			}
		} catch(e) {}
		(!_target)?_target="iframe_img_upload":void(0);
		var o = "<div id=\""+o_txt+"\" name=\""+o_txt+"\" style=\"display:block;width:393px;height:140px;position:absolute;top:"+(db.scrollHeight-db.scrollTop)+";left:"+((db.scrollWidth/2)-(196))+"\"><form action=\""+src+"\" method=\"post\" enctype=\"multipart/form-data\" name=\"img_upload\" target=\""+_target+"\" id=\"img_upload\" onSubmit=\"return init_progress_bar(this)\" style=\"margin-bottom:0px;width:391px\"><table width=\"100%\" border=\"0\" cellpadding=\"10\" cellspacing=\"3\" bgcolor=\"#FFFFFF\" style=\"border:1px solid #C0C0C0\"><tr><td nowrap style=\"filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#22000000', EndColorStr='#00000000')\"><h1>upload file</h1><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"35\"><tr><td><span id=\"progress_field\" name=\"progress_field\" style=\"display:none;\"></span><span id=\"file_field\" name=\"file_field\"><input type=\"file\" id=\"myfile\" name=\"myfile\" style=\"width:100%\"></span></td></tr></table><p align=\"right\"><input type=\"button\" name=\"Button\" value=\"Cancel\" onClick=\"dt.upload.hide()\"><input name=\"submit_btn\" type=\"submit\" id=\"submit_btn\" value=\"start uploading\"></p></td></tr></table><iframe id=\"iframe_img_upload\" name=\"iframe_img_upload\" style=\"position:absolute;display:none\"></iframe><input type=\"hidden\" name=\"file_name_change\" id=\"file_name_change\" value=\"empty\">"+hidden_fields+"</form></div>";
		dt.shadow.show(90);
		try {
			document.body.insertAdjacentHTML("beforeEnd",o);
			o = document.getElementsByName(o_txt)[0];
			reset_upload_pos = function() {
				var db = document.body, o = document.getElementsByName("div_uploader")[0];
				var body_width	= db.clientWidth;
				var body_height	= db.clientHeight;
				try {
					o.style.left	= db.scrollLeft + ((body_width/2)-(o.offsetWidth/2));
					o.style.top		= db.scrollTop + ((body_height/2)-(o.offsetHeight/2));
				}catch(e){}
			}

			dt.attachEvent(window, "onresize", reset_upload_pos);
			dt.attachEvent(window, "onscroll", reset_upload_pos);
			reset_upload_pos();
		} catch(e) {}
		
		init_progress_bar = function(f) {
			
			var Session = new String();
			
			show_progress_fn = function() {
				var o = document.getElementsByName("progress_field")[0];
				var src, iid, ok_to_query_bln = true;
				server_response_fn = function() {
					write_response_fn = function(bln) {
						o.innerHTML = bln.split("//uploaded//").join("");;
						ok_to_query_bln = true;
		
						if (bln.match("//uploaded//")) {
							clearInterval(iid);
							ok_to_query_bln = false;
							wait_for_changes_fn = function() {
								alert("Your file was uploaded successfully");
								src = (f.file_name_change.value=="empty")?f.myfile.value:f.file_name_change.value;
								try {func(src.split("\\")[src.split("\\").length-1],args)}catch(e){}
								dt.upload.hide();
							}
							setTimeout(wait_for_changes_fn,2000);
						}
		
					}
					if (ok_to_query_bln==true) {
						ok_to_query_bln = false;
						dt.connect("../_dt_connect/dtc_uploadfile_status.asp?Session="+Session, "", write_response_fn);
					}
				}
				iid = setInterval(server_response_fn, 500);
			}
			
			if (valid_files_arr) {
				
				for (var i=0; i<valid_files_arr.length; i++)
					if (f.myfile.value.match(valid_files_arr[i])) valid_bln = true;
					
			} else valid_bln = true;
		
			if (valid_bln == false) {
				alert("only the following file types are permitted to this field.\n\n"+valid_files_arr+"\n\nChoose another file and try again");
				return false;
			} else {
		
				show_progress_fn();
				
				f.submit_btn.disabled = true;
				
				document.getElementsByName("file_field")[0].style.display = "none";
				document.getElementsByName("progress_field")[0].style.display = "block";
			
				Session = Math.floor(Math.random() * 0xFFFFFF).toString(16);
				f.action += "?Session=" + Session;
				
				return true;

			}
		
		}
		
		return o;
	}
	this.upload.hide = function(id) {
		try {
			dt.detachEvent(window, "onresize", reset_upload_pos);
			dt.detachEvent(window, "onscroll", reset_upload_pos);
		}catch(e){}
		try { document.getElementsByName("iframe_img_upload")[0].src = "" } catch(e) {}
		try { dt.shadow.hide() } catch(e) {}
		try { document.getElementsByName("div_uploader")[0].removeNode(true) } catch(e) {}
	}
	this.rollovers = function() {
		for (var i=0;(img=document.images[i]);i++) {
			try {
				if (location.href.match(img.getAttribute("stickonurl"))) {
					img.src = img.getAttribute("stickimg")?img.getAttribute("stickimg"):img.getAttribute("rollover");
				}
			}catch(e){}
			if (img.getAttribute("rollover")&&img.done_bln!=true) {
				img.o=new Image();
				img.n=new Image();
				img.o.src = img.getAttribute("rollover");
				img.n.src = img.src;
				img.done_bln = true;
				over_fn = function() {
					var o;
					try { o=event.srcElement } catch(e) { o=this };
					o.src = o.o.src;
				}
				out_fn = function() {
					var o;
					try { o=event.srcElement } catch(e) { o=this };
					o.src = o.n.src;
				}
				dt.attachEvent(img, "onmouseover", over_fn);
				dt.attachEvent(img, "onmouseout", out_fn);
			}
		}
	}
	this.flash = function() {
		var maxVersion = 9;
		var actualVersion = 0;
	
		try {
			document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
			document.write('on error resume next \n');
			document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
			document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
			document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
			document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
			document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
			document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
			document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
			document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
			document.write('</SCR' + 'IPT\> \n');
		}catch(e){}
		
		if (navigator.plugins) {
			if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
				var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
				var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
				var flashVersion = parseInt(flashDescription.substring(16));
				flash2Installed = flashVersion == 2;
				flash3Installed = flashVersion == 3;
				flash4Installed = flashVersion == 4;
				flash5Installed = flashVersion == 5;
				flash6Installed = flashVersion == 6;
				flash7Installed = flashVersion == 7;
				flash8Installed = flashVersion == 8;
				flash9Installed = flashVersion >= 9;
			}
		}

		for (var i = 2; i <= maxVersion; i++) try { (eval("flash" + i + "Installed")==true)?actualVersion = i:void(0)}catch(e){};
		
		this.flash.max			= maxVersion;
		this.flash.version		= (actualVersion);
		this.flash.installed	= (actualVersion>0);
	}
	this.flash.on = function(version,html) {
		html	= (!parseFloat(version))?version:html;
		version	= (parseFloat(version))?parseFloat(version):-1;
		if (dt.flash.installed) (version > dt.flash.version) ? html="" : void(0);
		else html = "";
		return html;
	}
	this.flash.on.write = function(version,html) {
		document.write( dt.flash.on(version,html) );
	}
	this.flash.off = function(version,html) {
		html	= (!parseFloat(version))?version:html;
		version	= (parseFloat(version))?parseFloat(version):-1;
		html = (!dt.flash.installed || version < dt.flash.version) ? html : "";
		return html;
	}
	this.flash.off.write = function(version,html) {
		document.write( dt.flash.off(version,html) );
	}
	this.flash.embed = function(src,attr) {
		var output, w="", h="", n="", t=null, extra_ax, extra_ed;
		attr = attr.split(" ").join("");
		attr = attr.split(",");
		try { w=attr[0] }catch(e){}
		try { h=attr[1] }catch(e){}
		try { n=attr[2] }catch(e){}
		try { t=attr[3] }catch(e){}
		extra_ax = (t)?"<param name=wmode value=transparent>":"";
		extra_ed = (t!=""||t||t!="false")?"wmode=transparent":"";

		output = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" name=\""+n+"\" id=\""+n+"\" width=\""+w+"\" height=\""+h+"\"><param name=\"movie\" value=\""+src+"\"><param name=quality value=high>"+extra_ax+"<embed src=\""+src+"\" id=\""+n+"\" name=\""+n+"\" width=\""+w+"\" height=\""+h+"\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" "+extra_ed+"></embed></object>";

		return output;
	}
	this.flash.on.attach = function(version, el, html) {
		html	= (!parseFloat(version))?el:html;
		el		= (!parseFloat(version))?version:el;
		version	= (!parseFloat(version))?-1:parseFloat(version);
		try { if (dt.flash.version >= version) document.getElementById(el).innerHTML = html; }catch(e){}
	}
	this.flash.off.attach = function(version, el, html) {
		el		= (!parseFloat(version))?version:el;
		html	= (!parseFloat(version))?el:html;
		version	= (!parseFloat(version))?-1:parseFloat(version);
		try { if (dt.flash.version < version) document.getElementById(el).innerHTML = html; }catch(e){}
	}
	this.validate = function(f, arr) {
		var ei=-1, field, msg = "Please correct the following fields:\n\n", bln = true;
		var email_re  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		error_fn = function(i) {
			var fld = eval("f."+arr[i].split(",")[0]);
			bln=false; ei++;
			msg += "- "+arr[i].split(",")[2]+"\n";
			try {
				(ei==0)?fld.focus():void(0);
				(ei==0)?fld.select():void(0);
				fld.style.borderColor="#FF0000";
				fld.has_error = true;
				fld.oktoclear_bln = false;
			}catch(e){}
		}
		try {
			
			for (var i=0; (i<arr.length); i++) try { eval("f."+arr[i].split(",")[0]+".oktoclear_bln=true") }catch(e){}
			for (var i=0; (i<arr.length); i++) {
			
				field = eval("f."+arr[i].split(",")[0]);
				try { (field.has_error==true&&field.oktoclear_bln==true)?field.style.borderColor="":void(0) }catch(e){}
			
				switch (arr[i].split(",")[1]) {
				
					case "req":	(field.value=="")?error_fn(i):void(0);				break;
					case "eml":	(!field.value.match(email_re))?error_fn(i):void(0);	break;
					case "num":	(!parseFloat(field.value)&&field.value!="0")?error_fn(i):void(0);		break;
					default:	(eval(arr[i].split(",")[1]))?error_fn(i):void(0);	break;

				}
			
			}
			(bln==false)?alert(msg):void(0);
			return bln;
				
		} catch(e) {}

	}
	this.insertAdjacentHTML = function() {
		try {
			document.body.insertAdjacentHTML("beforeEnd","");
		} catch(e) {
			try {
				Object.prototype.insertAdjacentHTML = function(sWhere,sHTML) {
					var df;   // : DocumentFragment
					var r = this.ownerDocument.createRange();
					
					switch (String(sWhere).toLowerCase()) {  // convert to string and unify case
						case "beforebegin":
							r.setStartBefore(this);
							df = r.createContextualFragment(sHTML);
							this.parentNode.insertBefore(df, this);
						break;
						
						case "afterbegin":
							r.selectNodeContents(this);
							r.collapse(true);
							df = r.createContextualFragment(sHTML);
							this.insertBefore(df, this.firstChild);
						break;
						
						case "beforeend":
							r.selectNodeContents(this);
							r.collapse(false);
							df = r.createContextualFragment(sHTML);
							this.appendChild(df);
						break;
						
						case "afterend":
							r.setStartAfter(this);
							df = r.createContextualFragment(sHTML);
							this.parentNode.insertBefore(df, this.nextSibling);
						break;
					}
				}
				Object.prototype.insertAdjacentElement = function(sWhere, element) {
					switch (sWhere.toLowerCase()) {
						case "beforebegin":
							this.parentNode.insertBefore(element, this);
						break;
						case "afterbegin":
							this.insertBefore(element, this.firstChild);
						break;
						case "beforeend":
							this.appendChild(element);
						break;
						case "afterend":
							this.parentNode.insertBefore(element, this.nextSibling);
						break;
					}
				}
			} catch(e) {  }
		}
	}
	this.alert = function() {
		this.alert.autohide_iid = null;
	}
	this.alert.hide = function() {
		try {
			var o = document.getElementsByName("dt_alert_holder")[0];
			dt.detachEvent(window, "onscroll", fix_dtAlert_pos_fn);
			dt.detachEvent(window, "onresize", fix_dtAlert_pos_fn);
			o.innerHTML = "";
		}catch(e){}
		try { clearInterval(dt.alert.autohide_iid) }catch(e){}
		try {
			o.removeNode(true);
		} catch(e) {
			try {o.parentNode.removeChild(o) }catch(e){}
		}
	}
	this.alert.show = function(msg, time) {
		
		try {
			
			time = (!time)?9999:time;
			
			try { clearInterval(dt.alert.autohide_iid); }catch(e){}
			
			try {
				dt.alert.autohide_iid = setInterval("dt.alert.hide()", parseFloat(time)*1000);
			}catch(e){}
			
			var o_holder, o_content_tbl, o_content;			
			
			if (document.getElementsByName("dt_alert_holder").length == 0) {
				document.body.insertAdjacentHTML("afterBegin", "<div id=\"dt_alert_holder\" name=\"dt_alert_holder\" style=\"position:absolute\"><table id=\"dt_alert_bar\" name=\"dt_alert_bar\"><tr><td name=\"dt_alert_content\" id=\"dt_alert_content\"></td><td width=1%><input type=button value=close onclick=dt.alert.hide()></td></tr></table><table style=\"width:100%;height:20px;filter:progid:DXImageTransform.Microsoft.gradient(enabled='true',startColorstr=#99000000, endColorstr=#00000000)\"><tr><td>&nbsp;</td></tr></table></div>");
			}
	
			try {
				o_holder		= document.getElementsByName("dt_alert_holder")[0];
				o_content_tbl	= document.getElementsByName("dt_alert_bar")[0];
				o_content		= document.getElementsByName("dt_alert_content")[0];
		
				o_holder.style.left = "0px";
				o_holder.style.top = "0px";
		
				o_content_tbl.style.borderBottom = "1px solid #EFB539";
				o_content_tbl.style.width = "100%";
				o_content_tbl.style.backgroundColor = "#FFF993";
				o_content_tbl.style.filter = "progid:DXImageTransform.Microsoft.gradient(enabled='true',startColorstr=#FFFFFFAA, endColorstr=#FFFFD16C)";
		
				o_content.style.color = "#000000";
				o_content.style.padding = "10px";
						
				o_content.innerHTML = msg;
				
				o_holder.style.top		= document.body.scrollTop - o_holder.offsetHeight;
			}catch(e){}
			
			fix_dtAlert_pos_fn = function(top_bln) {
				try {
					var o = document.getElementsByName("dt_alert_holder")[0];
					o.style.left	= document.body.scrollLeft;
					o.style.width	= "100%";
					if (top_bln==true)	dt.tween(o_holder, "style.top", "", "this.offsetTop", "document.body.scrollTop", .3);
					else				o.style.top		= document.body.scrollTop;
				}catch(e){}
			}
			fix_dtAlert_pos_fn(true);
			
			try {
				dt.attachEvent(window, "onscroll", fix_dtAlert_pos_fn);
				dt.attachEvent(window, "onresize", fix_dtAlert_pos_fn);
			}catch(e){}
			
		} catch(e){alert(msg)}
	}
	this.tween = function(o, property, easingType, start, end, seconds) {
		try {clearInterval(o.tween.iid) }catch(e){ o.tween = new Object() }
		fn = function() {
			moveto = function(t, b, c, d) {
				if ((t/=d/2) < 1) return c/2*t*t + b;
				return -c/2 * ((--t)*(t-2) - 1) + b;
			}
			try {
				eval("o."+property+" = moveto(o.tween.t, o.tween.b, o.tween.c, o.tween.d)");
				o.tween.t += 10;
				if (o.tween.t > o.tween.d) clearInterval(o.tween.iid);
			}catch(e){ try{clearInterval(o.tween.iid)}catch(e){} }
		}
		o.tween.t = 0;
		o.tween.b = parseFloat(eval(start.toString().split("this").join("o")));
		o.tween.c = parseFloat(eval(end.toString().split("this").join("o")))-parseFloat(eval(start.split("this").join("o")));
		o.tween.d = seconds*1000;
		o.tween.iid = setInterval(fn, 10);
	}
}
var dt = new dt_toolbox();
/*---- dt.tools */

/*---- INIT FLASH */
// Written by: David Tsuji
// Date: Thu 29 August 2005 : 1622
dt.flash();
/*---- INIT FLASH */

/*---- GLOBALISING object.insertAdjacent */
// Written by: David Tsuji, webfx.eae.net
// Date: Wed 27 April 2005 : 1600
dt.attachEvent(window,"onload", dt.insertAdjacentHTML);
/*---- GLOBALISING object.insertAdjacent */

/*---- INIT IMAGE ROLLOVERS */
// Written by: David Tsuji
// Date: Thu 25 August 2005 : 1743
dt.attachEvent(window,"onload", dt.rollovers);
/*---- INIT IMAGE ROLLOVERS */
