/*
** Javascript functions library
*/

sfHover = function() {
	var sfEls = document.getElementById("dropdown").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 IEHoverPseudo() {
  var navItems = document.getElementById("dropdown").getElementsByTagName("li");
  for (var i=0; i<navItems.length; i++) {
    item = navItems[i].className;
    if( item == "menuparent" ) {
      navItems[i].onmouseover=function() { this.className += " over"; }
      navItems[i].onmouseout=function() { this.className = "menuparent"; }
    }
    else {
      len = document.getElementById("dropdown").getElementsByTagName("li").HTMLCollection.length
      for (var j=0; j<len; j++) {
        alert("NON menuparent ITEM: " + document.getElementById("dropdown").getElementsByTagName("li").HTMLCollection[j]);
      }
  }
  }
window.onload = IEHoverPseudo;
}
/* end function IEHoverPseudo() */

/*
**
*/
function change_location(where)
{
  //alert(where);
  location.href = where;
}
/* end goto() */

/*
**
*/
function print_stylesheet()
{
  if ( args['style'] == undefined || args['style'] == "" || args['style'] == "default" ) {
    document.write('<link rel="stylesheet"    type="text/css"     href="/lib/style/skin0.css">');
  }
  else if ( args['style'] == "skin1") {
    document.write('<link rel="stylesheet"    type="text/css"     href="/lib/style/skin1.css">');
  }
  else if ( args['style'] == "skin2") {
    document.write('<link rel="stylesheet"    type="text/css"     href="/lib/style/skin2.css">');
  }
  else if ( args['style'] == "skin3") {
    document.write('<link rel="stylesheet"    type="text/css"     href="/lib/style/skin3.css">');
  }
  else if ( args['style'] == "skin4") {
    document.write('<link rel="stylesheet"    type="text/css"     href="/lib/style/skin4.css">');
  }
  else if ( args['style'] == "skin5") {
    document.write('<link rel="stylesheet"    type="text/css"     href="/lib/style/skin5.css">');
  }
  else if ( args['style'] == "skin6") {
    document.write('<link rel="stylesheet"    type="text/css"     href="/lib/style/skin6.css">');
  }
  else if ( args['style'] == "skin7") {
    document.write('<link rel="stylesheet"    type="text/css"     href="/lib/style/skin7.css">');
  }
  else if ( args['style'] == "noskin") {
    document.write('<link rel="stylesheet"    type="text/css"     href="/lib/style/noskin.css">');
  }
  else {
    document.write('<link rel="stylesheet"    type="text/css"     href="/lib/style/skin0.css">');
  }
}
/* end print_stylesheet() */

/*
** print_menutabs
*/
function print_menutabs()
{
  if ( args['style'] ) {
    skin=args['style']; 
  }
  else {
    skin="default";
  }

  if ( args['tabname'] == "home" || args['tabname'] == undefined ) {
    document.write('<ul id="menutabs"><li><a href="/professional/index.shtml?tabname=home&style=' + skin + '" style="color:#fff;">home</a></li><li><a href="/professional/resume.shtml?tabname=resume&style=' + skin + '">resume</a></li><li><a href="/professional/portfolio.shtml?tabname=portfolio&style=' + skin + '">portfolio</a></li><li><a href="/professional/style.shtml?tabname=style&style=' + skin + '">style</a></li></ul>');
  }
  else if ( args['tabname'] == "resume") {
    document.write('<ul id="menutabs"><li><a href="/professional/index.shtml?tabname=home&style=' + skin + '">home</a></li><li><a href="/professional/resume.shtml?tabname=resume&style=' + skin + '" style="color:#fff;">resume</a></li><li><a href="/professional/portfolio.shtml?tabname=portfolio&style=' + skin + '">portfolio</a></li><li><a href="/professional/style.shtml?tabname=style&style=' + skin + '">style</a></li></ul>');
  }
  else if ( args['tabname'] == "portfolio") {
    document.write('<ul id="menutabs"><li><a href="/professional/index.shtml?tabname=home&style=' + skin + '">home</a></li><li><a href="/professional/resume.shtml?tabname=resume&style=' + skin + '">resume</a></li><li><a href="/professional/portfolio.shtml?tabname=portfolio&style=' + skin + '" style="color:#fff;">portfolio</a></li><li><a href="/professional/style.shtml?tabname=style&style=' + skin + '">style</a></li></ul>');
  }
  else if ( args['tabname'] == "style") {
    document.write('<ul id="menutabs"><li><a href="/professional/index.shtml?tabname=home&style=' + skin + '">home</a></li><li><a href="/professional/resume.shtml?tabname=resume&style=' + skin + '">resume</a></li><li><a href="/professional/portfolio.shtml?tabname=portfolio&style=' + skin + '">portfolio</a></li><li><a href="/professional/style.shtml?tabname=style&style=' + skin + '" style="color:#fff;">style</a></li></ul>');
  }
  else {
    document.write('tab menu error!');
  }
}
/* end function print_menutabs()

/*
** print_gototop()
*/
function print_gototop()
{
  if ( args['tabname'] == "resume" || args['tabname'] == "portfolio" ) {
    document.write('<div style="margin-left:15px;">Return to <a href="#pagetop">top</a> of page.</div>');
  }
}
/* end function print_mailto */

/*
** print_mailto(keyword, whom, what)
*/
function print_mailto(whom, dom, ain, what, keyword)
{
  email = whom + '@' + dom + ain;
  subject = '?Subject=' + what;
  if ( keyword == undefined || keyword == "" ) {
    keyword = email;
  }
  document.write('<a href="mailto:' + email + subject + '">' + keyword + '<\/a>');
}
/* end function print_mailto */


/*
** args_init() by Charlton Rose provides the interface to the command line
** argument name value pairs.
*/
/*******************************************************************************
'args.js', by Charlton Rose
Permission is granted to use and modify this script for any purpose,
provided that this credit header is retained, unmodified, in the script.
*******************************************************************************/
// This function is included to overcome a bug in Netscape's implementation
// of the escape () function:
function myunescape (str)
{
  str = '' + str;
  while (true)
  {
    var i = str . indexOf ('+');
    if (i < 0)
      break;
    str = str . substring (0, i) + ' ' + str . substring (i + 1, str . length);
  }
  return unescape (str);
}
// This function creates the args [] array and populates it with data
// found in the URL's search string:
function args_init ()
{
  args = new Array ();
  var argstring = window . location . search;
  if (argstring . charAt (0) != '?')
    return;
  argstring = argstring . substring (1, argstring . length);
  var argarray = argstring . split ('&');
  var i;
  var singlearg;
  for (i = 0; i < argarray . length; ++ i)
  {
    singlearg = argarray [i] . split ('=');
    if (singlearg . length != 2)
      continue;
    var key = myunescape (singlearg [0]);
    var value = myunescape (singlearg [1]);
    args [key] = value;
  }
}
// Call the args_init () function to set up the args [] array:
args_init ();
/* end functions for args.js */

/*
*/

/*
** eof
*/
