function countdown()
{
var montharray = new Array("Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec");
var yr = 2010;
var mo = 12;
var da = 24;
var hr = 0;
var min = 0;
var sec = 0;
var today = new Date();
var todayy = today.getYear();
if (todayy < 1000)
todayy+=1900;
var todaym = today.getMonth();
var todayd = today.getDate();
var todayh = today.getHours();
var todaymin = today.getMinutes();
var todaysec = today.getSeconds();
var todaystring = montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec;
var futurestring = montharray[mo-1] + " " + da + ", " + yr + " " + hr + ":" + min + ":" + sec;
var dd = Date.parse(futurestring)-Date.parse(todaystring);
var dday = Math.floor(dd/(60*60*1000*24)*1);
var dhour = Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1);
var dmin = Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1);
var dsec = Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1);
//if loaded
if (document.getElementById("divCountDown") != null)
{
//if on day of occasion
if(dday<=0 && dhour<=0 && dmin<=0 && dsec<=1 && todayd==da)
{
document.getElementById("divCountDown").innerHTML = "Glædelig Jul!";
}
else if (dday<=-1)
{
document.getElementById("divCountDown").innerHTML = "Glædelig Jul
og godt Nytår!";
}
else
{
document.getElementById("divCountDown").innerHTML = dday+ " dage
" + new String(dhour+100).substr(1,2) + ":" + new String(dmin+100).substr(1,2) + ":" + new String(dsec+100).substr(1,2);
}
}
setTimeout("countdown()",1000);
}
/****************************************************************************
GRUNDVARIABLER
****************************************************************************/
var GemNews = false;
var PopupWin = null;
if (top.location != self.location)
top.location.href = self.location;
/****************************************************************************
EVENTS
****************************************************************************/
//function WinOnLoad()
// {
// scrollInit();
// }
// window.onload = WinOnLoad;
/****************************************************************************
FUNCTIONS
made by Rasmus Handberg
****************************************************************************/
function Get(navn)
{
var DOM = (document.getElementById)?true:false;
var NS4 = (document.layers)?true:false;
var IE4 = (document.all && !DOM)?true:false;
if (DOM)
{
return document.getElementById(navn);
}
if (IE4)
{
return document.all[navn];
}
if (NS4)
{
return document.layers[navn];
}
}
function FrameOver(StrText)
{
window.status = StrText;
return true;
}
function FrameOut()
{
window.status = "";
return true;
}
function handleLogin(form)
{
var StrFejl = "";
var inputPass = form.elements["password"].value;
var inputUser = form.elements["user"].value;
var SHA1Key = "D00LL48METU2AT5763T0TG6CE1MT90FAW9852472WU6O31TN710IN49GGZ1041Y";
if (inputPass == "")
{
StrFejl = "Indtast dit kodeord!";
}
if (inputUser == "")
{
StrFejl = "Indtast dit brugernavn!";
}
if (inputUser == "" && inputPass == "")
{
StrFejl = "Indtast dit brugernavn og kodeord!";
}
if (StrFejl == "")
{
form.elements["EncPass"].value = hex_sha1(SHA1Key + hex_sha1(inputPass));
form.elements["password"].value = "";
form.elements["password"].blur();
return true;
}
else
{
alert(StrFejl);
return false;
}
}
function TargetBlank(URL)
{
window.open(URL);
return false;
}
function ShowNews() {
document.getElementById("News").style.display = (GemNews)?"block":"none";
document.getElementById("NewsKnap").src = "/MakeNewsSession.asp?mode=" + GemNews + "&ran=" + Math.round(Math.random()*10000000);
//document.getElementById("NewsKontakt").style.backgroundImage = (GemNews)?"url('/Billeder/NewsKurveBlue.gif')":"url('/Billeder/NewsKurveWhite.gif')";
document.getElementById("Indhold").style.width = (GemNews)?"705px":"878px";
GemNews = !GemNews;
return false;
}
function isEmail(str)
{
var objRegExp = /^([^\[\]()<>@,;:\\".]+|\""([^"\\\r]|\\.)*\")(\.([^\[\]()<>@,;:\\"".]+|\"([^"\\\r]|\\.)*\"))*@(\[([^\\\[\]\r]|\\.)*\]|[^\[\]()<>@,;:\\".]+)(\.(\[([^\\\[\]\r]|\\.)*\]|[^\[\]()<>@,;:\\".]+))*$/i;
return objRegExp.test(str);
}
function isNumeric(StrText)
{
if (typeof(StrText) == "number")
{
return true;
}
else
{
// NEGATIVE TAL BLIVER FRASORTERET!
// KOMMA-TAL
var objRegExp = /^[0-9]+$/i;
return objRegExp.test(StrText);
}
}
function r(Str,str1,str2)
{
var x = Str.indexOf(str1);
var RepText = Str;
while (x >= 0)
{
RepText = RepText.replace(str1,str2);
x = RepText.indexOf(str1);
}
return RepText;
}
function UnCryptMail(name,domain)
{
var i = 0;
var n = 0;
var NewName = "";
var NewDomain = "";
for(i=0; i=8364) {n = 128;}
NewName += String.fromCharCode(n-2);
}
for(i=0; i=8364) {n = 128;}
NewDomain += String.fromCharCode(n-1);
}
return "mai" + "lto:" + NewName + String.fromCharCode(64) + NewDomain;
}
var ww = 480, wh = 340, leftPos = null, topPos = null;
function popup(URL,w,h)
{
if (PopupWin != null && !PopupWin.closed)
{
PopupWin.close();
}
wh = (document.all)?document.body.clientHeight : window.innerHeight;
ww = (document.all)?document.body.clientWidth : window.innerWidth;
if (top.screen)
{
if (screen.width)
{
leftPos = Math.round((ww-w-10)/2);
topPos = Math.round((wh-h-29)/2);
}
else
{
leftPos = 50;
topPos = 50;
}
}
PopupWin = window.open("/Galleri/Popup.asp?img=" + URL,"HadstenBilleder",'height=' + h + ',width=' + w + ',top=' + topPos + ',left=' + leftPos + '');
}
function ProgressBar(PID)
{
if (navigator.appVersion.indexOf('MSIE') != -1 && navigator.appVersion.substr(navigator.appVersion.indexOf('MSIE')+5,1) > 4)
{
window.showModelessDialog("/Progress.asp?to=10&PID=" + PID + "&b=IE",null,"dialogWidth=375px; dialogHeight:130px; center:yes");
}
else
{
wh = (document.all)?document.body.clientHeight : window.innerHeight;
ww = (document.all)?document.body.clientWidth : window.innerWidth;
if (top.screen)
{
if (screen.width)
{
leftPos = Math.round((ww-370-10)/2);
topPos = Math.round((wh-115-29)/2);
}
else
{
leftPos = 50;
topPos = 50;
}
}
window.open("/Progress.asp?to=10&PID=" + PID + "&b=NN","","width=370,height=115,top=" + topPos + ",left=" + leftPos, true);
}
return true;
}