// ********* ***********************************************************************************************************************


parent.document.title=document.title;
// ********************************************************************************************************************************
function framePrint(){
	parent['MainFrame'].focus();
	parent['MainFrame'].print();
}

// ********************************************************************************************************************************
function openMenuToItem (item){
	var openThis=item;
	parent['menuFrame'].loadItem(openThis); //top.frames
	}
// ********************************************************************************************************************************
function bookmark(){
	var fname='MainFrame';
	var d=document.location.search;
	var netscapealert="Your browser will bookmark only the home page of the web site. \n \n Press Ctrl-D to bookmark the web site."

	if(d!='')
		top.frames[fname].document.location.href=d.substring(d.lastIndexOf('?')+1,d.length);
	if (navigator.appName=='Microsoft Internet Explorer')
		{
		window.external.AddFavorite(top.frames[fname].document.location.href, top.frames[fname].document.title);
		}
	else if (navigator.appName=='Netscape')
		{
		alert(netscapealert);
		}
}

// ********************************************************************************************************************************
function FrameManager()	{
	//additional query string params are ignored
	var filepath = document.location.pathname;
	var indexfilename = 'index.htm';

	var indexlocation = '/'; 
	var targethref = indexlocation + indexfilename + "?" + filepath.substring(indexlocation.length);
	if(self.location==top.location)
		self.location=targethref;
	}

// ********************************************************************************************************************************
function LayerTxt(dvId,frId,nwTxt) { 
		var frameID=frId;
		var divID=dvId;
		var newText=nwTxt;

		$(divID).innerHTML=newText;
/*		if (top.frames[frameID]) {
				if (document.getElementById(divID) ) 
						top.frames[frameID].document.getElementById(divID).innerHTML=newText;
		}*/
}

function setHeaderTitle(str) {
	var textStr=str;
	top.frames['headerFrame'].document.getElementById('pageTitle').innerHTML=textStr;
}

// ***************************the img id requires 'imageTarget' and the caption id requires 'caption' *****************************************************************************************************
function imageCaption(imag,capt){

// set "loading" animation
	$('imageTarget').src='/images/loading_animation.gif';
// clear caption
	$('portfolioCaptionDiv').innerHTML=' ';
// set new image load sequence
// wait until image is loaded to execute
	objImg = new Image();
	objImg.id='imgLoadObj';
	objImg.src=imag;
	objImg.onload = function () 
		{	$('imageTarget').src=imag;	
			objImg.src='';
			var captionText=capt;
			var bulletChar=String.fromCharCode(8226);	
			var bulletCoded='</span><span class="portfolioBullet">'+bulletChar+'</span><span class="portfolioLocation">';
			var stringCommence='<span class="portfolioCompany">';
			var stringTerminate='</span>';
		
			if (captionText) {
						if (captionText.indexOf(bulletChar)>1) 
							{	captionArray=captionText.split(bulletChar);
							$('portfolioCaptionDiv').innerHTML=stringCommence+captionArray[0]+bulletCoded+captionArray[1]+stringTerminate;
							}
							else $('portfolioCaptionDiv').innerHTML=stringCommence+captionText+stringTerminate;
			}
				else $('portfolioCaptionDiv').innerHTML=' ';
	 }
 }


