/*
	WojzWorld.js - JavaScript Function Library
	
	Author: Kevin P. Wojdak (http://www.wojzworld.com)


*/

// *************************************
// ****** Declare Global Variables *****
// *************************************
//

// initialize the dirtyFlag in memory
var dirtyFlag = false;

// current page
var currPage = '';

// current directory
if (cdir == null || cdir == '') {
	var currDir = '';
} else {
	var currDir = cdir;
}

var baseDir = 'http://www.wojzworld.com';
var rotateK = '/kevinrotate';

//
//  Determine browser type
//
var navType;
// Browser check: DOM compliant browser
if (document.getElementById) {
    navType="dom";
} else if (document.all) {
	// Browser check: IE DHTML compliant browser 
	navType="ie";
} else if (document.layers) {
	// Browser check: NS (4.x) DHTML compliant browser 
    navType="ns";
}




// *************************
// ***** Image Preload *****
// *************************

if (document.images) {

	kevin1    		= new Image();
    kevin1.src		= "" + currDir + "kevinrotate/headpic1.jpg" ;
    
	kevin2    		= new Image();
    kevin2.src		= "" + currDir + "kevinrotate/headpic2.jpg" ;
	
	kevin3    		= new Image();
    kevin3.src		= "" + currDir + "kevinrotate/headpic3.jpg" ;
	
	kevin4    		= new Image();
    kevin4.src		= "" + currDir + "kevinrotate/headpic4.jpg" ;
	
	kevin5    		= new Image();
    kevin5.src		= "" + currDir + "kevinrotate/headpic5.jpg" ;
	
	kevin6    		= new Image();
    kevin6.src		= "" + currDir + "kevinrotate/headpic6.jpg" ;
	
	kevin7    		= new Image();
    kevin7.src		= "" + currDir + "kevinrotate/headpic7.jpg" ;
}


// ************************************
// ***** Dialog and Message Boxes *****
// ************************************

//+----------------------------------------------------------------------------
//  Function:       findWindowDim
//  Author:         Kevin P. Wojdak, Pathfinder Associates (http://www.pathf.com)
//  Created:        May 2005
//  Description:    Dynamically sets various dimensions of the screen based on 
//                  the contents of the sections of the screens.
//                  
//  Arguments:      none
//  Returns:        none
//+----------------------------------------------------------------------------
//
function findWindowDim(){
	var objContent = document.getElementById('content');
	var objFooter = document.getElementById('footer');
	var objBody = document.getElementById('divPageBody');
	
	var objLeftBody = document.getElementById('leftBody');
	if (!objLeftBody) 
		var objLeftBody = document.getElementById('leftBodyReg');
	if (!objLeftBody) 
		var objLeftBody = document.getElementById('leftBodyRegOther');
	
	var objRightAd = document.getElementById('rightAdsBlog');
	
	var mastheadHeight = 85;
	var footerHeight = objFooter == null ? 0 : objFooter.offsetHeight;
	var rightHeight = objRightAd == null ? 0 : objRightAd.offsetHeight;
	var leftHeight = objLeftBody == null ? 0 : objLeftBody.offsetHeight;

	if (rightHeight > leftHeight) {	
		var sizeAdSpc = rightHeight + 30;
		var adSpc = sizeAdSpc + "px";
		objBody.style.height = adSpc; 
	} else if (leftHeight > rightHeight) {
		var sizeAdSpc = leftHeight;
		var leftHeightAdj = leftHeight + 30;
		var adSpc = sizeAdSpc + "px";
		if (objRightAd) objRightAd.style.height = adSpc;
		var adjBodyHeight = leftHeightAdj + "px";
		if (objBody) objBody.style.height = adjBodyHeight;
	}
	
	var bodyHeight = objBody.offsetHeight;

	var contentHeight = mastheadHeight + bodyHeight + footerHeight;
	var contentHeightPx = contentHeight + "px";
	if (objContent) objContent.style.height = contentHeightPx;
	
	var footerTop = mastheadHeight + bodyHeight;
	var footerTopPx = footerTop+"px";
	if (objFooter) objFooter.style.top = footerTopPx;
	
	return;
}

