function makeArray() { 
  var args = makeArray.arguments;
  for (var i = 0; i < args.length; i++) {	this[i] = args[i]; }
  this.length = args.length;
}
var imageNames = new makeArray(
		"home","sitemap","contactus","aboutus","requpdates"
);

var imagePrefix = "/images/nav/", 
  imageOnSuffix = "_on.gif", 
  imageOffSuffix = "_off.gif"
  ;

if (document.images) {
  var i, imagesOn = new Array();
  for ( i=0 ; i<imageNames.length ; i++ ) {
    imagesOn[i] = new Image();
    imagesOn[i].src = (imagePrefix + imageNames[i] + imageOnSuffix);
		
  }
}

function img_act(target) {
  if (document.images)
    document[target].src = (imagePrefix + target + imageOnSuffix);
}

function img_inact(target) {
  if (document.images)
    document[target].src = (imagePrefix + target + imageOffSuffix);
}

 function doClear(theText) 
{
     if (theText.value == theText.defaultValue)
 {
         theText.value = ""
     }
 }
 
 // Write the Top Nav

var homeUrl = "/pages/home";
var sitemapUrl = "/pages/sitemap/index.jsp";
var searchUrl = "/pages/search/index.jsp";
var contactusUrl = "javascript:newceopop(\'/contact/index.html\');";
var aboutusUrl = "/pages/aboutus";
var blogUrl = "http://reputationwatch.blogspot.com/";
var requpdatesUrl = "/quiz";
 
function writeTopNav(tnavOn){
	var buttonOn = tnavOn; 

	document.write('<table border="0" cellpadding="0" cellspacing="0" width="721">' +
	'<tr>' +
	'	<td colspan="3" height="8" bgcolor="#ffffcc"><img src="/images/null_1x1.gif" width="150" height="8" border="0" alt=""></td>' +
	'</tr>' +
	'<tr bgcolor="#011A33">' +
	'	<td rowspan="2" valign="top" width="170"><a href="/pages/home"><img src="/images/nav/ceogo.gif" width="151" height="56" border="0" alt=""></a></td>' +
	'	<td width="551" height="21" valign="top" align="right">' +
	'	<table border="0" cellpadding="0" cellspacing="0">' +
	'	<tr>');
	
	if (buttonOn != "home"){
		document.write('<td width="54" valign="top"><a href="' + homeUrl + '" onmouseover="img_act(\'home\');" onmouseout="img_inact(\'home\');"><img src="/images/nav/home_off.gif" alt="HOME" width="52" height="18" border="0" name="home"></a></td>');
		}		
	if (buttonOn == "home"){
		document.write('<td width="54" valign="top"><img src="/images/nav/home_hit.gif" alt="HOME" width="52" height="18" border="0" name="home"></td>');
		}	
	if (buttonOn != "sitemap"){
		document.write('<td width="70" valign="top"><a href="' + sitemapUrl + '" onmouseover="img_act(\'sitemap\');" onmouseout="img_inact(\'sitemap\');"><img src="/images/nav/sitemap_off.gif" alt="SITE MAP" width="68" height="18" border="0" name="sitemap"></a></td>');
		}		
	if (buttonOn == "sitemap"){
		document.write('<td width="70" valign="top"><img src="/images/nav/sitemap_hit.gif" alt="SITE MAP" width="68" height="18" border="0" name="sitemap"></td>');
		}	
	/*if (buttonOn != "contactus"){
		document.write('<td width="89" valign="top"><a href="' + contactusUrl + '" onmouseover="img_act(\'contactus\');" onmouseout="img_inact(\'contactus\');"><img src="/images/nav/contactus_off.gif" alt="CONTACT US" width="87" height="18" border="0" name="contactus"></a></td>');
		}		
	if (buttonOn == "contactus"){
		document.write('<td width="89" valign="top"><img src="/images/nav/contactus_hit.gif" alt="CONTACT US" width="87" height="18" border="0" name="contactus"></td>');
		}	*/
	if (buttonOn != "aboutus"){
		document.write('<td width="200" valign="top"><a href="' + aboutusUrl + '" onmouseover="img_act(\'aboutus\');" onmouseout="img_inact(\'aboutus\');"><img src="/images/nav/aboutus_off.gif" alt="ABOUT US" width="79" height="18" border="0" name="aboutus"></a></td>');
		}		
	if (buttonOn == "aboutus"){
		document.write('<td width="200" valign="top"><img src="/images/nav/aboutus_hit.gif" alt="ABOUT US" width="79" height="18" border="0" name="aboutus"></td>');
		}					
		
	document.write('<td valign="top"><img src="/images/nav/rightcorner.gif" alt="" width="42" height="21" border="0"></td></tr>' +


		'	</table></td>' +
		
		'	</tr><tr bgcolor="#011A33"><td height="35" align="right">&nbsp;</td>' +
		'</tr>' +
		'</table>');
}


// Popup center

