
<!--
function doSiteSearch()
{	
	
	var searchVal = document.getElementById("SiteSearch").value;
	location.href = '/search/default.aspx?Search=' + searchVal;
}

function switchImages( name1, source1 ){
		if ( document.images ){
			document[name1].src=source1;

        }
}

function openPopCenter(url,height,width,features){

	// Get left and top coordinates so window can be opened centered on the screen
	var screenx = ((screen.availWidth / 2) - (width / 2))
	var screeny = ((screen.availHeight / 2) - (height / 2))

	var featureList = 'height=' + height + ',width=' + width + ',left=' + screenx + ',top=' + screeny;
	if (features != '')
		featureList += ',' + features
		
	var newWin = window.open(url,"window",featureList);
}

function openEmailWindow(url,height,width,features){

	// Get left and top coordinates so window can be opened centered on the screen
	var screenx = ((screen.availWidth / 2) - (width / 2))
	var screeny = ((screen.availHeight / 2) - (height / 2))

	var featureList = 'height=' + height + ',width=' + width + ',left=' + screenx + ',top=' + screeny;
	if (features != '')
		featureList += ',' + features

	url = url + "?CallingPage=" + window.location

	var newWin = window.open(url,"window",featureList);
}

var DOM = false 
var IE = false 
var NS = false 
 
if (document.getElementById) { DOM = true} 
if (navigator.appName.indexOf("Microsoft Internet Explorer") > -1) IE = true 
if (DOM && !IE) NS = true

function showHideTable(sTblId)
{

	var tblId
	var moveTable

	tblId = document.getElementById(sTblId)

	if(tblId.style.display=="none")
	{
		tblId.style.display = "block"
		tblId.style.position = "relative"
		
		if(isNaN(parseInt(tblId.style.left)))
			tblId.oldLeft = 0
		else
			tblId.oldLeft = parseInt(tblId.style.left)

		moveTable = tblId.oldLeft + 10
		tblId.style.left = eval(String.fromCharCode(34) + moveTable + "px" + String.fromCharCode(34))
		
	}
	else
	{
		tblId.style.display = "none"
		tblId.style.position = "relative"
		tblId.style.left = tblId.oldLeft
	}
}

function showHideTableIcon(sTblId, ico)
{

	var icoObj
	var tblId
	var moveTable

	tblId = document.getElementById(sTblId)
	

	if(tblId.style.display=="none")
	{
		tblId.style.display = "block"
		tblId.style.position = "relative"
		
		if(isNaN(parseInt(tblId.style.left)))
			tblId.oldLeft = 0
		else
			tblId.oldLeft = parseInt(tblId.style.left)

		moveTable = tblId.oldLeft + 10		
		tblId.style.left = eval(String.fromCharCode(34) + moveTable + "px" + String.fromCharCode(34))
		
		icoObj = document.getElementById(ico)
		icoObj.src = "/us/images/icon_minus.gif"
	}
	else
	{
		tblId.style.display = "none"
		tblId.style.position = "relative"
		
		if(!isNaN(tblId.oldLeft))
			tblId.style.left = tblId.oldLeft
		
		icoObj = document.getElementById(ico)
		icoObj.src = "/us/images/icon_plus.gif"
	}
}

function showHide(tblId)
{

	if(tblId.style.display=="none")
	{
		tblId.style.display = "block"
		tblId.style.position = "relative"

		tblId.oldLeft = tblId.style.left
		tblId.style.left = tblId.style.left + 10
	}
	else
	{
		tblId.style.display = "none"
		tblId.style.position = "relative"
		tblId.style.left = tblId.oldLeft
	}
}

function showHideIcon(tblId, ico)
{

	var icoObj

	if(tblId.style.display=="none")
	{
		tblId.style.display = "block"
		tblId.style.position = "relative"

		tblId.oldLeft = tblId.style.left
		tblId.style.left = tblId.style.left + 10

		icoObj = document.all(ico)
		icoObj.src = "/us/images/icon_minus.gif"
	}
	else
	{
		tblId.style.display = "none"
		tblId.style.position = "relative"
		tblId.style.left = tblId.oldLeft

		icoObj = document.all(ico)
		icoObj.src = "/us/images/icon_plus.gif"
	}
}

/*
 * 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));
}

/*
 * Writes out either "Hälso- och sjukvårdspersonal" or "Consumer", based on value of HollisterUserGroup cookie.
 *
 */
function writeContinenceUserGroupName()
{
	var userGroup;	
	userGroup = getCookie("HollisterUserGroup");
	
	if (userGroup == "1")
		document.write('<tr><td><img border="0" src="/us/images/ln_label_consumer.gif" width="155" height="10" /></td></tr>')
	else if (userGroup == "2")
		document.write('<tr><td><img border="0" src="/us/images/ln_label_hcp.gif" width="155" height="10" /></td></tr>')

}

function writeOstomyUserGroupName()
{
	var userGroup;	
	userGroup = getCookie("HollisterUserGroup");
	
	if (userGroup == "3")
		document.write('<tr><td><img border="0" src="/us/images/ln_label_consumer.gif" width="155" height="10" /></td></tr>')
	else if (userGroup == "4")
		document.write('<tr><td><img border="0" src="/us/images/ln_label_hcp.gif" width="155" height="10" /></td></tr>')
	else if (userGroup == "5")
		document.write('<tr><td><img border="0" src="/us/images/ln_label_dp.gif" width="155" height="10" /></td></tr>')
}

/*
 * Writes out the MBC retailer link if the cookie named passed in is found
 *
 */
 function writeMbcRetailerLink(cookieName)
 {
	if (getCookie("HollisterMBCUserType") == "Retailer")
	{
		document.write('<tr><td align="left" height="22"><table border="0" cellspacing="0" cellpadding="0"><tr><td><img border="0" src="/us/images/clear.gif" width="6" height="1" /></td><td><img src="/us/images/lower_lnteal_box.gif" name="lower_lnteal_pah" width="6" height="12" border="0" id="lower_lnteal_pah" /></td><td><img border="0" src="/us/images/clear.gif" width="5" height="1" /></td><td class="leftnav"><a href="/us/mbc/retailers/" onmouseover="switchImages(\'lower_lnteal_pah\',\'/us/images/lower_ln_box.gif\')" onmouseout="switchImages(\'lower_lnteal_pah\',\'/us/images/lower_lnteal_box.gif\')">Partners at Heart</a></td></tr></table></td></tr>')
	}
 }

/*
 * Writes out the "Are you a retailer" link if the HCP cookie is found
 *
 */
 function writeMbcHcpLink()
 {
 	if (getCookie("HollisterMBCUserType") == "HCP")
	{
		document.write('<tr><td><img border="0" src="/us/images/clear.gif" width="161" height="20" /></td></tr><tr><td align="center"><a href="/us/mbc/login.asp"><img border="0" src="/us/images/mbc_pac_ad.gif" width="134" height="132" alt="Are you also a retailer?" /></a></td></tr>')
	}
 }
function doNothing(){}

// End --> 