//window.onresize = fixPosition;

//+----------------------------------------------------------------------------
//  Function:       windowSize
//  Author:         Original alertSize script provided for free by http://www.howtocreate.co.uk.
//  Modified by:    Kevin P. Wojdak, Pathfinder Associates
//  Description:    Provides the current viewable page size.
//
//  Arguments:      none
//  Returns:        height and width of the page as one string delimited by a ","
//
//  Note:           Modified to return height and width in one return value.
//                  Use string.split(",") to get separate values.
//+----------------------------------------------------------------------------
//
function windowSize() {
    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } else if( document.documentElement &&
               ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
    var returnString = myHeight + "," + myWidth;
    return returnString;
}

// ST Function - Netscape Resize Fix
if (document.layers) {
	widthCheck = window.innerWidth;
	heightCheck = window.innerHeight;
	window.onResize = resizeFix;
}

function resizeFix() {
	if (widthCheck != window.innerWidth || heightCheck != window.innerHeight)
		document.location.href = document.location.href;
}

//+----------------------------------------------------------------------------
//  Function:       fixPosition
//  Author:         Kevin P. Wojdak, Pathfinder Associates (www.pathf.com)
//  Description:    Left justifies the interface when working on a screen resolution
//                  of 800x600 or less.
//  Arguments:      none
//  Returns:        none
//+----------------------------------------------------------------------------
//
function fixPosition() {
    var sW = screen.availWidth;
    var currWinSz = windowSize();
    var currHnW = currWinSz.split(",");
    var currW = currHnW[1];

    var winObj = document.getElementById('content');
    if (winObj != null) {
        if ((sW <= '862') || (currW <= 862)) {
            winObj.style.marginLeft = 0;
            winObj.style.left = 0;
        } else {
            winObj.style.marginLeft = '-389px';
            winObj.style.left = '50%';
        }
    }
}


//+----------------------------------------------------------------------------
//  Function:       callModalPlus
//  Author:         Kevin P. Wojdak, Pathfinder Associates (www.pathf.com)
//  Description:    Launches centralized modal dialog but allows size to be passed in.
//                  
//  Arguments:      msg = HTML to load
//                  a = dialog arguments to be passed
//                  H = height of dialog
//                  W = width of dialog
//  Returns:        callVar = return value from the modal dialog
// 
//  Note:           
//+----------------------------------------------------------------------------
//
function callModalPlus(msg,a,H,W) {
	var callVar = window.showModalDialog(msg, a, "center=yes;dialogHeight="+H+"px;dialogWidth="+W+"px;resizable=no;status=no;help=no;scroll=no;");
	return callVar;
}

//+----------------------------------------------------------------------------
//  Function:       getHidden
//  Author:         Kevin P. Wojdak, Pathfinder Associates
//  Description:    Used to retrieve values from the arguments passed to a 
//                  modal window.
//                  
//  Arguments:      indx = index of value to retrieve
//  Returns:        argument value
// 
//  Note:           
//  Called from:    
//+----------------------------------------------------------------------------
//
function getHidden(indx) {
	return dialogArguments[indx];
}


// *****************************
// ***** Utility Functions *****
// *****************************

//+----------------------------------------------------------------------------
//  Function:       getDocHeight
//  Author:         Kevin P. Wojdak
//  Created:        July 2005
//  Description:    Gets the current document's visible height.
//                  
//  Arguments:      none
//  Returns:        document height
// 
//  Note:           
//+----------------------------------------------------------------------------
//
function getDocHeight() {
   if (navType=="ie") return (document.body.scrollHeight > document.body.clientHeight) ? document.body.scrollHeight : document.body.clientHeight;
   else return (document.height > window.innerHeight) ? document.height : window.innerHeight;
}

