﻿function closePanes(pane) {
    var acc = $find(pane+'_AccordionExtender');
    acc.set_SelectedIndex(-1);
}

function rateThis(ID) {
    var acc = $find('ctl00_mainPage_accProduct_AccordionExtender');
    //var acc = $find('ctl00_mainPage_accProduct');
    acc.set_SelectedIndex(ID);
}
    
function setPosUpdateProgressDiv() {
    // get the update progress div
    var updateProgressDiv = $get('updateProgressDiv'); 

    //  get the body element        
    var pbody = $get('ctl00_bdy');
    
    // get the bounds of both the gridview and the progress div
    var bodyBounds = Sys.UI.DomElement.getBounds(pbody);
    var updateProgressDivBounds = Sys.UI.DomElement.getBounds(updateProgressDiv);
    
    //  do the math to figure out where to position the element (the center of the gridview)
    var x = bodyBounds.x + Math.round(bodyBounds.width / 2) - Math.round(updateProgressDivBounds.width / 2);
    //var y = gridViewBounds.y + Math.round(gridViewBounds.height / 2) - Math.round(updateProgressDivBounds.height / 2);
    var y = 300;
    
    //  set the progress element to this position
    Sys.UI.DomElement.setLocation (updateProgressDiv, x, y);
}

function onUpdating(){
    // get the update progress div
    var updateProgressDiv = $get('updateProgressDiv'); 
    // make it visible
    updateProgressDiv.style.display = 'block';
}

function onUpdated() {
    // get the update progress div
    var updateProgressDiv = $get('updateProgressDiv'); 
    // make it invisible
    updateProgressDiv.style.display = 'none';
}

function searchNextPrew(limit) {
    var hidLimit = $get('ctl00_mainPage_hidLimit');
    hidLimit.value = limit;
    scroll(0,0);
    closePanes('ctl00_mainPage_AccordionSearch');
    __doPostBack('ctl00_mainPage_ctl03_btnSearch','');
}

function applySearchElement(element, newvalue, txtvalue) {
    var controlHid = $get('ctl00_mainPage__content_acc'+element+'Pane_header_searchElement'+element+'Hid');
    var controlSelected = $get('ctl00_mainPage__content_acc'+element+'Pane_header_searchElement'+element+'Selected');
    controlHid.value = newvalue;
    controlSelected.value = txtvalue;
    //closePanes('ctl00_mainPage_ctl03_AccordionSearchElement');
    closePanes('ctl00_mainPage__content_AccordionSearchElement');
}

function changeSize(size) {
    var newSize = "12px";
    if (size == 'small')
        newSize = "12px";
    else if (size == 'medium')
        newSize = "13px";
    else if (size == 'large')
        newSize = "14px";
    
	document.getElementById('ctl00_bdy').style.fontSize=newSize;
	createCookie('fontsize', size, 365);
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		expires = "; expires="+date.toGMTString();
	}
	else expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function getCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
    return "na";
}

function applyAllEvents() {
    applyEvent("fszsmall", "changeSize('small')", "onclick");
    applyEvent("fszmedium", "changeSize('medium')", "onclick");
    applyEvent("fszlarge", "changeSize('large')", "onclick");
    applyEvent("btnMainSearch", "setmainsearch()", "onclick");
    setNewAttribute("ctl00_txtSearchfield", "onKeyPress", "searchClick('btnMainSearch',event)");
    setNewAttribute("ctl00_txtSearchfield", "autocomplete", "off");
    setPosUpdateProgressDiv();
}

function applySearchEvent() {
    setNewAttribute("ctl00_mainPage__content_txtSearch", "onKeyPress", "searchClick('ctl00_mainPage__content_btnSearch',event)");
}

