var btnCond 	= false;

// Following are constants
//
var HOME_PAGE = 0;
var CONT_PAGE = 1;


//=====================================================//
//=====================================================//
// on event onLoad display buttons to prevent flashing
function showNav()
{
	ref = document.getElementById('left_navigation');
	ref.style.visibility = "visible";
	ref = document.getElementById('current_page_corner');
	ref.style.visibility = "visible";
}

//===========================================================================//
//===========================================================================//
function btnHoverEffect(x)
{
	myimg = document.getElementById(x);
	var y = "/siteData/pic/home_page/" + x + ".gif";
	myimg.src = y;
}

//===========================================================================//
//===========================================================================//
function btnSelect(name,effect)
{
	myimg = document.getElementById(name);

	if(effect)
	{
		myimg.style.opacity="0.5";
		btnCond = true;
	}
	else
	{
		myimg.style.opacity="1";
		btnCond = false;
	}
}

//===========================================================================//
//===========================================================================//
//    btnHit()
//    id = element id to reset
//    name = btn that was chosesn
//===========================================================================//
function btnHit(id,name)
{
	var x = window.location.hostname;
	if(btnCond)
	{
		myimg = document.getElementById(id);
		myimg.style.opacity="1";

		btnCond = false;
		switch(name)
		{
			case 'aboutus':
				x = "goUrl('" + x + "/siteData/php/set_page.php?btn=aboutus')";
				setTimeout(x,300); break;
			case 'services':
				x = "goUrl('" + x + "/siteData/php/set_page.php?btn=services')";
				setTimeout(x,300); break;
				//setTimeout("goUrl('www.ocmstaffing.com/siteData/php/set_page.php?btn=services')",300); break;
			case 'employers':
				x = "goUrl('" + x + "/siteData/php/set_page.php?btn=employers')";
				setTimeout(x,300); break;
				//setTimeout("goUrl('www.ocmstaffing.com/siteData/php/set_page.php?btn=employers')",300); break;
			case 'candidates':
				x = "goUrl('" + x + "/siteData/php/set_page.php?btn=candidates')";
				setTimeout(x,300); break;
				//setTimeout("goUrl('www.ocmstaffing.com/siteData/php/set_page.php?btn=candidates')",300); break;
			case 'contactus':
				x = "goUrl('" + x + "/siteData/php/set_page.php?btn=contactus')";
				setTimeout(x,300); break;
				//setTimeout("goUrl('www.ocmstaffing.com/siteData/php/set_page.php?btn=contactus')",300); break;
		}
	}
}

//===========================================================================//
function goUrl(url)
{ window.location = "http://" + url; }


//===========================================================================//
//    CONTENT PAGES BELOW
//VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//

//===========================================================================//
//    btnHoverEffectSml()
//===========================================================================//
function btnHoverEffectSml(mid,name)
{
	myimg = document.getElementById(mid);
	var y = "/siteData/pic/content_pages/" + name + ".gif";
	myimg.src = y;
}



//===========================================================================//
//===========================================================================//
// MISC FUNCTIONS AND CODE
//===========================================================================//

var imgDir = "/siteData/pic";
var sitePics = new Array;

sitePics[0] = new Array("/logo/ballLogo.png",60,59);
sitePics[1] = new Array("/home_page/bkgnd_footer.gif",1,80);
sitePics[2] = new Array("/home_page/bkgnd_header.gif",1,223);
sitePics[3] = new Array("/home_page/btn_aboutus_s.gif",168,168);
sitePics[4] = new Array("/home_page/btn_candidates_s.gif",168,168);
sitePics[5] = new Array("/home_page/btn_contactus_s.gif",168,168);
sitePics[6] = new Array("/home_page/btn_employers_s.gif",168,168);
sitePics[7] = new Array("/home_page/btn_services_s.gif",168,168);
sitePics[8] = new Array("/home_page/btn_lg_photo.png",668,140);
sitePics[9] = new Array("/logo/logowords.png",218,92);

sitePics[10] = new Array("/content_pages/bkgnd_column_left.gif",212,1);
sitePics[11] = new Array("/content_pages/bkgnd_column_right.gif",112,1);
sitePics[12] = new Array("/content_pages/bkgnd_content.gif",1,498);
sitePics[13] = new Array("/content_pages/bkgnd_header.gif",1,223);
sitePics[14] = new Array("/logo/headerLogo.gif",166,69);
//sitePics[14] = new Array("/content_pages/btn_small_candidates.gif",142,141);
//sitePics[15] = new Array("/content_pages/btn_small_employers.gif",142,141);
//sitePics[16] = new Array("/content_pages/btn_small_services.gif",142,141);
//sitePics[17] = new Array("/content_pages/btn_small_contactus.gif",142,141);
//sitePics[18] = new Array("/content_pages/btn_small_aboutus.gif",142,141);
//sitePics[19] = new Array("/content_pages/btn_small_photo.png",548,118);
//sitePics[20] = new Array("/content_pages/corner_photo.png",775,159);
//sitePics[21] = new Array("/content_pages/corner_solid.gif",775,159);

var myPics = preloadImages(imgDir,sitePics);


function preloadImages(path,pics) {
	var images = new Array;
	for (var picNum=0; picNum<pics.length; picNum++)
	{
		images[picNum] = new Image(pics[picNum][1],pics[picNum][2]);
		images[picNum].src = (path + pics[picNum][0]);
	}
	return (images);
}
