function jtag_explanation(){
	displayWindow('/jtag.shtml','400','600');
}
function aphotossetweight(saveid,saveweight,saveindex){
	//Ajax handler to adjust the weight
	ajax_JSON('/AjaxHandlers/ShareSetWeight/' + saveid + '|||'+ saveweight +'.json', getpost, '');
	$(('aphotosweightfield' + saveid)).innerHTML='set to ' + saveweight;
	if(saveindex){aphotosweight[saveindex]=saveweight;}
	hidedisplaypanel(1);
}
function aweightset(awsetid, sw,aweightindex){ // show the panel to create a new lightbox
	var aweightsetval=Templates.SiteWeightSet.evaluate({'id':awsetid,'siteweight':sw,'saveindex':aweightindex});
        center_panel(290,200,aweightsetval);
};
function oldaweightset(awsid,curval){
	alert('this would let you set the weight of image ' + awsid + ' or change it from ' + curval);	
}

function dhtmlLoadScript(url){
   var e = document.createElement("script");
   e.src = url;
   e.type="text/javascript";
   document.getElementsByTagName("head")[0].appendChild(e); 
}


tab= new Object;
//tab.tablist = ['tab_aurora','tab_other','tab_journalistic','tab_rm','tab_rf','tab_all'];
tab.tablist = ['tab_rm','tab_rf','tab_erm','tab_all'];

var tabchoice=0;


pr = { 
	lbsmall:'LIGHTBOX',
	lbwide:'LIGHTBOX',
	cartsmall:'CART',
	cartwide:'CART',
	profilesmall:'PROFILE',
	profilewide:'PROFILE',
	rfsmall:'RF',
	rfwide:'RF',
	rmsmall:'RM',
	rmwide:'RM',
	ermsmall:'eRM',
	ermwide:'Easy RM',
	allsmall:'ALL',
	allwide:'ALL IMAGES',
	othersmall:'OTHER',
	otherwide:'OTHER COLLECTIONS',
	welcomesmall:' ',
	welcomewide:'WELCOME ',
	filteredtabssmall:'TABS',
	filteredtabswide:'TABS INFO',
	journalisticsmall:'J-TAG',
	journalisticwide:'J-TAG',
	aurorasmall:'AURORA',
	aurorawide: 'AURORA EDIT',
	releasedsmall:'CREATIVE',
	releasedwide:'CREATIVE'
};
tab_explanation = {
aurora:'Aurora\'s Edit is the best most original images we have in our archive. If you\'re looking for premium rights managed photography, the Aurora Edit is the selection to make.',
other:'Aurora represents many international and niche collections from around the world. If you wish to exclude Aurora\'s images and only search partner collections, choose this tab.',
journalistic:'Aurora presents a wide range of \'journalistic\' candid and portrait photography. These images have not been manipulated and all adhere to Aurora\'s definition of a \'journalistic\' image.',
rm:'Restrict searches to Rights Managed Licensing only.',
erm:'Restrict searches to Easy Rights Managed (Aurora\'s myPhone collection) only.',
rf:'Restrict searches to Royalty Free Licensing only',
all:'This will search all collections together without any filtering for quality or collection.',
released:'This will search our creative collection.'
}

if (typeof(gsession) == 'undefined')
	gsession = ggetCookie('gmpsess');
if (typeof(gusername) == 'undefined')	gusername = ggetCookie('username');
if (typeof(gcartimages) == 'undefined')
	gcartimages = ggetCookie("gcartimages");

if (parseInt(navigator.appVersion)>3) {
        if (navigator.appName=="Netscape") {
                winW = self.innerWidth;
        } 
        if (navigator.appName.indexOf("Microsoft")!=-1) {
                winW = document.body.offsetWidth;
        }
}


if(winW < 1120){
		//small screen abbreviated terms
		var suffix='small';
} else {
		var suffix='wide';
}