function applyEvent(tagid, fcn, evnt){
	if(document.getElementById && document.getElementsByTagName){
		var oTag, oEvent;
    	oTag = document.getElementById(tagid);
	    if (evnt == "onclick") {
		    oTag.onclick = function(oEvent){
		        oEvent = (typeof oEvent != "undefined")? oEvent : event;
			    oEvent.returnValue = false;
			    if(oEvent.preventDefault){
				    oEvent.preventDefault();
			    }
		        eval(fcn);
		    };
		}
	    if (evnt == "onmouseover") {
		    oTag.onmouseover = function(oEvent){
		        oEvent = (typeof oEvent != "undefined")? oEvent : event;
			    oEvent.returnValue = false;
			    if(oEvent.preventDefault){
				    oEvent.preventDefault();
			    }
		        eval(fcn);
		    };
		}
	    if (evnt == "onmouseout") {
		    oTag.onmouseout = function(oEvent){
		        oEvent = (typeof oEvent != "undefined")? oEvent : event;
			    oEvent.returnValue = false;
			    if(oEvent.preventDefault){
				    oEvent.preventDefault();
			    }
		        eval(fcn);
		    };
		}
		if (evnt == "onkeypress") {
		    oTag.onkeypress = function(oEvent) {
		        oEvent = (typeof oEvent != "undefined") ? oEvent : event;
		        oEvent.returnValue = false;
		        if (oEvent.preventDefault) {
		            oEvent.preventDefault();
		        }
		        eval(fcn);
		    };
		}
	}
}

function setNewAttribute(id, attribute, value) {
    document.getElementById(id).setAttribute(attribute, value)
}

function calendarClose() {
    window.opener.location = "../default.aspx";
	window.close();
}

function parentCalendarGoTo(ID) {
	location.href = "calendarevent.aspx?eventID="+ID;
}

function calendaropen() {
	var win;
	var h, w, x, y, leftPos, toppos;
	w = 800;
	h = 600;
	if (screen.width > w)
	    leftPos = (screen.width - w) / 2;
	else
	    leftPos = (w - screen.width) / 2;
	    
	if (screen.height > h)
	    toppos = (screen.height - h) / 2;
	else
	    toppos = (h - screen.height) / 2;

    var attr = "toolbar=no,status=no,location=no,scrollbars=yes,width="+w+",height="+h+",left="+leftPos+",top="+toppos+",resizable=yes";
	win=window.open("calendar/calendar.aspx", win, attr);
	win.focus();
}

function winopen(url, width, height) {
    var win;
    var h, w, x, y, leftPos, toppos;
    if (width == null)
        width = 0;

    if (height == null)
        height = 0;
        
    if (width > 0 && height > 0) {
        w = width;
        h = height;
    }
    else {
        w = 950;
        h = 700;
    }
    if (screen.width > w)
        leftPos = (screen.width - w) / 2;
    else
        leftPos = (w - screen.width) / 2;

    if (screen.height > h)
        toppos = (screen.height - h) / 2;
    else
        toppos = (h - screen.height) / 2;

    var attr = "toolbar=no,status=no,location=no,scrollbars=yes,width=" + w + ",height=" + h + ",left=" + leftPos + ",top=" + toppos + ",resizable=yes";
    win = window.open(url, win, attr);
    win.focus();
}

function txtinsert(action, txtarea) {
    if (document.getElementById(txtarea).disabled == false) {
        var newelement;
        switch (action) {
            case "bold":
                newelement = "[b][/b]";
                break;
            case "italic":
                newelement = "[i][/i]";
                break;
            case "underscore":
                newelement = "[u][/u]";
                break;
            case "quote":
                newelement = "[q][/q]";
                break;
            case "smile":
                newelement = "[:-)]";
                break;
            case "wink":
                newelement = "[;-)]";
                break;
            case "biggrin":
                newelement = "[:D]";
                break;
            case "cool":
                newelement = "[8-)]";
                break;
            case "tongue":
                newelement = "[:P]";
                break;
            case "oh":
                newelement = "[:o]";
                break;
            case "frown":
                newelement = "[:-(]";
                break;
            case "angry":
                newelement = "[:-[]";
                break;
            case "devil":
                newelement = "[:-]]";
                break;
            default:
                newelement = "";
                break;
        }
        document.getElementById(txtarea).value = document.getElementById(txtarea).value + newelement;
        document.getElementById(txtarea).focus();
    }
}

function answerDebate(ID) {
    document.getElementById("debate"+ID).style.display="block";
    document.getElementById("answerDebate"+ID).style.display="none";
    document.getElementById("noanswerDebate"+ID).style.display="block";
    document.getElementById("icons"+ID).style.display="block";
}

