<!--
function isEmailAddr(email)
{
  var result = false;
  var theStr = new String(email);
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function validRequired(formField,fieldLabel,defaultVal)
{
	var result = true;
	var errDisplay = document.getElementById("err"+formField.name);
	if (formField.value == "" || formField.value == defaultVal)
	{
		errDisplay.innerHTML = "Please enter a value for the \"" + fieldLabel +"\" field."
		//alert('Please enter a value for the "' + fieldLabel +'" field.');
		formField.focus();
		result = false;
	}
	
	return result;
}

function allDigits(str)
{
	return inValidCharSet(str,"0123456789");
}

function inValidCharSet(str,charset)
{
	var result = true;

	// Note: doesn't use regular expressions to avoid early Mac browser bugs	
	for (var i=0;i<str.length;i++)
		if (charset.indexOf(str.substr(i,1))<0)
		{
			result = false;
			break;
		}
	
	return result;
}

function validEmail(formField,fieldLabel,defaultVal,required)
{
	var result = true;
	var errDisplay = document.getElementById("err"+formField.name);
	if (required && !validRequired(formField,fieldLabel))
		result = false;

	if (result && ((formField.value.length < 3) || !isEmailAddr(formField.value)) )
	{
		errDisplay.innerHTML = "Please enter a complete email address in the form: yourname@yourdomain.com"
		formField.focus();
		result = false;
	}
   
  return result;

}

function validNum(formField,fieldLabel,defaultVal,required)
{
	var result = true;
	var errDisplay = document.getElementById("err"+formField.name);
	if (required && !validRequired(formField,fieldLabel))
		result = false;
  
 	if (result)
 	{
 		if (!allDigits(formField.value))
 		{
 			errDisplay.innerHTML = "Please enter a complete email address in the form: yourname@yourdomain.com"
			formField.focus();		
			result = false;
		}
	} 
	
	return result;
}


function validInt(formField,fieldLabel,required)
{
	var result = true;

	if (required && !validRequired(formField,fieldLabel))
		result = false;
  
 	if (result)
 	{
 		var num = parseInt(formField.value,10);
 		if (isNaN(num))
 		{
 			alert('Please enter a number for the "' + fieldLabel +'" field.');
			formField.focus();		
			result = false;
		}
	} 
	
	return result;
}


function validDate(formField,fieldLabel,required)
{
	var result = true;

	if (required && !validRequired(formField,fieldLabel))
		result = false;
  
 	if (result)
 	{
 		var elems = formField.value.split("/");
 		
 		result = (elems.length == 3); // should be three components
 		
 		if (result)
 		{
 			var month = parseInt(elems[0],10);
  			var day = parseInt(elems[1],10);
 			var year = parseInt(elems[2],10);
			result = allDigits(elems[0]) && (month > 0) && (month < 13) &&
					 allDigits(elems[1]) && (day > 0) && (day < 32) &&
					 allDigits(elems[2]) && ((elems[2].length == 2) || (elems[2].length == 4));
 		}
 		
  		if (!result)
 		{
 			alert('Please enter a date in the format MM/DD/YYYY for the "' + fieldLabel +'" field.');
			formField.focus();		
		}
	} 
	
	return result;
}

function validateForm(frm)
{
	// Customize these calls for your form

	// Start ------->
	if (!validRequired(frm.Name,"Name", "Your Name"))
		return false;

	if (!validEmail(frm.Email,"Email Address","Your Email Address",true))
		return false;

	//if (!validDate(frm.available,"Date Available",true))
	//	return false;

	if (!validNum(frm.Phone,"Phone Number",true))
		return false;
		
	if (!validRequired(frm.AddressLine1,"Address",true))
		return false;
		
	if (!validRequired(frm.City,"City",true))
		return false;
		
	if (!validRequired(frm.State,"State",true))
		return false;
	// <--------- End
	
	return true;
}

__n = false;
function isIE() {
	if (!__n)
		__n = navigator.appVersion;

	if (__n.indexOf('MSIE') != -1)
		return __n;
	
	return false;
}



function newWin(loc, w, h) {
	if (!w) { w = 630;}
	if (!h) { h = 500;}
	window.open(loc,"images","height="+h+",width="+w+",status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes");
	return false;
	
}

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days,path,domain,secure) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime() + (days*24*60*60*1000) );
   		expires = date.toGMTString();
  	}
   document.cookie = name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
  	var cookie = readCookie("style");
  	var title = cookie ? cookie : getPreferredStyleSheet();
	setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 180, "/");
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

csize = 0;
szs = ['80%','90%','100%','110%','120%','130%','140%'];

