totalSmart1 = new Image();
totalSmart1.src = "../personal/img/sideBarImg.jpg";

totalSmart2 = new Image();
totalSmart2.src = "../personal/img/TotalSmart_Button2.jpg";

totalSmart3 = new Image();
totalSmart3.src = "../personal/img/TotalSmart_Button3.jpg";

homeAction1 = new Image();
homeAction1.src = "../personal/img/button.jpg";

homeAction2 = new Image();
homeAction2.src = "../personal/img/button1.jpg";

homeAction3 = new Image();
homeAction3.src = "../personal/img/button2.jpg";


function prodSubNav(){
	
		document.getElementById('ProductsSubNav').className="show"
		
	}
function prodSubNavGo(){
	
		document.getElementById('ProductsSubNav').className="hide"
		
	}
	
function servSubNav(){
	
		document.getElementById('ServiceSubNav').className="show"
		
	}
function servSubNavGo(){
	
		document.getElementById('ServiceSubNav').className="hide"
		
	}
	
function rewardsMO(num){
	if(num == 0){
		document.getElementById('rewardsBox').style.backgroundImage='url('+totalSmart1.src+')';	
	}	
	if(num == 1){
		document.getElementById('rewardsBox').style.backgroundImage='url('+totalSmart2.src+')';	
	}
	if(num == 2){
		document.getElementById('rewardsBox').style.backgroundImage='url('+totalSmart3.src+')';	
	}
}
function homeCall(num){
	if(num == 0){
		document.getElementById('homeCalltoAction').style.backgroundImage='url('+homeAction1.src+')';	
	}	
	if(num == 1){
		document.getElementById('homeCalltoAction').style.backgroundImage='url('+homeAction2.src+')';	
	}
	if(num == 2){
		document.getElementById('homeCalltoAction').style.backgroundImage='url('+homeAction3.src+')';	
	}	
}

function openAgent(theClicked)
{
	var IE = /*@cc_on!@*/false;

	document.getElementById('findAgentOpen').className = 'show';
								

	if(!IE)
	{
		
		document.getElementById('findAgentOpen').style.left = theClicked.offsetLeft-500;
		document.getElementById('findAgentOpen').style.top = theClicked.offsetTop - 150;	
	}
	theClicked.style.visibility = 'hidden';
}

function closeAgent()
{
	document.getElementById('findAgentOpen').className = 'hide';
	document.getElementById('findAgent').style.visibility = 'visible';
}


function selectedAuto(item)
{
	var box = document.getElementById(item.id+"Detail");
	var singleLine = document.getElementById(item.id+"Single");
							
	if (box.style.display == 'block')
	{
		box.style.display = 'none';
		singleLine.style.display = 'block';
	}
	else
	{
		box.style.display = 'block';
		singleLine.style.display = 'none';
	}
}

function selectedDetails(item)
{
	var box = document.getElementById(item.id+"Detail");
							
	if (box.style.display == 'inline')
	{
		box.style.display = 'none';
		
	}
	else
	{
		box.style.display = 'inline';
		
	}
}


function setCookie(name, value, exp_y, exp_m, exp_d, path, domain, secure)
{
	var cookie_string = name + "=" + escape(value);
	
	var cookieExpires = new Date();
	
	if (exp_y)
	{
		var expires = new Date (exp_y, exp_m, exp_d);
		cookie_string += "; expires=" + expires.toGMTString();
	}
	
	if (path) 
	{
		cookie_string +- "; path=" + escape (path);
	}
	if (domain)
	{
		cookie += "; domain=" + escape (domain);
	}
	
	if (secure)
	{
		cookie_string += "; secure";
	}
	
	document.cookie = cookie_string;
	
}

function deleteCookie( cookie_name)
{
	var cookie_date = new Date();  // current Date and Time
	cookie_date.setTime( cookie_date.getTime() -1);
	document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
	
}

function getCookie( cookie_name)
{
	var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  	if ( results )
	{
    	return ( unescape ( results[2] ) );
	}
  	else
	{
    	return null;
	}
}


	
