// lazy shortcut

d=document;

// set up rollovers

sections = new Array("home","boutiques","email-sign-up","help-me-shop-for","email-archives","about-us","best-girl-friend-login");
for (x=0;x<=sections.length-1;x++){
psections = new Array();
psections[x] = sections[x].replace(/-/g,'_');
setup = psections[x]+'on = new Image();'+psections[x]+'on.src = "resources/img/nav/'+sections[x]+'_on.jpg";'+psections[x]+'off = new Image();'+psections[x]+'off.src = "resources/img/nav/'+sections[x]+'_off.jpg";';
eval(setup);
}

// rollover functions
function on(which) {
	pwhich = which.replace(/-/g,'_');
	if (d.images) {document[which].src = eval(pwhich+"on.src");}
}
function off(which) {
	pwhich = which.replace(/-/g,'_');
	if (d.images) {document[which].src = eval(pwhich+"off.src");}
}

// status bar set

window.status=d.title;

// window popper

function popwin(url,width,height){
window.open(url,'popup','width='+width+',height='+height+',location=0,address=0,scrollbars=0,status=0,noresize');
}

// alternate new window
function newWindow(url) {
	window.open(url,'externalsite','');
}

// show/hide

function show(object) {
	if (d.getElementById && d.getElementById(object) != null)
	node = d.getElementById(object).style.visibility='visible';
	else if (d.layers && d.layers[object] != null)
	d.layers[object].visibility = 'visible';
	else if (d.all)
	d.all[object].style.visibility = 'visible';
}

function hide(object) {
	if (d.getElementById && d.getElementById(object) != null)
	node = d.getElementById(object).style.visibility='hidden';
	else if (d.layers && d.layers[object] != null)
	d.layers[object].visibility = 'hidden';
	else if (d.all)
	d.all[object].style.visibility = 'hidden';
}

// the homepage picture and content display function

function doit(which){

	// find out which image is currently highlighted (starts with 1, of course).
	
	bigpicsrc=document.big_pic.src.split("/");
	bigpicsrc=bigpicsrc[bigpicsrc.length-1];
	
	// set the new source for the small pic, knowing we're sending the big pic there.
	new_smallpicsrc=bigpicsrc.replace("_color","_bw");
	
	// find out the source of the small pic we just clicked. we get the content and new big pic info here
	contentaddress=which.src.split("/");
	contentaddress=contentaddress[contentaddress.length-1];
	contentsrc=contentaddress.replace("_bw.jpg","")+"_content";
	new_bigpicsrc=contentaddress.replace("_bw","_color");
	
	// hide all the content
	hide('roll_1_content');
	hide('roll_2_content');
	hide('roll_3_content');
	
	// show the proper content, and change the two images
	show(contentsrc);
	which.src="resources/img/home/"+new_smallpicsrc;
	document.big_pic.src="resources/img/home/"+new_bigpicsrc;
	which.src="resources/img/home/"+new_smallpicsrc;
	document.big_pic.src="resources/img/home/"+new_bigpicsrc;

}