function textSize(dir) {
	var cs = parseFloat(readCookie("txtsize"));
	if (!cs) { cs = csize; }
	if (dir=="up") {
			if (cs < szs.length-1) { 
				cs += 1;
				setSize(cs); 
			}
	} else {
			if (cs >= 1) { 
				cs -= 1;
				setSize(cs); 
			}
		}
}
function setSize(size) {
		createCookie("txtsize", size, 180, "/");
		csize = size;
		document.body.style.fontSize = szs[size];
}
function getAccessButtons(){
		html = "";	return html;
}
/*
function adjustClass(node, debug) {

  		if (node.nodeName=="LI") {
  			node.onmouseover=function() {
  				this.className="hover";
  				
    		}
  			node.onmouseout=function() {
  				this.className=this.className.replace("hover", "");
   			}
		}
}
startList = function() {
	
		if (document.all && document.getElementById) {	
			n = document.getElementById("topnav").childNodes[0];
			
			if (n) {
			l = n.childNodes.length;
			
			for (i=0; i<l; i++) {
 				node = n.childNodes[i];
 				adjustClass(node);
 				nl = node.childNodes.length;
 				
 				for (j=0;j<nl;j++) {
 					cn = node.childNodes[j];
 					
 					if (cn.nodeName=="UL") {
 						cl = cn.childNodes.length;
 						
 						for (k=0; k<cl; k++) {
 							cnode = cn.childNodes[k];	
 							adjustClass(cnode);
 						}
 					}
 				}	
			}
			}
		}
}
window.onload=startList;
*/

//UTILITIES
var isDOM = document.getElementById;


d = {
	$: function(id) {
		return document.getElementById(id);
	},
	getByTag: function(tagname) {
		return document.getElementsByTagName(tagname);
	}
}


function getById(id) {
		return document.getElementById(id);
	}


function getParentNodeByType(obj, type) {
		pn = obj.parentNode;
		if (pn.nodeName == type || pn.nodeName == type.toUpperCase()) {
				return pn;
			}
				
		return getParentNodeByType(pn, type);
	}


function removeWhiteSpaceNodes(parobj) {
			var notWhiteSpaceNode = /\S/;
				
			for (i=0;i<parobj.childNodes.length;i++){
				if ((parobj.childNodes[i].nodeType == 3) && (!notWhiteSpaceNode.test(parobj.childNodes[i].nodeValue))) {
					parobj.removeChild(parobj.childNodes[i]);
						i--;
				}
			}
		}

//



function TextScroller() 
{
	
	// @private
	var _d_ = document;
	var _mm_ = "mousemove";
	var _omm_ = "onmousemove";
	var _md_ = "mousedown";
	var _omd_ = "onmousedown";
	var _mu_ = "mouseup";
	var _omu_ = "onmouseup";
	var _omov_ = "onmouseover";
	var _omo_ = "onmouseout";
	var _text = '';
	var aintrvl;
	
	// @public
	this.content = '';
	this.height = '';
	
	
	
	// @private Methods
	this.__init = function() {
				
		removeWhiteSpaceNodes(this.content);
		
		_text = this.content.childNodes[1];
		
		_text.style.height = this.height + 'px';
		_text.style.overflow = 'hidden';
		
		
		//this.__attachHandler(_text, _omov_, __stopScroll);
		//this.__attachHandler(_text, _omo_, this.__startScroll);
		
		this.__startScroll('+');

	}
	
	
	
	this.__startScroll = function() {
		
		
		var dir = '+';
		var y = 0;
		
		aintrvl = setInterval("_animate('+')",50);
		var _tsH = _text.scrollHeight;
		var _tsT = _text.scrollTop;
		
		_animate = function() {
			
			_text.scrollTop = y;
			
			if (dir == '+') {
				y+=1;
				if (y >= (_tsH/1.5)-1) {
					dir = '-';
				}
			} else {
				y-=1;
				if (y <= -20) {
					dir = '+';
					
					//clearInterval(aintrvl)
					//y=0;
					
				}
				
			}
		}	
	
	}
	
	
	this.stopScroll = function() {
		//alert(this);
		clearInterval(aintrvl);
	
	}
	
	this.__attachHandler = function(obj, evt, func) {
			obj.addEventListener(evt, func, false);
	
	}
	
	this.startScroll = function(pnl) {
		this.content = pnl;
		
		this.__init();
		
	}
	
	
	
}



function setTextScroller() {
	pnl = getById("fragsuccess");	
	
	if (pnl) {
		pnl.scroller = new TextScroller();
	
		pnl.scroller.height = 200;
	
		pnl.scroller.startScroll(pnl);
		
	} else {
		return;
	}

}