function noanswerDebate(ID) {
    document.getElementById("answerDebate"+ID).style.display="block";
    document.getElementById("noanswerDebate"+ID).style.display="none";
    document.getElementById("debate"+ID).style.display="none";
    document.getElementById("icons"+ID).style.display="none";
}

function multiValidate(field, fieldName, felttype, obligatorisk, minlength, maxlength, minvalue, maxvalue, lang) {
    if (field == null) {
        alert("multiValidate: '" + fieldName + "' er null");
        returnvalue = false;
    }
    else {
        var thisValue = field.value;
        var errText = "";
        var returnvalue = true;
        var validated = validateField(thisValue, felttype, obligatorisk, minlength, maxlength, minvalue, maxvalue);
        var theForm = document.forms['aspnetForm'];
        if (!theForm) {
            theForm = document.aspnetForm;
        }

        if (lang == "da") {
            switch (validated) {
                case 1: 
                    errText = "Feltet '"+fieldName+"' skal udfyldes!";
                    break;
                case 2: 
                    errText = "Feltet '"+fieldName+"' indeholder for få tegn!";
                    break;
                case 3: 
                    errText = "Feltet '"+fieldName+"' indeholder for mange tegn!";
                    break;
                case 4:
                    errText = "Feltet '"+fieldName+"' indeholder forkerte tegn!";
                    break;
                case 5: 
                    errText = "Feltet '"+fieldName+"' skal mindst være "+minvalue+"!";
                    break;
                case 6: 
                    errText = "Feltet '"+fieldName+"' må højest være "+maxvalue+"!";
                    break;
                case 9: 
                    errText = "Feltet '"+fieldName+"' er ikke korrekt!";
                    break;
                //case 15: 
                    //errText = "XXX!";
                    //break;
                default : errText = "";
            }
        }
        else {
            switch (validated) {
                case 1: 
                    errText = "The field '"+fieldName+"' can not be empty!";
                    break;
                case 2: 
                    errText = "The field '"+fieldName+"' contains too few characters!";
                    break;
                case 3: 
                    errText = "The field '"+fieldName+"' contains too many characters!";
                    break;
                case 4:
                    errText = "The field '"+fieldName+"' contains incorrect characters!";
                    break;
                case 5: 
                    errText = "The field '"+fieldName+"' must at least be "+minvalue+"!";
                    break;
                case 6: 
                    errText = "The field '"+fieldName+"' must be no moore than "+maxvalue+"!";
                    break;
                case 9: 
                    errText = "The field '"+fieldName+"' is incorrect!";
                    break;
                //case 15: 
                    //errText = "XXX!";
                    //break;
                default : errText = "";
            }
        }

        if (validated == 0)
        {
            //Den skal ændres tilbage fra rød hvis den er blevet rettet til en gyldig value
            field.style.borderColor="#000000";
            returnvalue = true;
        }
        else
        {
            //Der skal forsinkelse på, da onchange først trigges efter næste felt har fået focus!
            
            //validator sætter focus på kontrollen, hvilket kan give fejl med et hiddenfield (tags)
            
            //setTimeout("document.aspnetForm."+field.name+".focus()",1);
            field.style.borderColor="#993300";
            field.focus();
            alert(errText);
            returnvalue = false;
        }
    }
    return returnvalue;
}

