function launchApplianceCare()
{
	window.open('http://www.bshappliancecare.com/Neff/index.html'); 	
	return true;
}

function loadUpJs()
{
	resizeHeightCentralColumn()
}

function toggleIconDiv(visible)
{
	if(visible)
	{
		document.getElementById("iconFeatureDiv").style.display='block';
		document.getElementById("iconHeaderDiv").style.display='none';
	}
	else
	{
		document.getElementById("iconFeatureDiv").style.display='none';
		document.getElementById("iconHeaderDiv").style.display='block';
	}
	
	return false;
}

function toggleNewsArchive(visible)
{
	if(visible)
	{
		document.getElementById("Archive").style.display='block';
		document.getElementById("ArchLink").style.display='none';
	}
	else
	{
		document.getElementById("Archive").style.display='none';
		document.getElementById("ArchLink").style.display='block';
	}
	
	return false;
}

function ShowHideFeatures(docId)
{
	var testObj;
	testObj = document.getElementById("iconFeatureDiv");
	if(testObj==null)
		return;
	
	toggleIconDiv(true);
	showHide('icon'+docId, true);
}

function resizeHeightCentralColumn()
{
	var centralColumn = document.getElementById("CentralColumnV2");
	var innerHeight;
	if (centralColumn)
	{
		if (window.innerHeight)
		{
			if (document.height < window.innerHeight)
			{
				innerHeight = window.innerHeight;
			}
		}
		else if (document.body.clientHeight)
		{
			innerHeight = document.body.clientHeight;
		}
		if (innerHeight)
		{
			centralColumn.style.height = innerHeight + 'px';
		}
	}
}

function checkForResize()

{
	// remove border graphics for small resolutions to remove horizontal scrollbars
	if(screen.width < 850)
	{
		document.body.className = "BodyV2Narrow";
		document.getElementById("RightColumnV2").className = "RightColumnV2Narrow";
		document.getElementById("LeftColumnV2").className = "LeftColumnV2Narrow";
	}
}

function MouseOverImage(strImgName, strFileName, strType) 
{
	var objImg;
	objImg = document.images[strImgName];
	if (! objImg) {
		return; // Abandon all hope!
	}

	if (strType == "PROD")
	{
		objImg.src = "images/products/buttons/" + strFileName;
	}
	else if (strType == "ICON")
	{
		objImg.src = strFileName;
	}
	else
	{
		objImg.src = "images/nav/top/" + strFileName;
	}
}

/* Added to support single XSL with different page nesting levels */
function MouseOverImageWithPath(rootPath, strImgName, strFileName, strType)
{
	var objImg;
	objImg = document.images[strImgName];
	if (! objImg) {
		return; // Abandon all hope!
	}

	if (strType == "PROD")
	{
		objImg.src = rootPath + "images/products/buttons/" + strFileName;
	}
	else if (strType == "ICON")
	{
		objImg.src = strFileName;
	}
	else
	{
		objImg.src = rootPath + "images/nav/top/" + strFileName;
	}
}	

function MouseOverCooksImage(strImgName, strFileName, strType) 
{
	var objImg;
	objImg = document.images[strImgName];
	if (! objImg) {
		return; // Abandon all hope!
	}

	if (strType == "PROD")
	{
		objImg.src = "../images/products/buttons/" + strFileName;
	}
	else if (strType == "ICON")
	{
		objImg.src = strFileName;
	}
	else
	{
		objImg.src = "../images/nav/top/" + strFileName;
	}
}		


function getLayer(layerName)
{
	var theLayer = document.getElementById(layerName);
	if (!theLayer)
		theLayer = document.getElementsByName(layerName)[0];
	return theLayer;		
}

var prevLayer = null;

function showHide(layerName, visible)
{
	
	var theLayer = getLayer(layerName);
	
	if(layerName.indexOf('icon')==0)
	{
		if(prevLayer != null)
		{
			if(prevLayer != theLayer)
			{
				prevLayer.style.visibility = 'hidden';
			}		
		}
		prevLayer = theLayer;
	}
		
	theLayer.style.visibility = (visible) ? 'hidden' : 'visible';
}

/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

/**
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function deleteCookie(name, path, domain)
{
    if (getCookie(name))
    {
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}