function domReady()
{
	this.n = typeof this.n == 'undefined' ? 0 : this.n + 1;
	
	if (typeof document.getElementsByTagName != 'undefined' 
		&& (document.getElementsByTagName('body')[0] != null || document.body != null)) {	
		//alert("The DOM is ready!");

	} else if(this.n < 60) {
		setTimeout('domReady()', 250);
	}
};

//domReady();

PNG = {
	fixed: [],
	needFix: function (img) {
		var ie = isIE();
		if (!ie)
			return false;

		var arVersion = ie.split("MSIE")
		var version = parseFloat(arVersion[1])
	
		if ((version <= 5.5) || (!document.body.filters))
			return false;
		
		var imgName = img.src
		if (!imgName)
			return false;
		
		imgName = imgName.toUpperCase()
		if (imgName.substring(imgName.length-3, imgName.length) != "PNG")
			return false;
		
		return true;
	},
	isFixed: function(img) {
		for (f=0;f<this.fixed.length;f++) {
			if (this.fixed[f] == img)
				return true;
				
		}
		return false;
	},

	fixAll: function() {
		var imgs = d.getByTag('img');
		var imgl = imgs.length;
		
	   for(var i=0; i<imgl; i++) {
		  this.fix(imgs[i]);  
	   }
	
	},
	
	fix: function(img) {
		
		if (!this.needFix(img) || this.isFixed())
			return true;
		
		
		var src = img.src;		
		var imgName = src.toUpperCase()
		
		var imgID = (img.id) ? "id='" + img.id + "' " : ""
		var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		var imgStyle = "display:inline-block;" + img.style.cssText 
			if (img.align == "left") imgStyle = "float:left;" + imgStyle
			if (img.align == "right") imgStyle = "float:right;" + imgStyle
			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
			var strNewHTML = "<span " + imgID + imgClass + imgTitle
			 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			 + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			 + "(src=\'" + src + "\', sizingMethod='scale');\"></span>" 
			 img.outerHTML = strNewHTML

		this.fixed.push(img);
	}
}

function fixPNG(img) {
	PNG.fix(img);
}

fixed_all_pngs = false;
function fixPNGs() {
	PNG.fixAll();	
}

window.onload = function() {
		setTextScroller();
		fixPNGs();
	};

/***********************************************
* Switch Content script II- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated April 2nd, 2005.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var memoryduration="7" //persistence in # of days

var contractsymbol='/images/minus.gif' //Path to image to represent contract state.
var expandsymbol='/images/plus.gif' //Path to image to represent expand state.

/////No need to edit beyond here //////////////////////////

function getElementbyClass(rootobj, classname){
var temparray=new Array()
var inc=0
var rootlength=rootobj.length
for (i=0; i<rootlength; i++){
if (rootobj[i].className==classname)
temparray[inc++]=rootobj[i]
}
return temparray
}

function sweeptoggle(ec){
var inc=0
while (ccollect[inc]){
ccollect[inc].style.display=(ec=="contract")? "none" : ""
inc++
}
revivestatus()
}


function expandcontent(curobj, cid){
if (ccollect.length>0){
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="none")? "none" : ""
curobj.src=(document.getElementById(cid).style.display=="none")? expandsymbol : contractsymbol
}
}

function revivecontent(){
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="none"
}

function revivestatus(){
var inc=0
while (statecollect[inc]){
if (ccollect[inc].style.display=="none")
statecollect[inc].src=expandsymbol
else
statecollect[inc].src=contractsymbol
inc++
}
}

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=="none")
selectedItem+=ccollect[inc].id+"|"
inc++
}
if (get_cookie(window.location.pathname)!=selectedItem){ //only update cookie if current states differ from cookie's
var expireDate = new Date()
expireDate.setDate(expireDate.getDate()+parseInt(memoryduration))
document.cookie = window.location.pathname+"="+selectedItem+";path=/;expires=" + expireDate.toGMTString()
}
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
var alltags=document.all? document.all : document.getElementsByTagName("*")
ccollect=getElementbyClass(alltags, "switchcontent")
statecollect=getElementbyClass(alltags, "showstate")
if (enablepersist=="on" && get_cookie(window.location.pathname)!="" && ccollect.length>0)
revivecontent()
if (ccollect.length>0 && statecollect.length>0)
revivestatus()
}

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


//Another try
function showhidediv( elemID )
{
    var elem = document.getElementById( elemID );
    if( elem.style.display != 'block' )
    {
        elem.style.display = 'block';
    }
    else
    {
        elem.style.display = 'none';
    }
}