function validateField(thisValue, felttype, obligatorisk, minlength, maxlength, minvalue, maxvalue)
{
    //a;b;c;d;e;f;g
    //a = element
    //b = felttype
    //c = * for obligatorisk
    //d = min længde
    //e = max længde (0 for ubegrænset)
    //f = min værdi
    //g = max værdi (0 for ubegrænset)
    //felttyper:
    //1 = text
    //2 = heltal
    //3 = kommatal
    //4 = checkbox
    //5 = dropdown
    //6 = multidropdown
    //7 = radiogruppe
    //8 = Datofelt
    //9 = email
    var errorcode = 0;
    //errorcode:
    //1 = feltet er ikke udfyldt
    //2 = feltet indeholder for få tegn
    //3 = feltet indeholder for mange tegn
    //4 = feltet indeholder forkerte tegn
    //5 = talværdien er for lille
    //6 = talværdien er for stor
    //7 = radiogruppe
    //8 = Datofelt
    //9 = email
       
    switch (felttype) {
        case 1: 
            if (obligatorisk == "*" && replaceChars(thisValue, " ", "") == "")
            {
                errorcode = 1;
                //alert("test 1");
            }
            else
            {
                if (thisValue.length<minlength && thisValue.length>0)
                {
                    errorcode = 2;
                    //alert("test 2");
                }
                else
                {
                    if (thisValue.length>maxlength && thisValue.length>0 && maxlength>0)
                    {
                        errorcode = 3;
                        //alert("test 3");
                    }
                }
            }
            break;
        case 2: 
            if (obligatorisk == "*" && replaceChars(thisValue, " ", "") == "")
            {
                errorcode = 1;
            }
            else
            {
                if (thisValue.length<minlength && thisValue.length>0)
                    errorcode = 2;
                else
                {
                    if (thisValue.length>maxlength && thisValue.length>0 && maxlength>0)
                        errorcode = 3;
                    else
                    {
                        if (thisValue.replace(",",".")<minvalue)
                            errorcode = 5;
                        else
                        {
                            if (thisValue.replace(",",".")>maxvalue && maxvalue>0)
                                errorcode = 6;
                            else
                            {
                                if (checktal(thisValue,thisValue.length))
                                    errorcode = 4;
                            }
                        }
                    }
                }
            }
            break;
        case 3: 
            if (obligatorisk == "*" && replaceChars(thisValue, " ", "") == "")
            {
                errorcode = 1;
            }
            else
            {
                if (thisValue.length<minlength && thisValue.length>0)
                    errorcode = 2;
                else
                {
                    if (thisValue.length>maxlength && thisValue.length>0 && maxlength>0)
                        errorcode = 3;
                    else
                    {
                        if (thisValue.replace(",",".")<minvalue)
                            errorcode = 5;
                        else
                        {
                            if (thisValue.replace(",",".")>maxvalue && maxvalue>0)
                                errorcode = 6;
                            else
                            {
                                if (checkpris(thisValue,thisValue.length))
                                    errorcode = 4;
                            }
                        }
                    }
                }
            }
            break;
        case 5: 
            if (obligatorisk == "*" && thisValue == "-1")
            {
                errorcode = 1;
            }
            break;
        case 9: 
            if (obligatorisk == "*" && replaceChars(thisValue, " ", "") == "")
            {
                errorcode = 1;
            }
            else
            {
                if (!emailCheck(thisValue))
                    errorcode = 9;
            }
            break;
        default : errorcode = 0;
    }

    return errorcode;
}

