// JavaScript Document

var clicked = 0;
var prefix = 'menu';
var sum = 8;
var tooltip = new Array(
	'Fresh Design Studio',
	'Web Development, Web/Mobile Apps, E-Commerce ',
	'Ad Copywriting, Graphic Design, Marketing, 3D Floorplans',
	'Website Rental, as low as $10/Month, Easy Setup',
	'SMS Technology Development, SMS Marketing, Bulk SMS',
	'IT Solution/Consulting, IT Outsourcing ',
	'Fresh Representative, Free Training, Residual Income',
	'We see the Freshness in you'
);
var tooltipPos = new Array(
	'60,0',
	'60,10',
	'60,100',
	'60,240',
	'60,330',
	'60,505',
	'60,589',
	'60,729'
)
/*
var tooltipPos = new Array(
	'60,0',
	'60,105',
	'60,222',
	'60,320',
	'60,440',
	'60,530',
	'60,650',
	'60,798'
)
*/
function showToolTip(num,state) {
	var obj = document.getElementById('tooltip');	
	var pos = tooltipPos[num - 1].split(',');
	if(state) {
		document.getElementById('tooltip_middle').innerHTML = tooltip[num - 1];
		obj.style.top = pos[0] + 'px';
		obj.style.left = parseInt((document.body.clientWidth - 940) / 2) + parseInt(pos[1]) + 'px';
		obj.style.display = 'block';
	}
}

function hideToolTip() {
	document.getElementById('tooltip').style.display = 'none';
}

function mouseover(id) {
	for(var i = 1; i <= sum; i++) {		
		if(i == parseInt(id.replace(prefix,''))) {
			showToolTip(i,true);
			if(i != clicked) {
			document.getElementById(prefix + i).style.background = 'url(images/mouseover_bg.png)';
			document.getElementById(prefix + i).style.backgroundRepeat = 'no-repeat';
			document.getElementById(prefix + i).style.backgroundPosition = 'center';
			}
		} else {
			if(i != clicked) {
				document.getElementById(prefix + i).style.background = '';
			}
		}
	}		
}

function mouseout() {
	for(var i = 1; i <= sum; i++) {
		if(i != clicked) {
			document.getElementById(prefix + i).style.background = '';document.getElementById(prefix + i).style.background = '';
		}
	}
}

function mousedown(id) {	
	for(var i = 1; i <= sum; i++) {		
		if(i == parseInt(id.replace(prefix,''))) {
			document.getElementById(prefix + i).style.background = 'url(images/mousedown_bg.png)';
			document.getElementById(prefix + i).style.backgroundRepeat = 'no-repeat';
			document.getElementById(prefix + i).style.backgroundPosition = 'center';
			clicked = i;
			if(i == 1) {
				document.getElementById('main_iframe_main').src ='home.html';
				window.location.hash = "";
			}
			if(i == 2) {
				document.getElementById('main_iframe_main').src ='web.html';	
				window.location.hash = "Web";
			}
			if(i == 3) {
				document.getElementById('main_iframe_main').src ='creative.html';	
				window.location.hash = "Creative";
			}
			if(i == 4) {
				document.getElementById('main_iframe_main').src ='rental.html';	
				window.location.hash = "Rental";
			}
			if(i == 5) {
				document.getElementById('main_iframe_main').src ='SMS.html';	
				window.location.hash = "SMS";
			}
			if(i == 6) {
				document.getElementById('main_iframe_main').src ='ITSupport.html';	
				window.location.hash = "ITSupport";
			}
			if(i == 7) {
				document.getElementById('main_iframe_main').src ='reps.html';	
				window.location.hash = "Reps";
			}
			if(i == 8) {
				document.getElementById('main_iframe_main').src ='aboutUs.html';	
				window.location.hash = "About Us";
			}
		} else {
			document.getElementById(prefix + i).style.background = '';
		}
	}
}