// Alternating list items background
function alternatecolor(id)
{
    if (document.getElementsByTagName)
    {  
       var maindiv = document.getElementById(id);

       if (maindiv != null) {
           var ul = maindiv.getElementsByTagName('ul');
           for (i = 0; i < ul.length; i++) {
               var u = ul[i]
               var li = u.getElementsByTagName('li');
               for (ii = 0; ii < li.length; ii++) {
                   if (ii % 2 == 0) { li[ii].className = 'li-one'; }
                   else { li[ii].className = 'li-two'; }

                   if (ii == 0) { li[ii].className += ' topli'; }

                   if (ii == li.length - 1) { li[ii].className += ' bottomli'; }
               }
           }
       }
    }
}

// Toggle Lists on Tips Page
function toggleTips(id){
	var div1 = document.getElementById(id)
	if (!div1) return
	if (div1.style.display == 'none' || !div1.style.display) {
		div1.style.display = 'block'
	} else {
		div1.style.display = 'none'
	}
}

// Change Background Color of H4s
function toggleBgColor( elem )
{
	if (!elem) return
    elem.className = elem.className? '':'h4active';
	//var style2 = elem.style;
    //style2.backgroundColor = style2.backgroundColor? "":"#bcdaf2";
}

function MM_openBrWindow_(theURL, winName, features) { //v2.0
    var w = window.open(theURL, winName, features);
    w.focus();
    return false;
}

function openPrintISI() {
    MM_openBrWindow_(applicationRoot + '/Utility/PrintISI.aspx', 'ISI', 'scrollbars=yes,resizable=no,width=625,height=500');
}

function openShare() {
    MM_openBrWindow_(applicationRoot + '/Utility/Share.aspx?url=' + escape(window.location.href), 'Share', 'scrollbars=no,resizable=no,width=660,height=410');
}

function openPrintCoupon() {
    MM_openBrWindow_(applicationRoot + '/Membership/Coupon.aspx', 'Share', 'scrollbars=yes,resizable=yes,width=800,height=700');
}

function openDisclaimer(url) {
    MM_openBrWindow_(applicationRoot + '/Utility/Leaving.aspx?url=' + url, 'winDisclaimer', 'scrollbars=no,resizable=no,width=370,height=350');
}

function goToRequested(url) {
    window.open(url, "_newWin", 'toolbar,menubar,scrollbars,resizable,location');
    window.close();
}

function openSafetyInfo() {
    MM_openBrWindow_(applicationRoot + '/Utility/SafetyInformation.aspx', 'w', 'scrollbars=yes,resizable=no,width=620,height=516');
}

function openTranscriptUYT() {
    MM_openBrWindow_(applicationRoot + '/Prescription/UnderstandingTranscript.aspx', 'w', 'scrollbars=yes,resizable=no,width=820,height=600');
}
function openTranscriptTV() {
    MM_openBrWindow_(applicationRoot + '/TalkVideos/Transcript.aspx', 'w', 'scrollbars=yes,resizable=no,width=820,height=600');
}
function openGSSUseTV() {
    MM_openBrWindow_(applicationRoot + '/TalkVideos/GSSUse.aspx', 'w', 'scrollbars=yes,resizable=no,width=820,height=575');
}

function openEndoDisclaimer() {
    MM_openBrWindow_(applicationRoot + '/ThyroidDoctor/Disclaimer.aspx', 'w', 'scrollbars=yes,resizable=no,width=820,height=532');
}
function openLauraVideo() {
    MM_openBrWindow_(applicationRoot + '/Landing/Laura.aspx', 'w', 'scrollbars=yes,resizable=no,width=820,height=575');
}