//+----------------------------------------------------------------------------
//  Function:       getRandomNum
//  Author:         Kevin P. Wojdak
//  Date Created:   July 2005
//  Description:    Generates a random number from 0 or 1 to X.
//                  
//  Arguments:      begRange = beginning number of range: 0 or 1
//                  endRange = Upper limit of numbers
//                  
//  Returns:        randNum = random number within range specified
// 
//  Note:           
//+----------------------------------------------------------------------------
//
function getRandomNum(begRange, endRange) {
	switch(begRange) {
		case 1:
			var randNum = (Math.round(Math.random() * endRange))+1;
			break;
		default:
			var randNum = Math.round(Math.random() * endRange);
			break;
	}
	return randNum;
}



//+----------------------------------------------------------------------------
//  Function:       LoadYears
//  Author:         Kevin P. Wojdak, Pathfinder Associates (www.pathf.com)
//  Description:    Used to load the years dropdown list from specified year to the present.
//                  
//  Arguments:      box = list box to fill
//                  startYr = number of year to start at
//                  
//  Returns:        none - filled list box
// 
//  Note:           
//+----------------------------------------------------------------------------
//
function LoadYears(boxId,startYr) {
	var box = document.getElementById(boxId);
	var option = new Option('', '');
	box.options[box.length] = option;

	// set today's date
	Now = new Date();
	NowYear = Now.getYear();
	if (NowYear < 2000) NowYear += 1900; //for Netscape
	
	for (m=NowYear; m >= startYr; m--) 
	{
	   option = new Option(m, m);

	   // Add to the end of the existing options
	   box.options[box.length] = option;	
    }

	// Preselect option 0
	box.selectedIndex=0;
}



//+----------------------------------------------------------------------------
//  Function:       trim
//  Author:         Kevin P. Wojdak, Pathfinder Associates (http://www.pathf.com)
//  Created:        May 2005
//  Description:    Trims internal spaces from a string.
//                  
//  Arguments:      none
//  Returns:        temp = trimmed string
//+----------------------------------------------------------------------------
//
function trim(value) {
   var temp = value;
   var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
   if (obj.test(temp)) { temp = temp.replace(obj, '$2'); }
   var obj = / /g;
   while (temp.match(obj)) { temp = temp.replace(obj, ""); }
   return temp;
}

//+----------------------------------------------------------------------------
//  Function:       formChecker
//  Author:         Kevin P. Wojdak, Pathfinder Associates (http://www.pathf.com)
//  Created:        May 2005
//  Description:    Debugging tool to verify that a form is passing the correct data
//                  to the backend.
//                  
//  Arguments:      form = form object to check
//  Returns:        none
//
//  Note:           
//+----------------------------------------------------------------------------
//
function formChecker(form) {
	if (!form) form = document.forms[0];
	var numFlds = form.elements.length;
	var strAlert = 'Results of Form Submit:\n\nnumber of fields = ' + numFlds + "\n\n";
	for(i=0; i<numFlds; i++) {
		var rank = i + 1;
		if (form.elements[i].type == 'radio' || form.elements[i].type == 'checkbox') {
			strAlert += rank + ") " + form.elements[i].id + " = " + form.elements[i].checked + "\n";
		} else if (form.elements[i].type.substr(0,6) == 'select') {
			strAlert += rank + ") " + form.elements[i].id + " = " + form.elements[i][form.elements[i].selectedIndex].text + "\n";
		} else {
			strAlert += rank + ") " + form.elements[i].id + " = " + form.elements[i].value + "\n";
		}
	}
	alert(strAlert);
	return false;
}



// **************************
// ***** Cookie Control *****
// **************************

//+----------------------------------------------------------------------------
//  Function:       setCookie
//  Author:         Webreference.com
//  Created:        1996
//  Description:    Sets a cookie. 
//                  
//  Arguments:      name - name of the cookie
//                  value - value of the cookie
//                  [expires] - expiration date of the cookie (defaults to end of current session)
//                  [path] - path for which the cookie is valid (defaults to path of calling document)
//                  [domain] - domain for which the cookie is valid (defaults to domain of calling document)
//                  [secure] - Boolean value indicating if the cookie transmission requires
//                             a secure transmission
// 
//  Returns:        none
//+----------------------------------------------------------------------------
//
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}


