/*
** Javascript functions library
*/

/* begin function cvoalaunch() */
function cvoalaunch() {
  self.name = "opener";
  remote = open("http://www.cvoa.com/cvoa/freeairfarequote.php3?ref_site="+ escape(location.href), 
                 "remote",
                 "resizable,toolbar,scrollbars,status,width=425,height=575");
}
/* end function cvoalaunch() */

/* being  function sfHover(), the suckerfish pseudo hover for ie and other css crippled browsers... */
function sfHover() {
  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"), "");
    }
  }
}
/* end function sfHover() */

/* begin function change_location(loc) */
function change_location(where)
{
  //alert(where);
  location.href = where;
}
/* end function change_location() */

/* begin function print_stylesheet() */
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 function print_stylesheet() */

/* begin function 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()

/* begin function 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_gototop */

/* begin function 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 of functions for args.js by Charlton Rose.
********************************************************************************
*/

/*
** eof
*/

