home_on = new Image(96,30);
about_on = new Image(96,30);
featured_on = new Image(96,30);
buyer_on = new Image(96,30);
seller_on = new Image(96,30);
marketing_on = new Image(96,30);
contact_on = new Image(96,30);
news_on = new Image(96,30);

home_off = new Image(96,30);
about_off = new Image(96,30);
featured_off = new Image(96,30);
buyer_off = new Image(96,30);
seller_off = new Image(96,30);
marketing_off = new Image(96,30);
contact_off = new Image(96,30);
news_off = new Image(96,30);

home_on = "/img/nav/welcome_on.jpg";
about_on = "/img/nav/about_on.jpg";
featured_on = "/img/nav/featured_on.jpg";
buyer_on = "/img/nav/buyer_on.jpg";
seller_on = "/img/nav/seller_on.jpg";
marketing_on = "/img/nav/marketing_on.jpg";
contact_on = "/img/nav/contact_on.jpg";
news_on = "/img/nav/blog_on.jpg";

home_off = "/img/nav/welcome.jpg";
about_off = "/img/nav/about.jpg";
featured_off = "/img/nav/featured.jpg";
buyer_off = "/img/nav/buyer.jpg";
seller_off = "/img/nav/seller.jpg";
marketing_off = "/img/nav/marketing.jpg";
contact_off = "/img/nav/contact.jpg";
news_off = "/img/nav/blog.jpg";


//functions to swap img
function press(imgName) {
      document[imgName].src = eval(imgName + '_on');  
}
function release(imgName) {
    document[imgName].src = eval(imgName + '_off');  
}


function switchImg(imgID,id) {
	document.getElementById("mainimage"+id).src=imgID;
}

// JAVASCRIPT

function $(v) { 
	return(document.getElementById(v)); 
}

function $S(v) { 
	return($(v).style); 
}

function uni(v,id,s,top) { 
	var ob=$S(id),b=v/100; 
	ob.opacity=b; 
	ob.top=top+'px'; 
	ob.MozOpacity=b; 
	ob.KhtmlOpacity=b; 
	ob.filter="alpha(opacity="+v+")"; 
}

function zero(v) { 
	v=parseInt(v); 
	return(!isNaN(v)?v:0); 
}

function fade(id,img,ln,s) { 
	var top=zero(parseInt($S(id).top));

function opacity(oStart,oEnd,ln) { 
	var speed=Math.round(ln/100),timer=0;

	if(oStart>oEnd) { 
		for(i=oStart; i>=oEnd; i--) { 
			setTimeout("uni("+i+",'"+id+"','','"+(top--)+"')",timer*speed); timer++; 
		} 
		setTimeout("$S('"+id+"').display='none';",timer*speed); 
	}
	else if(oStart<oEnd) { 
		$S(id).display='inline'; 
		for(i=oStart; i<=oEnd; i++) { 
			setTimeout("uni("+i+",'"+id+"','"+1+"','"+(top++)+"')",timer*speed); timer++; } 
		}
	}
	
	if(s==1 || (!s && $S(id).opacity==0)) 
		opacity(0,100,ln); 
	else 
		opacity(100,0,ln);
}

function closeall(props) {
	for(var i=0; i < props; i++) {
		if (document.getElementById) {
			// this is the way the standards work
			var style2 = document.getElementById('p'+i).style;
			style2.display = "none";
		} else if (document.all) {
			// this is the way old msie versions work
			var style2 = document.all[i].style;
			style2.display = "none";
		} else if (document.layers) {
			// this is the way nn4 works
			var style2 = document.layers[i].style;
			style2.display = "none";
		}
	}
}

function openit(whichLayer,props)
{
	closeall(props);
	if (document.getElementById)
	{
	// this is the way the standards work
	var style1 = document.getElementById('p'+whichLayer).style;
	var style2 = document.getElementById('pictures'+whichLayer).style;
	var style3 = document.getElementById('video'+whichLayer).style;
	var style4 = document.getElementById('streetview'+whichLayer).style;
	style1.display = "block";
	style2.display = "block";
	style3.display = "none";
	style4.display = "none";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style1 = document.all['p'+whichLayer].style;
	var style2 = document.all['pictures'+whichLayer].style;
	var style3 = document.all['video'+whichLayer].style;
	var style4 = document.all['streetview'+whichLayer].style;
	style1.display = "block";
	style2.display = "block";
	style3.display = "none";
	style4.display = "none";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style1 = document.layers['p'+whichLayer].style;
	var style2 = document.layers['pictures'+whichLayer].style;
	var style3 = document.layers['video'+whichLayer].style;
	var style4 = document.layers['streetview'+whichLayer].style;
	style1.display = "block";
	style2.display = "block";
	style3.display = "none";
	style4.display = "none";
	}
}

function switchView(whichLayerOn,whichLayerOff1,whichLayerOff2,layerID) {
	if (document.getElementById)
	{
	// this is the way the standards work
	var content1 = document.getElementById(whichLayerOn+layerID).style;
	var content2 = document.getElementById(whichLayerOff1+layerID).style;
	var content3 = document.getElementById(whichLayerOff2+layerID).style;
	content1.display = "block";
	content2.display = "none";
	content3.display = "none";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var content1 = document.all[whichLayerOn+layerID].style;
	var content2 = document.all[whichLayerOff1+layerID].style;
	var content3 = document.all[whichLayerOff2+layerID].style;
	content1.display = "block";
	content2.display = "none";
	content3.display = "none";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var content1 = document.layers[whichLayerOn+layerID].style;
	var content2 = document.layers[whichLayerOff1+layerID].style;
	var content3 = document.layers[whichLayerOff2+layerID].style;
	content1.display = "block";
	content2.display = "none";
	content.display = "none";
	}
	
}