//+----------------------------------------------------------------------------
//  Function:       getCookie
//  Author:         Webreference.com
//  Created:        1996
//  Description:    Retrieves the value of a cookie.
//                  
//  Arguments:      name - name of the desired cookie
//  Returns:        string containing value of specified cookie or null
//                  if cookie does not exist
//+----------------------------------------------------------------------------
//
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


//+----------------------------------------------------------------------------
//  Function:       deleteCookie
//  Author:         Webreference.com
//  Created:        1996
//  Description:    Sets an expiration date for a cookie into the past so that the
//                  cookie gets cleared out.
//                  
//  Arguments:      name - name of the cookie
//                  [path] - path of the cookie (must be same as path used to create cookie)
//                  [domain] - domain of the cookie (must be same as domain used to
//                             create cookie)
//                  path and domain default if assigned null or omitted if no explicit
//                  argument proceeds
//  Returns:        none
//+----------------------------------------------------------------------------
//
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}


// ****************************
// ***** Form Validations *****
// ****************************

//+----------------------------------------------------------------------------
//  Function:       ValidateEmailFormat
//  Author:         Kevin P. Wojdak
//  Created:        May 2005
//  Description:    Checks e-mail address to be sure it is a valid e-mail format.
//                  
//  Arguments:      addr = string - field name of e-mail address
//                  errMsg = string - error message to display
//  Returns:        true if the e-mail is valid
//                  false if the e-mail address is invalid
//
//  Note:           
//+----------------------------------------------------------------------------
//
function ValidateEmailFormat(addr,errMsg) {
	var fldObj = document.getElementById(addr);
	var fldVal = fldObj.value;
	
	if (window.RegExp) {
		var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
		var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
		var reg1 = new RegExp(reg1str);
		var reg2 = new RegExp(reg2str);
		if (!reg1.test(fldVal) && reg2.test(fldVal)) {
		  return true;
		}
		//reg1 = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		//reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
		//if (!addr.match(reg1) && addr.match(reg2)) {
		//	return (-1);		
		//} 
		processError(addr,errMsg);
		return false;
	} else {
		if(fldVal.indexOf("@") >= 0) {	
		  return true;
		}
		processError(addr,errMsg);
		return false;
	}
}

//+----------------------------------------------------------------------------
//  Function:       ValidateEmailChars
//  Author:         Kevin P. Wojdak
//  Created:        July 2005
//  Description:    Checks e-mail address for invalid characters.
//                  
//  Arguments:      addr = string - field name of e-mail address
//                  errMsg = string - error message to display
//  Returns:        true if the e-mail is valid
//                  false if the e-mail address is invalid
//
//  Note:           
//+----------------------------------------------------------------------------
//
function ValidateEmailChars(addr,errMsg) {
	var fldObj = document.getElementById(addr);
	var fldVal = fldObj.value;

	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

	for(i=0; i < fldVal.length ;i++){
		if(ok.indexOf(fldVal.charAt(i))<0){ 
			processError(addr,errMsg);
			return false;
		}	
	} 
	return true;
}



//+----------------------------------------------------------------------------
//  Function:       CheckIfValueExists
//  Author:         Kevin P. Wojdak
//  Created:        May 2005
//  Description:    Simple validation to check if a value was entered into a field.
//                  
//  Arguments:      fld - str - name of the field to check
//                  errMsg - str - error message to display
//  Returns:        false if the field doesn't contain a value
//                  true if the field is populated
//
//  Note:           
//+----------------------------------------------------------------------------
//
function CheckIfValueExists (fld,errMsg) {
	var fldObj = document.getElementById(fld);
	if (fldObj != null) {
		if (fldObj.value == "") {
			processError(fld,errMsg);
			return false;
		}
	}
	return true;
}



