
var arrFontSizes = new Array('small', 'medium', 'large');

var strCustomSize = '0';
var strCustomSizeTemp = getCookie('ziCombiganFont');
if (strCustomSizeTemp == '') {
    strCustomSizeTemp = '0';
}
strCustomSize = strCustomSizeTemp;

function setFont(intFontSize) {
    var cmdFontSize;
    var objLegal;
    var objContent;
    var intFontSizeIndex = 1;
    
    for (var intFontLoopIndex = 0; intFontLoopIndex < arrFontSizes.length; intFontLoopIndex++) {
        cmdFontSize = document.getElementById('cmdFont_' + arrFontSizes[intFontLoopIndex]);

        if (intFontLoopIndex == intFontSize) {
            cmdFontSize.src = cmdFontSize.src.replace('_on.gif', '.gif').replace('.gif', '_on.gif');
            intFontSizeIndex = intFontLoopIndex;
            
        } else {
            cmdFontSize.src = cmdFontSize.src.replace('_on.gif', '.gif');
            
        }
    }
    
    if (document.getElementById('hcp_legal')) {
        objLegal = document.getElementById('hcp_legal');
        objLegal.className = 'font_size_' + arrFontSizes[intFontSizeIndex];
        
    } else if (document.getElementById('pat_legal')) {
        objLegal = document.getElementById('pat_legal');
        objLegal.className = 'font_size_' + arrFontSizes[intFontSizeIndex];
        
    } else {
    
        objLegal = null;
    }
    
    if (document.getElementById('middle_column')) {
        objContent = document.getElementById('middle_column');
	    objContent.className = 'font_size_' + arrFontSizes[intFontSizeIndex];
        
    } else {
        objContent = null;
    }
    
	strCustomSize = intFontSizeIndex.toString();
	setCookie('ziCombiganFont', strCustomSize, 364);

}

function getCookie(NameOfCookie){

	if (document.cookie.length > 0){ 

	begin = document.cookie.indexOf(NameOfCookie+"="); 
	if (begin != -1){ 

	begin += NameOfCookie.length+1; 
	end = document.cookie.indexOf(";", begin);
	if (end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(begin, end)); } 
	}
	return ''; 

}

function setCookie(NameOfCookie, value, expiredays){

	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));

	document.cookie = NameOfCookie + "=" + escape(value) + 
	((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}

function delCookie (NameOfCookie){

	if (getCookie(NameOfCookie)) {
	document.cookie = NameOfCookie + "=" +
	"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

function warnMsg(){
     if (confirm("Please be aware that you are leaving the COMBIGAN®  website. Links to all external sites are provided as a resource to our visitors. Allergan accepts no responsibility for the content of these sites. Allergan does not control these sites, and the opinions, claims, or comments expressed on these sites should not be attributed to Allergan."))
     	return true;
     else
        return false;
     
}