IE=(navigator.appName=="Microsoft Internet Explorer");
NS=(navigator.appName=="Netscape");
bVer=parseInt(navigator.appVersion);

function popup(htmlURL) {
	 _params = "width=600,height=500,resizable=no,toolbar=no";
	
	if (bVer >= 4) {
		 _left = ( (screen.width-600) >>1 );
		 _top = ( (screen.height-500) >>1 );
	} else {
		 _top=60, _left=70;
	}
	if (IE) _params += ",top=" + _top + ",left=" + _left;
	else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

	newWin = null;
	newWin = window.open(htmlURL,"popup", _params);
	if (newWin.opener==null) newWin.opener=window;
}

function newceopop(htmlURL) {
	 _params = "width=580,height=550,scrollbars=yes";
	
	if (bVer >= 4) {
		 _left = ( (screen.width-580) >>1 );
		 _top = ( (screen.height-550) >>1 );
	} else {
		 _top=60, _left=70;
	}
	if (IE) _params += ",top=" + _top + ",left=" + _left;
	else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

	newWin = null;
	newWin = window.open(htmlURL,"newceo", _params);
	if (newWin.opener==null) newWin.opener=window;
}

function pressrelease(htmlURL) {
	 _params = "width=580,height=550,scrollbars=yes";
	
	if (bVer >= 4) {
		 _left = ( (screen.width-580) >>1 );
		 _top = ( (screen.height-550) >>1 );
	} else {
		 _top=60, _left=70;
	}
	if (IE) _params += ",top=" + _top + ",left=" + _left;
	else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

	newWin = null;
	newWin = window.open(htmlURL,"pressrelease", _params);
	if (newWin.opener==null) newWin.opener=window;
}

function copyRight(){
 document.write('&copy; copyright 2006 ceogo.com');
}	


//Reformat the Date
function monthRename(themonth){
	monthName = "";

	if (themonth == "01"){
		monthName = "January";
	}
	if (themonth == "02"){
		monthName = "February";
	}
	if (themonth == "03"){
		monthName = "March";
	}
	if (themonth == "04"){
		monthName = "April";
	}
	if (themonth == "05"){
		monthName = "May";
	}
	if (themonth == "06"){
		monthName = "June";
	}
	if (themonth == "07"){
		monthName = "July";
	}
	if (themonth == "08"){
		monthName = "August";
	}
	if (themonth == "09"){
		monthName = "September";
	}
	if (themonth == "10"){
		monthName = "October";
	}
	if (themonth == "11"){
		monthName = "November";
	}
	if (themonth == "12"){
		monthName = "December";
	}
	document.write(monthName);
}

function dateFormat(theDate){
	var theYear = theDate.slice(2,4);
	var fullYear = theDate.slice(0,4);
	var theMonth = theDate.slice(4,6);
	var theDay = theDate.slice(6,8);
	
	if (theYear == ""){
		//do nothing
	}
	else {
		if (theDay == "00"){
			if (theMonth == "00"){
			document.write(fullYear);
			}
			else {
			monthRename(theMonth);
			document.write('&nbsp;' + fullYear);
			}	
		}
		if (theDate == "TBA"){
			document.write('TBA');
		}
		else if (theDay != "00"){
			document.write(theMonth + '/' + theDay + '/' + theYear);
		}
	}	
}


  function breadcrumbs(theTarget){

    sURL = new String;
    bits = new Object;
    var x = 0;
    var stop = 0;
    //var output = "<A HREF=\"/\">Home</A> | ";
	var output = "";
	var currentTitle = document.title.slice(7,document.title.length);

	sURL = theTarget;
   // sURL = location.href;
   	//sURL = sURL.slice(0,sURL.length);
   // chunkStart = sURL.indexOf("/");
    //sURL = sURL.slice(chunkStart+1,sURL.length)
	
	if (theTarget == null){
		sURL = location.href.slice(34,location.href.length);
	}

    while(!stop){
      chunkStart = sURL.indexOf("/");
      if (chunkStart != -1){
        bits[x] = sURL.slice(0,chunkStart)
        sURL = sURL.slice(chunkStart+1,sURL.length);
      }else{
        stop = 1;
      }
      x++;
    }
	
    for(var i in bits){
      /*output += "<A HREF=\"";
      for(y=1;y<x-i;y++){
        output += "../pages/";
      }
	  */
	  
	  var sectionName = bits[i];
	  if (sectionName == "ceocapital"){
	   sectionName = "ceo capital";
	  }
	  if (sectionName == "ceofacts"){
	   sectionName = "ceo facts";
	  }
	  if (sectionName == "ceochallenges"){
	   sectionName = "ceo challenges";
	  }
	   if (sectionName == "ceocommunications"){
	   sectionName = "ceo communications";
	  }
	  
      //output += bits[i] + "/\">" + sectionName + "</A> &#62; ";
	  output += sectionName + " &#62; ";
    }
    document.write(output + currentTitle);
  }