//+----------------------------------------------------------------------------
//  Function:       CheckIfMinimumLength
//  Author:         Kevin P. Wojdak
//  Created:        May 2005
//  Description:    Checks to see if the value provided meets the minimum length requirements.
//                  
//  Arguments:      v1 - str - id of the field to check
//                  lngth - int - minimum length of field
//                  errMsg - str - error message to display
//  Returns:        fasle if field is too short
//                  true if field is long enough
//
//  Note:           
//+----------------------------------------------------------------------------
//
function CheckIfMinimumLength(v1,lngth,errMsg) {
	var fldObj = document.getElementById(v1);
	if (fldObj != null) {
		if (fldObj.value.length < lngth) {
			processError(v1,errMsg);
			fldObj.value = '';
			return false;
		}
	}
	return true;
}


//+----------------------------------------------------------------------------
//  Function:       CheckIfValuesMatch
//  Author:         Kevin P. Wojdak
//  Created:        May 2005
//  Description:    Checks to see if the values of two fields are the same.
//                  
//  Arguments:      v1 - str - id of the first field to check
//                  v2 - str - id of the field to compare against
//                  errMsg - str - error message to display
//  Returns:        fasle if fields do not match
//                  true if fields are identical
//
//  Note:           
//+----------------------------------------------------------------------------
//
function CheckIfValuesMatch(v1,v2,errMsg) {
	var fldObj = document.getElementById(v2);
	var fldObj2 = document.getElementById(v1);
	if (fldObj != null) {
		if (fldObj.value != fldObj2.value) {
			processError(v2,errMsg);
			fldObj.value = '';
			return false;
		}
	}
	return true;
}

//+----------------------------------------------------------------------------
//  Function:       CheckIfDropdownSelectionMade
//  Author:         Kevin P. Wojdak
//  Created:        May 2005
//  Description:    Validation to check if a selection was made from a dropdown list. 
//                  
//  Arguments:      sques - str - id of selection list
//                  errMsg - str - error message to display
//  Returns:        false if no item selected
//                  true if item selected
//
//  Note:           
//+----------------------------------------------------------------------------
//
function CheckIfDropdownSelectionMade(sques,errMsg) {
	var fldObj = document.getElementById(sques);
	if (fldObj != null) {
		if (fldObj.selectedIndex == 0) {
			processError(sques,errMsg);
			return false;
		}
	}
	return true;
}

//+----------------------------------------------------------------------------
//  Function:       CheckTwoIfRadioSelected
//  Author:         Kevin P. Wojdak
//  Created:        May 2005
//  Description:    Checks to see if one of two radio buttons is selected. 
//                  
//  Arguments:      radio1 - str - id of 1st radio button
//                  radio2 - str - id of second radio button
//                  root - str - root name for radio buttons
//                  errMsg - error message to display
//  Returns:        false if no radio selected
//                  true if one radio selected
//
//  Note:           
//+----------------------------------------------------------------------------
//
function CheckTwoIfRadioSelected(radio1,radio2,root,errMsg) {
	var fldObj1 = document.getElementById(radio1);
	var fldObj2 = document.getElementById(radio2);	
	if (fldObj1 != null && fldObj2 != null) {
		if (!fldObj1.checked) {
			if (!fldObj2.checked) {
				processError(radio1,errMsg);
				return false;
			}
		}
	}
	return true;
}


//+----------------------------------------------------------------------------
//  Function:       CheckIfValidUSZip
//  Author:         Kevin P. Wojdak
//  Created:        May 2005
//  Description:    Checks to see if the field value of a zip code field is a valid
//                  US 5-digit zip or 9-digit zip+4 
//                  
//  Arguments:      zipfld - str - id of zip code field to check
//                  cntry - str - id of country dropdown to retrieve current country value
//                  errMsg - str - error message to display
//  Returns:        false if not a valid zip code
//                  true if zip code is valid
//
//  Note:           
//+----------------------------------------------------------------------------
//
function CheckIfValidUSZip(zipfld,cntry,errMsg) {
	var fldObj = document.getElementById(zipfld);
	var countryObj = document.getElementById(cntry);

	// Check to see if zip code is formatted correctly
	var zipFld = fldObj.value;
	zipFld = trim(zipFld);  // removes internal spacing
	var numdigits = zipFld.length;
	if (countryObj[countryObj.selectedIndex].value == "US" && numdigits != 5) {
		if (countryObj[countryObj.selectedIndex].value == "US" && numdigits != 9) {
			processError(zipfld,errMsg);
			return false;
		}
	}
	return true;
}

