

jQuery('#goGrape').hover(function() {
    jQuery(this).css('backgroundImage', 'url(goGrapeOver.png)');
}, function() {
    jQuery(this).css('backgroundImage', 'url(goGrape.png)');
});

jQuery('#goGrape').click(function() {
	alert(jim.info);
});


jQuery('#info').hover(function() {
    jQuery(this).css('backgroundImage', 'url(infoOver.png)');
}, function() {
    jQuery(this).css('backgroundImage', 'url(info.png)');
});

jQuery('#info').click(function() {
//	alert(jim.info);
window.location = 'http://www.grapestack.com/grape.cfm';
});


jQuery('#loginButton').hover(function() {
    jQuery(this).attr('src', 'loginOver.png');
}, function() {
    jQuery(this).attr('src', 'login.png');
});




var words = new Array();

words[0] = new Array();
words[1] = new Array();
words[2] = new Array();

words[0][0] = 'com';
words[0][1] = 'products';
words[1][0] = 'net';
words[1][1] = 'services';
words[2][0] = 'org';
words[2][1] = 'community';


for (z=0;z<words.length;z++) {

//alert(jQuery('#' + words[z][0].toString()));

var item = jQuery('#' + words[z][0].toString());

//alert(item);

item.hover(function() {
jQuery(this).css('backgroundImage', 'url(buttonOver.png)');
document.getElementById(jQuery(this).attr("id")).firstChild.src=document.getElementById(jQuery(this).attr("id")).firstChild.id+'Over.png';
}, function() {
jQuery(this).css('backgroundImage', 'url(button.png)');
document.getElementById(jQuery(this).attr("id")).firstChild.src=document.getElementById(jQuery(this).attr("id")).firstChild.id+'.png';

});


}



var swapBackAll = new Array();
swapBackAll[0] = 'menu1';
swapBackAll[1] = 'menu2';
swapBackAll[2] = 'menu3';
swapBackAll[3] = 'menu4';
swapBackAll[4] = 'menu5';
swapBackAll[5] = 'menu6';
swapBackAll[6] = 'menu7';

for (y=0;y<swapBackAll.length;y++) {
	
	jQuery('#'+swapBackAll[y]).mouseover(function()
		{
		setSwap(this);
		});

	jQuery('#'+swapBackAll[y]).mouseout(function()
		{
		setSwap(this);
		});

}


function setSwap(ev) {

	var target = ev;

	var collection = target.getElementsByTagName('DIV');

	var collectionTarget = target.id;

	if (collection[0].style.backgroundImage.indexOf('leftCurve') > 0) {
		swapBack(collection,collectionTarget);
	} else {
		swapTo(collection,collectionTarget);
	}

	return collection;
}

function swapBack(collection) {

	for (var x=0; x<collection.length; x++) {
	        if (collection[x].className=='leftCurve') {
			collection[x].style.backgroundImage="url('noCurve.png')";

	   	}
	        if (collection[x].className=='middleCurve') {
			collection[x].style.backgroundImage="url('noCurve.png')";
	   	}
	        if (collection[x].className=='rightCurve') {
			collection[x].style.backgroundImage="url('noCurve.png')";
	   	}
	}

}

function swapTo(collection,collectionTarget) {

	for (var x=0; x<collection.length; x++) {
	        if (collection[x].className=='leftCurve') {
			collection[x].style.backgroundImage="url('leftCurve.png')";
	   	}
	        if (collection[x].className=='middleCurve') {
			collection[x].style.backgroundImage="url('middleCurve.png')";
	   	}
	        if (collection[x].className=='rightCurve') {
			collection[x].style.backgroundImage="url('rightCurve.png')";
	   	}
	}

for (y=0;y<swapBackAll.length;y++) {

	if (swapBackAll[y].toString() != collectionTarget.toString()) {

		var swapCollection = document.getElementById(swapBackAll[y]).getElementsByTagName('DIV');

		for (var x=0; x<swapCollection.length; x++) {

	        if (swapCollection[x].className=='leftCurve') {
			swapCollection[x].style.backgroundImage="url('noCurve.png')";

	   	}
	        if (swapCollection[x].className=='middleCurve') {
			swapCollection[x].style.backgroundImage="url('noCurve.png')";
	   	}
	        if (swapCollection[x].className=='rightCurve') {
			swapCollection[x].style.backgroundImage="url('noCurve.png')";
	   	}
	}

	} else {
	}
}

}

image1 = new Image();
image1.src = "goGrapeOver.png";

image2 = new Image();
image2.src = "infoOver.png";

image3 = new Image();
image3.src = "productsOver.png";

image4 = new Image();
image4.src = "servicesOver.png";

image5 = new Image();
image5.src = "communityOver.png";

image6 = new Image();
image6.src = "leftCurve.png";

image7 = new Image();
image7.src = "middleCurve.png";

image8 = new Image();
image8.src = "rightCurve.png";

image9 = new Image();
image9.src = "buttonOver.png";