function flash() {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="352" height="280" id="flash" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="multimedia/myFox.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="multimedia/myFox.swf" wmode="transparent" quality="high" bgcolor="#ffffff" width="352" height="280" name="flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}

function flash01() {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="352" height="302" id="flash" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="multimedia/DERM-KTRK.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="multimedia/DERM-KTRK.swf" wmode="transparent" quality="high" bgcolor="#ffffff" width="352" height="302" name="flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}

window.addEvent('domready', function(){
	var szNormal = 175, szSmall  = 105, szFull   = 308;
	//var szNormal = 100, szSmall  = 100, szFull   = 144;
	
	var kwicks = $$("#kwicks .kwick");
	var fx = new Fx.Elements(kwicks, {wait: false, duration: 300, transition: Fx.Transitions.Back.easeOut});
	kwicks.each(function(kwick, i) {
		kwick.addEvent("mouseenter", function(event) {
			var o = {};
			o[i] = {width: [kwick.getStyle("width").toInt(), szFull]}
			kwicks.each(function(other, j) {
				if(i != j) {
					var w = other.getStyle("width").toInt();
					if(w != szSmall) o[j] = {width: [w, szSmall]};
				}
			});
			fx.start(o);
		});
	});
	
	$("kwicks").addEvent("mouseleave", function(event) {
		var o = {};
		kwicks.each(function(kwick, i) {
			o[i] = {width: [kwick.getStyle("width").toInt(), szNormal]}
		});
		fx.start(o);
	})
	
}); 


function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
}
function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}


function toggle(id){
	ol = "ol_" + id;
	img = "img_" + id;
	olElement = document.getElementById(ol);
	imgElement = document.getElementById(img);
	if (id, olElement){
		if (olElement.className == 'off' && id == 'motor') {
			olElement.className = "on";
			imgElement.src = "images/minus.gif";
			document.getElementById("ol_product").className = "off";
			document.getElementById("img_product").src = "images/plus.gif";
			document.getElementById("ol_train").className = "off";
			document.getElementById("img_train").src = "images/plus.gif";
			document.getElementById("ol_whistle").className = "off";
			document.getElementById("img_whistle").src = "images/plus.gif";
			document.getElementById("ol_premises").className = "off";
			document.getElementById("img_premises").src = "images/plus.gif";
			document.getElementById("ol_boat").className = "off";
			document.getElementById("img_boat").src = "images/plus.gif";
		} else if (olElement.className == 'off' && id == 'product') {
			olElement.className = "on";
			imgElement.src = "images/minus.gif";
			document.getElementById("ol_motor").className = "off";
			document.getElementById("img_motor").src = "images/plus.gif";
			document.getElementById("ol_train").className = "off";
			document.getElementById("img_train").src = "images/plus.gif";
			document.getElementById("ol_whistle").className = "off";
			document.getElementById("img_whistle").src = "images/plus.gif";
			document.getElementById("ol_premises").className = "off";
			document.getElementById("img_premises").src = "images/plus.gif";
			document.getElementById("ol_boat").className = "off";
			document.getElementById("img_boat").src = "images/plus.gif";
		} else if (olElement.className == 'off' && id == 'train') {
			olElement.className = "on";
			imgElement.src = "images/minus.gif";
			document.getElementById("ol_motor").className = "off";
			document.getElementById("img_motor").src = "images/plus.gif";
			document.getElementById("ol_product").className = "off";
			document.getElementById("img_product").src = "images/plus.gif";
			document.getElementById("img_premises").src = "images/plus.gif";
			document.getElementById("ol_boat").className = "off";
			document.getElementById("img_boat").src = "images/plus.gif";
			document.getElementById("ol_whistle").className = "off";
			document.getElementById("img_whistle").src = "images/plus.gif";
			document.getElementById("ol_premises").className = "off";
		}  else if (olElement.className == 'off' && id == 'premises') {
			olElement.className = "on";
			imgElement.src = "images/minus.gif";
			document.getElementById("ol_motor").className = "off";
			document.getElementById("img_motor").src = "images/plus.gif";
			document.getElementById("ol_product").className = "off";
			document.getElementById("img_product").src = "images/plus.gif";
			document.getElementById("ol_train").className = "off";
			document.getElementById("img_train").src = "images/plus.gif";
			document.getElementById("ol_boat").className = "off";
			document.getElementById("img_boat").src = "images/plus.gif";
			document.getElementById("ol_whistle").className = "off";
			document.getElementById("img_whistle").src = "images/plus.gif";
		} else if (olElement.className == 'off' && id == 'boat') {
			olElement.className = "on";
			imgElement.src = "images/minus.gif";
			document.getElementById("ol_motor").className = "off";
			document.getElementById("img_motor").src = "images/plus.gif";
			document.getElementById("ol_product").className = "off";
			document.getElementById("img_product").src = "images/plus.gif";
			document.getElementById("ol_train").className = "off";
			document.getElementById("img_train").src = "images/plus.gif";
			document.getElementById("ol_premises").className = "off";
			document.getElementById("img_premises").src = "images/plus.gif";
			document.getElementById("ol_whistle").className = "off";
			document.getElementById("img_whistle").src = "images/plus.gif";
		} else if (olElement.className == 'off' && id == 'whistle') {
			olElement.className = "on";
			imgElement.src = "images/minus.gif";
			document.getElementById("ol_motor").className = "off";
			document.getElementById("img_motor").src = "images/plus.gif";
			document.getElementById("ol_product").className = "off";
			document.getElementById("img_product").src = "images/plus.gif";
			document.getElementById("ol_train").className = "off";
			document.getElementById("img_train").src = "images/plus.gif";
			document.getElementById("ol_premises").className = "off";
			document.getElementById("img_premises").src = "images/plus.gif";
			document.getElementById("ol_boat").className = "off";
			document.getElementById("img_boat").src = "images/plus.gif";
		} else {
			olElement.className = "off";
			imgElement.src = "images/plus.gif";
		}
	}
}




sfHover = function() {
	var sfEls = document.getElementById("topNav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



var $j = jQuery.noConflict();
$j(document).ready(function(){ 

	// QC Contact 
	$j(".qc-hidden").hide(); 		
	
	  
	// Show the hidden fields
	$j("#textarea").focus(function() {		   
	   $j(".qc-hidden").fadeIn("slow");
	});
	
	// The below code will change the active fields CSS class (.active) and remove the initial text.  
	$j("input, textarea").focus(function(){
	  $j(this).addClass("active");
		  if( this.value == this.defaultValue ) {
			this.value = "";
		}
	});

	// The below code will remove the CSS class (.active) and add back the initial text if nothing was entered. 
	$j("input, textarea").blur(function(){
	  $j(this).removeClass("active");
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});

	// If you click any of the defined elements below you will close the open fields. 
	$j("#leftColumn, #mast, #header, #topNav, #sideNav, #empty").click(function(){
		$j(".qc-hidden").fadeOut();

	});
});