//+----------------------------------------------------------------------------
//  Function:       kevinRotate
//  Author:         Kevin P. Wojdak
//  Created:        July 2005
//  Description:    Creates changing picture marquee.
//                  
//  Arguments:      kevinPics = number of pics to rotate
//                  intervalSecs = number of seconds to show each image
//  Returns:        none
// 
//  Note:           Continues changing until a new page is loaded
//+----------------------------------------------------------------------------
//
function kevinRotate(kevinPics,intervalSecs){
	var imgKevin = getRandomNum(1,kevinPics);
	// Display next image 
	document.getElementById('kevinRotate').src = eval( "kevin" + imgKevin + ".src" );
	
	// set the image to change after a certain interval
	var time = intervalSecs * 1000;
	setTimeout("kevinRotate(" + kevinPics + "," + intervalSecs + ")", time);
}

//+----------------------------------------------------------------------------
//  Function:       displayQuote
//  Author:         Kevin P. Wojdak
//  Created:        September 2005
//  Description:    Pulls a single random quote and author from quote data load 
//                  and displays it on the header of the page.
//                  
//  Arguments:      none
//  Returns:        none
// 
//  Note:           
//+----------------------------------------------------------------------------
//
function displayQuote (){
	var toDisplay = getQuote().split("|");
	var txtQuote = toDisplay[0];
	var txtAuthor = toDisplay[1];
	document.getElementById('quoteContentInner').innerHTML = txtQuote;
	document.getElementById('quoteAuthorInner').innerHTML = txtAuthor;
	return;
}

//+----------------------------------------------------------------------------
//  Function:       windowSize
//  Author:         Original alertSize script provided for free by http://www.howtocreate.co.uk. 
//  Modified by:    Kevin P. Wojdak, Pathfinder Associates
//  Description:    Provides the current viewable page size.
//                  
//  Arguments:      none
//  Returns:        height and width of the page as one string delimited by a ","
// 
//  Note:           Modified to return height and width in one return value.  
//                  Use string.split(",") to get separate values.
//+----------------------------------------------------------------------------
//
function windowSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  var returnString = myHeight + "," + myWidth;
  return returnString;
}


function initResume() {
	var objResume = document.getElementById('resumeSegments');
	var resumeDivs = objResume.getElementsByTagName('div');
	for (i=0; i < resumeDivs.length; i++) {
		if (resumeDivs[i].id != null && resumeDivs[i].id != '') {
			resumeDivs[i].style.display = 'none';
		}
	}
}

function ToggleSegment(seg,arrId) {
	var objArrow = document.getElementById('arrow' + arrId);
	var objResume = document.getElementById('resumeSegments');
	var segmentDiv = document.getElementById(seg);
	var currDisplay = (segmentDiv.style.display == "none") ? "block" : "none";
	segmentDiv.style.display = currDisplay;
	//var tableRows = objResumeTable.getElementsByTagName('tr');
	//for (i=0; i < tableRows.length; i++) {
		//if (tableRows[i].getAttribute('className') == seg) {
			/*var currDisplay = (tableRows[i].style.display == "none") ? "block" : "none";
			tableRows[i].style.display = currDisplay;
			break;
		}
	}*/
	
	var currArrow = (currDisplay == "none") ? "up_arrow.gif" : "down_arrow.gif" ;
	objArrow.src = "images/" + currArrow;
	
	// resizeContentArea();
}


function startHOMEdesktop(desktopURL) {
  var desktop = window.open( desktopURL, "_blank", "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=no,width=700,height=525,resizable=no" );
}