function emailCheck(emailStr) {

    /* 
    http://javascript.internet.com/forms/email-address-validation.html
    The following variable tells the rest of the function whether or not
    to verify that the address ends in a two-letter country or well-known
    TLD.  1 means check it, 0 means don't. */

    var checkTLD=1;

    /* The following is the list of known TLDs that an e-mail address must end with. */

    var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

    /* The following pattern is used to check if the entered e-mail address
    fits the user@domain format.  It also is used to separate the username
    from the domain. */

    var emailPat=/^(.+)@(.+)$/;

    /* The following string represents the pattern for matching all special
    characters.  We don't want to allow special characters in the address. 
    These characters include ( ) < > @ , ; : \ " . [ ] */

    var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

    /* The following string represents the range of characters allowed in a 
    username or domainname.  It really states which chars aren't allowed.*/

    var validChars="\[^\\s" + specialChars + "\]";

    /* The following pattern applies if the "user" is a quoted string (in
    which case, there are no rules about which characters are allowed
    and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
    is a legal e-mail address. */

    var quotedUser="(\"[^\"]*\")";

    /* The following pattern applies for domains that are IP addresses,
    rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
    e-mail address. NOTE: The square brackets are required. */

    var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

    /* The following string represents an atom (basically a series of non-special characters.) */

    var atom=validChars + '+';

    /* The following string represents one word in the typical username.
    For example, in john.doe@somewhere.com, john and doe are words.
    Basically, a word is either an atom or quoted string. */

    var word="(" + atom + "|" + quotedUser + ")";

    // The following pattern describes the structure of the user

    var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

    /* The following pattern describes the structure of a normal symbolic
    domain, as opposed to ipDomainPat, shown above. */

    var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

    /* Finally, let's start trying to figure out if the supplied address is valid. */

    /* Begin with the coarse pattern to simply break up user@domain into
    different pieces that are easy to analyze. */

    var matchArray=emailStr.match(emailPat);

    if (matchArray==null) {

    /* Too many/few @'s or something; basically, this address doesn't
    even fit the general mould of a valid e-mail address. */

    //alert("Email address seems incorrect (check @ and .'s)");
    return false;
    }
    var user=matchArray[1];
    var domain=matchArray[2];

    // Start by checking that only basic ASCII characters are in the strings (0-127).

    for (i=0; i<user.length; i++) {
    if (user.charCodeAt(i)>127) {
    //alert("Ths username contains invalid characters.");
    return false;
       }
    }
    for (i=0; i<domain.length; i++) {
    if (domain.charCodeAt(i)>127) {
    //alert("Ths domain name contains invalid characters.");
    return false;
       }
    }

    // See if "user" is valid 

    if (user.match(userPat)==null) {

    // user is not valid

    //alert("The username doesn't seem to be valid.");
    return false;
    }

    /* if the e-mail address is at an IP address (as opposed to a symbolic
    host name) make sure the IP address is valid. */

    var IPArray=domain.match(ipDomainPat);
    if (IPArray!=null) {

    // this is an IP address

    for (var i=1;i<=4;i++) {
    if (IPArray[i]>255) {
    //alert("Destination IP address is invalid!");
    return false;
       }
    }
    return true;
    }

    // Domain is symbolic name.  Check if it's valid.
     
    var atomPat=new RegExp("^" + atom + "$");
    var domArr=domain.split(".");
    var len=domArr.length;
    for (i=0;i<len;i++) {
    if (domArr[i].search(atomPat)==-1) {
    //alert("The domain name does not seem to be valid.");
    return false;
       }
    }

    /* domain name seems valid, but now make sure that it ends in a
    known top-level domain (like com, edu, gov) or a two-letter word,
    representing country (uk, nl), and that there's a hostname preceding 
    the domain or country. */

    if (checkTLD && domArr[domArr.length-1].length!=2 && 
    domArr[domArr.length-1].search(knownDomsPat)==-1) {
    //alert("The address must end in a well-known domain or two letter " + "country.");
    return false;
    }

    // Make sure there's a host name preceding the domain.

    if (len<2) {
    //alert("This address is missing a hostname!");
    return false;
    }

    // If we've gotten this far, everything's valid!
    return true;
}


function replaceChars(entry, out, add) {
    temp = "" + entry; // temporary holder
    while (temp.indexOf(out)>-1) {
        pos= temp.indexOf(out);
        temp = "" + (temp.substring(0, pos) + add + 
        temp.substring((pos + out.length), temp.length));
    }
    return temp;
}

function checktal(tal, tallen) {
	var i, x, retur, tegn, y;
	x = tal;
	y = tallen-1;
	for (i=0; i<=y; i++) {
		tegn = x.charCodeAt(i);
		if ( (tegn >= "0".charCodeAt(0)) && (tegn <= "9".charCodeAt(0)) ) {
			retur = false;
		}
		else {
			retur = true;
			break;
		}
	}
	return retur;
}

function checkpris(tal, tallen) {
	var i, x, retur, tegn, y, komma, pris;
	x = tal;
	y = tallen-1;
	komma = 0;
	for (i=0; i<=y; i++) {
		tegn = x.charCodeAt(i);
		if ( (tegn >= "0".charCodeAt(0)) && (tegn <= "9".charCodeAt(0)) || (tegn >= ",".charCodeAt(0)) && (tegn <= ",".charCodeAt(0)) ) {
			retur = false;
			if ((tegn >= ",".charCodeAt(0)) && (tegn <= ",".charCodeAt(0))) {
				komma++;
			}
			if (komma > 1) {
				retur = true;
				break;
			}
		}
		else {
			retur = true;
			//alert(retur+" "+tegn+" "+i)
			break;
		}
	}
	return retur;
}

function setSender() {
    document.aspnetForm.sender.value = "send";
}