var res='';
function search_filter(sfm,gomode,tmode){
	clear_tabs();
	res='';					
	if (self.location.href.indexOf('DEBUG')>0){alert('DEBUG:' + sfm) };
	switch(sfm){
		case 'rm': case 1: case '1':
			res='&searchinclude=rmtab';
			tabchoice='1';
			sfm='rm';
			break;
		case 'erm': case 2: case '2':
			res='&searchinclude=ermtab';
			tabchoice='2';
			sfm='erm';
			break;	
		case 'rf': case 3: case '3':
			res='&searchinclude=rftab';
			tabchoice='3';
			sfm='rf';
			break;
		case 'all': case 0: case '0': case 4: case '4':
			res='&searchinclude=allimages&sort=aphotosweight';
			tabchoice='4';
			sfm='all';
			break;
		default : res='#';tabchoice='0';
	}
	var nextab='tab_' + sfm;
	
	if($(nextab))
		$(nextab).addClassName('tabbox_current');
	
	if(self.location.href.indexOf('?')>=0){
		var tparams=self.location.href.split('?')[1].split('\&');
		for (z=0;z<tparams.length;z++){
			if(tparams[z].indexOf('photoginclude')>=0 || tparams[z].indexOf('orient')>=0 || tparams[z].indexOf('xtrasql')>=0 || tparams[z].indexOf('color')>=0 || tparams[z].indexOf('date')>=0 || tparams[z].indexOf('date_entered')>=0){
				res+='&' + tparams[z];
			}
		}
	}
	if(gomode && tmode =='undefined'){
			$('Layer1').innerHTML = '<div id="filtering_message"><h1>Filtering results to ' + pr[sfm + suffix].toUpperCase() + '... One moment</h1></div>';
			var tprefs=ggetCookie('gsearchprefs');
			if(tprefs && tprefs.indexOf('|')>0){
				tprefs=tprefs.split('|')[0];
			}

			gsetCookie2('gwhichstartpage','');
			gsetCookie2('gsearchprefs',tprefs + '|' + tabchoice);
			self.location='/SwishSearch?Keywords=' + q_id.replace(/&#34;/g,"\"") + res;
	} else {
		if(tmode=='searchpage'){
			//update the search tab
			try{
//				var tprefs=ggetCookie('gsearchprefs');
//	                        if(tprefs.indexOf('|')>0){
//	                                tprefs=tprefs.split('|')[0];
//	                        }
//	                        gsetCookie2('gsearchprefs',tprefs + '|' + tabchoice);
				$('search_message').innerHTML=window['tab_explanation'][sfm];
			} catch(err){
			}
		}		
		search_extention=res; //global variable for this search page
	}
}
function tabtip(tti){
	var tthtml='';
	tthtml += '<div class=tabtippanel id=tab_tip_panel_' + tti + ' > ' + tab_explanation[tti] + '</div>';

	return tthtml;

}
function tabtipmouse(ttm){
	var ttmr=' onmouseOver="javascript:show_tippanel(\'' + ttm + '\');" onmouseOut="javascript:hide_tippanel(\'' + ttm + '\');" ';
	return ttmr;
}
function make_search_tabs(tabmode){
	var tc=0;
	var tu=self.location.href;
	if ( (tu.indexOf('searchinclude=rmtab')>1 && tu.indexOf('searchinclude=rftab')<1  && tu.indexOf('searchinclude=ermtab')<1) || tc==1 || tu.indexOf('searchinclude=journalistic')>1){selrm='tabbox_current tabbox';tabchoice=1;tc=1;} else {selrm='tabbox' ;};
	if ( (tu.indexOf('searchinclude=ermtab')>1  && tu.indexOf('searchinclude=rftab')<1 && tu.indexOf('searchinclude=rmtab')<1) || tc==2){selerm='tabbox_current tabbox';tabchoice=2;tc=2;} else {selerm='tabbox' ;};
	if ( (tu.indexOf('searchinclude=rftab')>1  && tu.indexOf('searchinclude=rmtab')<1 && tu.indexOf('searchinclude=ermtab')<1) || tc==3){selrf='tabbox_current tabbox';tabchoice=3;tc=3;} else {selrf='tabbox' ;};
	if (tu.indexOf('searchinclude=allimages')>1 || ( tu.indexOf('searchinclude=rmtab')<1 && tu.indexOf('searchinclude=rftab')<1  && tu.indexOf('searchinclude=journalistic')<1  && tu.indexOf('searchinclude=ermtab')<1 ) || tc==4 || tc==0 ){
		selall='tabbox_current tabbox';tabchoice=4;
	} else {selall='tabbox' ;};


					if (tu.indexOf('DEBUG')>0){alert('DEBUG:' + tabchoice) };

	if(tabchoice != 'undefined'){tc=tabchoice;}
	var thtml='<div id=tabbox_wrap>';
	thtml+='<div class="' + selrm + '" id=tab_rm><a href="javascript:search_filter(\'rm\',1,\'' + tabmode + '\');" '+ tabtipmouse('rm') + '>'  + pr['rm' + suffix] + '</a>' + tabtip('rm') + '</div>';
	thtml+='<div class="' + selerm + '" id=tab_erm><a href="javascript:search_filter(\'erm\',1,\'' + tabmode + '\');" '+ tabtipmouse('erm') + '>'  + pr['erm' + suffix] + '</a>' + tabtip('erm') + '</div>';
	thtml+='<div class="' + selrf + '" id=tab_rf><a href="javascript:search_filter(\'rf\',1,\'' + tabmode + '\');" '+ tabtipmouse('rf') + '>'  + pr['rf' + suffix] + '</a>' + tabtip('rf') + '</div>';
	thtml+='<div class="' + selall + '" id=tab_all><a href="javascript:search_filter(\'all\',1,\'' + tabmode + '\');" ' + tabtipmouse('all') + '>' + pr['all' + suffix] + '</a>' + tabtip('all') + '</div>';

	if(winW>800 && false){
		thtml+='<div class=tabtip id=tab_tip><a href="#" onmouseOver="javascript:show_tippanel();" onmouseOut="javascript:hide_tippanel();" TITLE="' + pr['filteredtabswide'] + '">' + pr['filteredtabs' + suffix] + '</a>';
		thtml+='<div id=tab_tip_panel style="top: 7px;left: -7px;"><div id=tab_tip_panel_cancel><a href="javascript:hide_tippanel();">close [x]</a></div>';
		thtml+='Aurora\'s filtered search tabs provide you with a way to choose what you see. You can find all the very best rights managed imagery that you have traditionally found on Aurora Photos by staying with the default AURORA EDIT search. This result provides you with Aurora\'s best edit of what is available from our contributors and partners. Alternatively you can search all images, or look at the different collections separated by each tab.';
		thtml+='<br/><br/>';
		thtml+='In the Journalistic tab Aurora presents a wide range of candid and journalistic portrait photography. These images have not been manipulated and all adhere to <a href=http://www.auroraphotos.com/journalistic.html>Aurora\'s definition of a \'journalistic\' image.</a>';
		thtml+='<br/><br/>';		
		thtml+='If you wish to search only eRM or Easy Rights Managed myPhone collection, you can do that.';
		thtml+='<br/><br/>';
		thtml+='If you wish to search only Royalty-Free collections, including Aurora\'s own RF collection, Open, you can do that. And if you want to see a broader selection of editorial and commercial stock imagery from our partners including IPNStock, you can do that too.';
		thtml+='<br/><br/>';
		thtml+='Remember that you can always do the default search which provides you Aurora\'s edit of the best imagery on the site.';
		thtml+='</div></div>';
	}
	thtml+'</div>';
			
	return thtml;
}

var thtml=make_search_tabs();



checkHomepageView();

function show_tippanel(tp){
	if(tp){
		var tpp='tab_tip_panel_' + tp;
		$(tpp).style.display= 'block';
	} else {
		$('tab_tip_panel').style.display= 'block';
	}
}
function hide_tippanel(tp){
	if(tp){
		var tpp='tab_tip_panel_' + tp;
		$(tpp).style.display= 'none';
	} else {
		$('tab_tip_panel').style.display= 'none';
	}
}
oNav = {
	01 : ["home","home","/index.shtml"],

	10 : ["hubs", "hubs", "#"],
	12 : ["hubs", "creative", "/creative.shtml"],
	13 : ["hubs", "editorial", "/features/stories/images.shtml"],
	14 : ["hubs", "green", "/greenhub.shtml"],
	15 : ["hubs", "outdoor", "/outdoor.shtml"],
	16 : ["hubs", "travel", "/travel.shtml"],
	17 : ["hubs", "royalty free", "/open/"],
	18 : ["hubs", "myPhone collection", "/myphone/"],

	20 : ["advanced search", "advanced search", "/user/search.shtml"],

	30 : ["assignments", "assignments", "/aboutus_assignments.shtml"],
	31 : ["assignments", "Aurora Select", "/aboutus_assignments.shtml"],
	32 : ["assignments", "photographer locations","openphotographerlocations.shtml"],

	40 : ["multimedia", "multimedia", "/aboutus_multimedia.shtml"],
	41 : ["multimedia", "Aurora Novus", "/aboutus_multimedia.shtml"],

	50 : ["the agency", "the agency", "/aboutus_mission.shtml"],
	51 : ["the agency", "about aurora photos","/aboutus_mission.shtml"],
	52 : ["the agency", "agency news", "http://news.auroraphotos.com/"],
	53 : ["the agency", "partner agencies","/partners.shtml"],
	54 : ["the agency", "contributing photographers","/cgi-bin/photographers.cgi"],
	55 : ["the agency", "become a contributor","/submissions.html"],
	56 : ["the agency", "meet the staff","/staff/staff.html"],
	57 : ["the agency", "employment opportunities","/positions.html"],
	58 : ["the agency", "insight: client newsletter","http://news.auroraphotos.com/category/insight-newsletter/"],
	59 : ["the agency", "contact", "/contact.shtml"],	

	60 : ["projects", "projects", "#"],
	61 : ["projects", "Inauguration 2009", "/obama09/"],
	62 : ["projects", "Aurora@15: ActionReaction", "http://www.aurora15.com/"],
	63 : ["projects", "PhotoVoyages", "http://photovoyages.auroraphotos.com/"],
	64 : ["projects", "Jump: 9 Photographers", "/storytelling/jump/"],
	65 : ["projects", "Photographers Meeting", "/storytelling/meeting/photographers_meeting.html"],
	66 : ["projects", "Ocean Conservancy Cleanup", "/projects/oceanconservancy2009.html"],

	70 : ["help", "help", "/2help_starthere.shtml"],
	71 : ["help", "logging in", "/2help_login.shtml"],
	72 : ["help", "searching", "/2help_search.shtml"],
	73 : ["help", "lightboxes", "/2help_lightbox.shtml"],
	74 : ["help", "purchases", "/2help_purchase.shtml"],
	75 : ["help", "faq", "/2help_faq.shtml"]


};

if (typeof(ggetCookie) != 'function') {
function ggetCookie(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 openphotographerlocations(){
	var Win = window.open("/whereabouts.shtml","displayWindow",'width=906,height=657,resizable=1,scrollbars=no,menubar=no,status=no' );
	Win.focus();
}

function expandadminsearch(){
	if(document.getElementById('adminsearch')){
	//	document.getElementById('adminsearch').style.visibility='visible';
	}
}


                gadmin = ggetCookie("admin_level");
                gadmin_links = ggetCookie("display_admin_menu");

        /////// admin bar inline ///////
        if(gadmin && gadmin_links && typeof(gusername) != 'undefined' && gusername && gsession)
        {
                document.write('<div id=navbar style="background:#fff url(/graphics/admin_bg.gif) repeat-x top left; padding: 0px;width: 100%;margin: 0px;color: #ccc;padding-top: 5px; height: 23px;font-size: 9pt !important;"><font class=adminlabel>&nbsp;ADMIN:</font> <a href="/" target="left">Homepage</a> | ');
                //write in the navbar here;
		var adminmenu_panel = "";
                if (gadmin_links && gadmin_links.toString().length > 1) //also have additional links to parse
                {
                        var tnavObjs = eval(''+gadmin_links+'');
                        for (i=0;i< tnavObjs.length;i++){
                               adminmenu_panel += '<A href="' + tnavObjs[i]['lnk'] + '" class=>' + tnavObjs[i]['txt'] + '</a> | ';
                        }
			document.write(adminmenu_panel);
                }
                document.write('</div>');
		setTimeout("expandadminsearch()",3000);
        }
        //////

//make sure libs are included:
if (typeof(toplightboxrefresh) != 'function' && typeof(LIGHTBOX) == 'undefined')
	document.write('<script type="text/javascript" src="/javascript/af.js"></SCRIPT>');

//for editing, variable similar_to will be defined when we do the popup to edit all similar images, so hide the redundant header...
if(!(typeof(similar_to) != 'undefined' && similar_to))
{

document.write('<table cellspacing="0" cellpadding="0" border="0" width="100%" id="navigatorwrapper"><tr><form action="javascript:gstop();" method="get" name="qformtop">');
//document.write('<td width="200" valign="middle"  align="left" height="40"><a href="/index.shtml"><img src="/graphics/auroraphotos_logo.gif" height="36" width="193"  alt="auroraphotos.com" border="0" hspace="2" vspace="2"></a> </td>'); 
document.write('<td width="460" valign="middle" height="28px" align="left" style="padding-left: 30px;"><nobr>');
//standard navbar elements global

document.write(buildNav());
fixHoverIE();

document.write('</nobr></td>'); 
document.write('<td align=right valign=middle  >');
if(typeof(q_id) == 'undefined' && typeof(Keywords) == 'undefined'){
	// normal page
	document.write(buildSearchBox());
	
} //else {
	//results page
	//document.write(buildoptionalnavitems('nav'));
//}
document.write('</td></form></tr></table>');







if(typeof(q_id) == 'undefined' && typeof(Keywords) == 'undefined'){
	// normal page
	document.write('<table cellspacing="0" cellpadding="0" align="right" border="0" id="homepagextable"><tr>');
	document.write('<form name="homepagedropdown">');
	document.write(buildhomepageview());
	document.write('<td valign="middle" align="right" id="navigatorsub"  width="5%" style="height: 20px;" ><nobr>');
	document.write('<p style="height: 20px; margin: 8px 7px 4px 7px;">');
	document.write(buildoptionalnavitems('subnav'));
	document.write('</p>');
	document.write('</td></tr></table><BR clear="all">');	
	document.write('</form>');
} else {
        document.write('<table cellspacing="0" cellpadding="0" align="right" border="0"><tr><td width=95% valign=bottom>' + thtml + '</td>');
        document.write('<form name="homepagedropdown">');
	document.write('<td valign="middle" align="right" id="navigatorsub"  width="5%" style="height: 20px;" ><nobr>');
	document.write('<p style="height: 20px; margin: 8px 7px 4px 7px;">');
        document.write(buildoptionalnavitems('subnav'));
	document.write('</p>');
        document.write('</td></tr></table><BR clear="all">');
        document.write('</form>');

}

} // end if this is similar_to / share control mode (hide header)



if(tabchoice){
	search_filter(tabchoice);
}



if (! document.getElementById('RSIFrame') )
	document.write('<iframe id="RSIFrame" name="RSIFrame" style="width:0px; height:0px; border: 0px" src=nothing.html></iframe>');


function buildoptionalnavitems(tp){
	var temphtml = '';
	if(gsession && gusername) {
		temphtml = '<span class=headerblack style="margin-left:6px;margin-right:6px;">'+ pr['welcome' + suffix]  + (winW < 801 ? '': gusername) + '</span>'
		+ '<span class=navrow1><A HREF="javascript: gsetCookie2\(\'username\',\'\'\);gsetCookie2\(\'gmpsess\',\'\'\);gsetCookie2\(\'gmpauth\',\'\'\);top.location=\'/index.shtml\';\" class=' + tp + '>SIGN-OUT</A></span>'
		+ '<span class=navrow1><A HREF=/SwishSearch?n=1&lb_view=1 class=' + tp + '>' +  pr['lb' + suffix]  + '</A></span>';

		temphtml += '<span class=navrow1><A HREF=/bin/Profile class=' + tp + '>' + pr['profile' + suffix] + '</A></span>'
		+ '<span class=navrow1><A HREF=/tools/DDload class=' + tp + ' >DOWNLOADS</A></span>';
		if( gcartimages ){
			temphtml += '<span class=navrow1><A href="javascript:topcartrefresh();" class=' + tp + '>' + pr['cart' + suffix] +  '</A></span>';
		}
		temphtml +='<iframe id="RSIFrame" name="RSIFrame" style="width:0px; height:0px; border: 0px" src=nothing.html></iframe>'
		+ '<iframe id="LBFrame" name="LBFrame" style="width:0px; height:0px; border: 0px" src="nothing.html"></iframe>';

		

	} else {
		if(gsession){
			temphtml = '<span class=headerblack style="margin-left:6px;margin-right:6px;">' + pr['welcome' + suffix] + '</span>'
			+ '<span class=navrow1><A HREF=/SwishSearch?n=1&lb_view=1 class=' + tp + '>' + pr['lb' + suffix] +  '</A></span>';
	
			temphtml += '<span class=navrow1><A HREF=/bin/Profile class=' + tp + '>' + pr['profile' + suffix] +  '</A></span>'
			+ '<span class=navrow1><A HREF=/tools/DDload class=' + tp + ' >DOWNLOADS</A></span>';
			if( gcartimages ){
				temphtml += '<span class=navrow1><A href="javascript:topcartrefresh();" class=' + tp + '>' + pr['cart' + suffix] +  '</A></span>';
			}
		} else {
			temphtml = '<a href="/user/2login.shtml" onclick="this.href+=\'?/SwishSearch?\'+q_args" onmouseover="MM_setTextOfLayer(\'navlayer\',\'\',\'<a href=/registration.shtml class=subnav >create new account</a> : <a href=/bin/Profile class=subnav >modify your account</a> : <a href=/tools/DDload class=subnav >download area</a>\')" class=' + tp + '>LOGIN FOR MORE TOOLS</a>';
		temphtml +='<iframe id="RSIFrame" name="RSIFrame" style="width:0px; height:0px; border: 0px" src=nothing.html></iframe>'
		+ '<iframe id="LBFrame" name="LBFrame" style="width:0px; height:0px; border: 0px" src="nothing.html"></iframe>';

		}	
	}	
	return temphtml;
}


function buildNavbar() {
	
	return "&nbsp;&nbsp;&nbsp;"
				+"<a href='/user/search.shtml' class='nav'  onmouseover=\"MM_setTextOfLayer(\'navlayer\',\'\',\'\');\">search</a>"
				+"&nbsp;&nbsp;&nbsp; "
				+"<a href='/2nav_index.shtml' class='nav' onmouseover=\"MM_setTextOfLayer(\'navlayer\',\'\',\'\');\">editorial</a>"
				+"&nbsp;&nbsp;&nbsp; "
				+"<a href='/2col_Abstract.shtml' class='nav' onmouseover=\"MM_setTextOfLayer(\'navlayer\',\'\',\'\');\">creative</a>"
//				+"&nbsp;&nbsp;&nbsp; "
//				+"<a href='/2nav_index_oc.shtml' class='nav' onmouseover=\"MM_setTextOfLayer(\'navlayer\',\'\',\'\');\">outdoor collection</a>"
				+"&nbsp;&nbsp;&nbsp; "
				+"<a href='/SwishSearch?n=1&lb_view=1' class='nav'  "
				+"onmouseover=\"MM_setTextOfLayer(\'navlayer\',\'\',\'<a href=/SwishSearch?n=1&lb_view=1 class=subnav >view your lightbox</a> : <a href=javascript:topcartrefresh(); class=subnav >view shopping cart</a> : <a href=/tools/DDload class=subnav >download area</a>\');\">my lightbox</a>"
				+"&nbsp;&nbsp;&nbsp; "
				+"<a href='/select/' class='nav' onmouseover=\"MM_setTextOfLayer(\'navlayer\',\'\',\'\');\">assignments</a>"
				+"&nbsp;&nbsp;&nbsp; "
				+"<a href='/2help_starthere.shtml' class='nav' "
				+"onmouseover=\"MM_setTextOfLayer(\'navlayer\',\'\',\'" 
				+"<a href=/help_starthere.shtml class=subnav >start here</a> : <a href=/help_login.shtml class=subnav>logging in</a> : <a href=/help_search.shtml class=subnav >searching</a> : <a href=/help_lightbox.shtml class=subnav >lightboxes</a> : <a href=/help_purchase.shtml class=subnav >purchasing</a> : <a href=/2help_faq.shtml class=subnav >faq</a>\');\">help</a>"
				+ "&nbsp;&nbsp;&nbsp; <a href='/2aboutus_mission.shtml'  class='nav' "
				+ "onmouseover=\"MM_setTextOfLayer(\'navlayer\',\'\',\' <A href=/aboutus_people.shtml class=subnav >our team</A> :   <a href=/aboutus_purchasing.shtml class=subnav>products & services</a>\');\">about</a>"
				+ "&nbsp;&nbsp;&nbsp; <a href='/2contact.shtml' class='nav' onmouseover=\"MM_setTextOfLayer(\'navlayer\',\'\',\'\');\">contact</a>&nbsp;"
				;

}

function buildSearchBox() {

	return '<table><TR><TD valign=middle><nobr><span class=navrow1><font class="nav">SEARCH:</a></span><input type="text" name="Keywords" size="15" class="homekeys">'
		+ '</nobr></td><TD valign=middle><input type="submit" name="submit" value="Go!" onclick="javascript:gstop()">'
		+ '</td></tr></table>'
		;
//'<input type="image" src="/graphics/go-v3.gif" width=38 height=20 alt="go" border="0">';

}

function gstop() {
	var url2= document.qformtop.Keywords.value;
	var theurl= '/SwishSearch?submit.x=0&submit.y=0&Keywords=' + url2 ;
	if (url2 != 'keywords') {
		self.location = theurl;
	} else {
		alert('You must first type in keywords to search for.');
		document.qform.Keywords.focus();
	}
}

function buildNav() {

var menuHtml = "";
var submenuHtml = "";

	for (var id in oNav) {
	
	submenuHtml = "";
	
	if (oNav[id][0] !=  oNav[id][1]) continue;

			  menuHtml += "<li>"
				  		+ "<a href='" + oNav[id][2] + "'>" +  oNav[id][1].toString().toUpperCase() + "</a>"
				  		;

				for (var subid in oNav) { 
					if (oNav[subid][0] ==  oNav[subid][1]) continue;
					if (oNav[id][1] !=  oNav[subid][0]) continue;

		  			submenuHtml += "<li>"
						  		+ "<a href='" + oNav[subid][2] + "'>" + oNav[subid][1].toString().toUpperCase() + "</a>"
							  	+ "</li>"
				  				;
					
				}

		if (submenuHtml != "") submenuHtml = "<ul>" + submenuHtml + "</ul>";

		 menuHtml += submenuHtml + "</li>";


	} 

	return '<table cellpadding=0 cellspacing=0 border=0><tr><td><a href="/index.shtml"><img src="/graphics/minilogo.jpg" style="border: none; margin-top: 2px;"></a></td>'
 + '<td align="left"><div id="navigator">'
+ "<ul>" 
			+ "<li style='background-color: #999999;'>" 
			+ "</li>" 
			+ menuHtml + "</ul>" 
			+ "</div></td></tr></table>";

}

function buildhomepageview() {
	
	var sPath = window.location.pathname;
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);

 	var oUrl = sPath.split("/");

	if (sPage == '' && oUrl.length == 2) {
		sPage = 'index.shtml';	
	}

	if (sPage == 'indexsearch.shtml') {
		var selectedadvanced = 'SELECTED="selected"'; 
	} else {
		var selectedadvanced = ''; 	
	}

	if ((sPage == 'index.shtml' || sPage == 'indexsearch.shtml') && false) {	
	
	return '<td valign="middle" align="right" style="padding-top: 4px; margin: 0px; padding-right:10px;"><strong>'
			+ 'Choose between two homepage views here: &nbsp;&nbsp;' 
			+ '<select onchange="switchHomepage();" style="font-size: 9px; border: silver solid 1px; background-color: #f0f0f0;" id="homepagechoice">'
			+ '<option value="0">Hubs & Agency</option>'
			+ '<option value="1" ' + selectedadvanced  + '>Advanced Search</option>'
			+ '</select>'
			+ '</strong> </td>';

	} else {
		return '<td valign="middle" align="right" style="padding-right:5px;"><strong>'
		+ '</strong> </td>';
	}
	

}

function switchHomepage() { 

	Url = buildPagePath();
	gsetCookie2('homepageview', document.getElementById("homepagechoice").value);

	if (document.getElementById("homepagechoice").value == '1') {
		location.href= Url + 'indexsearch.shtml';
	} else {
		location.href= Url + 'index.shtml';		
	}


}

function buildPagePath() {

	var oUrl = (location.href).split("/");
	var UrlLength = oUrl.length - 1;
	var Url = "";
	var i=0;

	while (i<UrlLength) {
		Url += oUrl[i] + "/";
		i=i+1
	}
	
return Url;
	
}

function checkHomepageView() {
	
	var PageIndicator = getCookie('homepageview');
	
	var sPath = window.location.pathname;
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);

 	var oUrl = sPath.split("/");

	if ((sPage == '' && oUrl.length == 2) || (sPage == 'index.shtml')) {
		if (PageIndicator == '1') {
			location.href = buildPagePath() + 'indexsearch.shtml';		
		}
	}
	
	
}

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 fixHoverIE() {
sfHover = function() {
        var sfEls = document.getElementById("navigator").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 clear_tabs() {
	for (i=0; i<tab.tablist.length; i++) {
		if($(tab.tablist[i])){
			$(tab.tablist[i]).removeClassName('tabbox_current');
		}
	}
}


