/*                                              */
/* $Header: /repository/mhf/www.mhf.at/js/mhf.js,v 1.2 2005/03/20 22:54:31 mhf Exp $ */
/* global javascript for http://mhf.at          */
/* michael h. fischer                           */
/* ============================================ */
/* (c)2k3+                                      */
/* cell: +43 664 1254415                        */
/* fax:  +34 664 1265930                        */
/* icq:  #61578912                              */
/*                                              */
/* vienna university                            */
/* vienna general hospital                      */
/*                                              */
/* web: www.mhf.at                              */
/* wap: wap.mhf.at                              */
/* ============================================ */
/*                                              */

/* ============================================ */
/* open popup */
function InfoWindow()
   {
    InfoWindow =
    window.open("info.html","InfoWindow","toolbar=0,location=0,directories=0,menubar=0,scrollbars=0,resizable=0,width=400px,height=265px,left=70,top=70");
    InfoWindow.focus();
   }

/* ============================================ */
/* set color of form-buttons */
function highlightButton(s) 
   {
    if ("INPUT"==event.srcElement.tagName)
    event.srcElement.className=s
   }

/* ============================================ */
/* keep reloading webcam-images */
function reloadImg()
{
    uniq = new Date();
    uniq = "?"+uniq.getTime();
    newImage = document.all.imgToLoad.src;
    index = newImage.indexOf("?", 0);
    if (index > 0)
    {
        newImage = newImage.substr(0, index);
    }
    document.all.imgToLoad.src = newImage+uniq;
}

/* ============================================ */
/* disable right mouseclick for dummies */
/* function click() 
   {
	if (event.button==2) {
	   alert('did you want to nick code?! well, try again  ;-)')
   }
   }
   document.onmousedown=click
*/

/* ============================================ */
/* restrict and count form-input */
function checkLen(area) {
        var amount = area.value.length;
        if (amount > 110 ) {
                area.value = area.value.substring(0,110);
                free = 0;
        }
        else {
                free = 110 - amount;
        }
        document.forms["msgform"].len.value = free;
}


/* ============================================ */
/* set cookie and cout pagehits on client-side */
expireDate = new Date
expireDate.setMonth(expireDate.getMonth()+6)
		hitCt = eval(cookieVal("pageHit")) 
		hitCt++	
		document.cookie = "pageHit=" + hitCt + ";expires=" + expireDate.toGMTString()

function cookieVal(cookieName) {
	thisCookie = document.cookie.split("; ")
	for (i=0; i<thisCookie.length; i++) {
		if (cookieName == thisCookie[i].split("=")[0]) {
			return thisCookie[i].split("=")[1]	
		}
	}
	return 0
}


/* ============================================ */
/* timer
function tmt_print(bers) {
    function stopError() {
        return true;
    };
    window.onerror = stopError;
    if (window.print) {
        eval(bers + ".print()");
    } else {
        if (document.all) {
            var OLECMDID_PRINT = 6;
            var OLECMDEXECOPT_DONTPROMPTUSER = 2;
            var OLECMDEXECOPT_PROMPTUSER = 1;
            var WebBrowser = "<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>";
            document.body.insertAdjacentHTML("beforeEnd", WebBrowser);
            WebBrowser1.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER);
            WebBrowser1.outerHTML = "";
        }
    }
}

<head>
var system_start_time = new Date()
var start_time = new Date()
var system_time = new Date();

function CalcRemaining(theForm)
{	 var now = new Date();
	 system_time.setTime(system_start_time.getTime()+(now.getTime()-start_time.getTime()));
	 var time = "";
	 var hour = system_time.getHours();
	 if(hour < 10)
		 hour = " " + hour;
		 var min = system_time.getMinutes();
		 if(min < 10)
			min = "0" + min;
			var sec = system_time.getSeconds();
			if(sec < 10)
			       sec = "0" + sec;
			       time= hour + ":" + min + ":" + sec;
			       var datestr = "";
			       var date = system_time.getDate();
			       if(date < 10)
				       date = " " + date;
				       var month = system_time.getMonth()+1;
				       if(month < 10)
						month = "0" + month;
						var year =
						system_time.getYear();
						if(year >= 2000)
							year = year-2000;
							if(year >= 100)
								year =
								year-100;
								if(year < 10)
									year =
									"0" +
									year;
									datestr= year + "/" + month + "/" + date + " " + time;
									theForm.jetzt.value = datestr;

									setTimeout("CalcRemaining(document.clock)",
									250);
}
</head>

<body onLoad=CalcRemaining(document.clock)>
end timer 
*/


/* ============================================ */
/* open popup for icqlite */
function IcqWin() 
{
var leftpos = (screen.availWidth - 200)-40;
resize = (navigator.appName=="Netscape") ? 0 : 1;

window.open("http://lite.icq.com/icqlite/web/0,,,00.html",
"TOFI1","width=177,height=446,top=40,left="+leftpos+",directories=no,location=no,menubar=no,scrollbars=no,status=no,titlebar=no,toolbar=no,resizable="+resize+"");
}


/* ============================================ */
/* ============================================ */
//-->