function searchClick(buttonName, e) {
    //the purpose of this function is to allow the enter key to 
    //point to the correct button to click.
    var key;
    if (window.event)
        key = window.event.keyCode;     //IE
    else
        key = e.which;     //firefox

    if (key == 13) {
        //Get the button the user wants to have clicked
        var btn = document.getElementById(buttonName);
        if (btn != null) { //If we find the button click it
            btn.click();
            event.keyCode = 0
        }
    }
}

function setmainsearch() {
    document.aspnetForm.mainsearch.value = "search";
    onUpdating();
    document.aspnetForm.submit();
}

function goToUrl(url) {
    //alert(url);
    document.location = url;
}

function bye() {
    window.location = "http://www.altomalkohol.dk";
}

function bye2() {
    window.location = "http://www.drinkaware.co.uk";
}

function underage() {
    if (getCookie("ctl00_underage") != "ctl00_underage") {
        showPanel("ctl00_underage");
        setMiddle("ctl00_underage");
    }
}

function showPanel(pname) {
    selects = document.getElementsByTagName("object");
    for (i = 0; i != selects.length; i++) {
        selects[i].style.display = "none";
    }
    selects = document.getElementsByTagName("embed");
    for (i = 0; i != selects.length; i++) {
        selects[i].style.display = "none";
    }
    selects = document.getElementsByTagName("iframe");
    for (i = 0; i != selects.length; i++) {
        selects[i].style.display = "none";
    }

    document.getElementById("dimmer").style.display = "block";
    document.getElementById("dimmer").style.height = document.body.offsetHeight + "px";
    document.getElementById(pname).style.display = "block";
}

function hidePanel(pname) {
    selects = document.getElementsByTagName("object");
    for (i = 0; i != selects.length; i++) {
        selects[i].style.display = "block";
    }
    selects = document.getElementsByTagName("embed");
    for (i = 0; i != selects.length; i++) {
        selects[i].style.display = "block";
    }
    selects = document.getElementsByTagName("iframe");
    for (i = 0; i != selects.length; i++) {
        selects[i].style.display = "block";
    }
    document.getElementById("dimmer").style.display = "none";
    document.getElementById(pname).style.display = "none";
    createCookie(pname, pname, 7);
}

function setMiddle(theObject) {

    var currentObject = document.getElementById(theObject);

    var locWinY = document.documentElement.scrollTop;
    var dimWinY;
    if (window.innerHeight)
        dimWinY = window.innerHeight;
    else
        dimWinY = document.documentElement.clientHeight;

    var winY = (dimWinY / 2) + locWinY - (currentObject.offsetHeight / 2);

    var dimWinX;
    if (window.innerWidth)
        dimWinX = window.innerWidth;
    else
        dimWinX = document.documentElement.clientWidth;

    var winX = (dimWinX / 2) - (currentObject.offsetWidth / 2);

    currentObject.style.top = winY.toString() + 'px';
    currentObject.style.left = winX.toString() + 'px';
}

function showMsg(header, msg) {
    selects = document.getElementsByTagName("object");
    for (i = 0; i != selects.length; i++) {
        selects[i].style.display = "none";
    }
    selects = document.getElementsByTagName("embed");
    for (i = 0; i != selects.length; i++) {
        selects[i].style.display = "none";
    }
    selects = document.getElementsByTagName("iframe");
    for (i = 0; i != selects.length; i++) {
        selects[i].style.display = "none";
    }

    document.getElementById("dimmer").style.display = "block";
    document.getElementById("dimmer").style.height = document.body.offsetHeight + "px";
    document.getElementById("InfoPopunder").style.display = "block";
    document.getElementById("InfoPopunderHeader").innerHTML = header;
    document.getElementById("InfoPopunderInner").innerHTML = msg;
}

function hideMsg() {
    selects = document.getElementsByTagName("object");
    for (i = 0; i != selects.length; i++) {
        selects[i].style.display = "block";
    }
    selects = document.getElementsByTagName("embed");
    for (i = 0; i != selects.length; i++) {
        selects[i].style.display = "block";
    }
    selects = document.getElementsByTagName("iframe");
    for (i = 0; i != selects.length; i++) {
        selects[i].style.display = "block";
    }
    document.getElementById("dimmer").style.display = "none";
    document.getElementById("InfoPopunder").style.display = "none";
    document.getElementById("InfoPopunderHeader").innerText = "";
    document.getElementById("InfoPopunderInner").innerText = "";
}