function ErrorHandler(Nachricht, Datei, Zeile)
{
	var msgstring;
	msgstring= 'Programmfehler aufgetreten!\n' +
			   '\n' + 
			   'Message:     '     + Nachricht + '\n' +
			   'Document:   '      + Datei + '\n' +
			   'Line:            ' + Zeile + '\n' +
			   '\n' + 
			   'Wenn dieser Fehler weiterhin auftritt benachrichtigen sie bitte den Webadministrator \n'+
			   '\n' +
			   'Danke!'
	
	alert(msgstring);
	
	return true;
}
window.onerror=ErrorHandler;
function Error_suppress()
{
	return true;
}

function ReloadContentPane()
{
top.frames['NAVIGATION_INTERNALBORDERS'].frames['NAVIGATION_CONTENT'].document.location.reload();
}
function SetPageTitle(newTitle)
{
	//	parent.document.getElementById("iPageTitle").firstChild.nodeValue = newTitle;
	if (parent!=top)
	{
		parent.document.getElementById("iPageTitle").firstChild.innerText = newTitle;
		document.title="Bushido Villach - " + newTitle;
	}
	//top.document.title="Bushido Villach - " + newTitle;
}

function isValidDate(indate, ErrorMessage)
{
    var re;
    // Rules for the date regular expression:
    // The format of the date is:
    // dd.mm.yyyy
    // Days: Valid between 1 and 31
    // The first digit may either be a 3 followed by a 0 or a 1 
    // or it could be a 0 followed by 1 to 9, or a 1 or 2, 
    // followed by any digit.
    // Then follows a backslash
    // Months: Valid between 1 and 12
    // The month may be a 0 followed by 1 to 9, or a 1 followed by 
    // either a 0, 1 or 2. 
    // Then follows a backslash
    // The year must comprise of any 4 digits.
    re = /^(3[01]|0[1-9]|[12]\d).(0[1-9]|1[012]).\d{4}/;
    if (re.test(indate.value) == true)
    {
        return true;
    }
    else
    {
        alert(ErrorMessage);
        indate.focus();
        indate.select();
        return false;
    }
}

/*####################################################
########################MOUSE#########################
####################################################*/

//Disable Right Mouse button
function notify(e)
{
	c = (e) ? e.which : window.event.button
	isMac = (navigator.userAgent.indexOf("Mac")>0) ? true : false
	return !((isMac && c==1) || c==2 || c==3)
}

document.onmousedown = notify
document.onmouseup = notify
document.oncontextmenu = new Function("return false")

/*####################################################
###########FAVORITEN UND STARTSEITE###################
####################################################*/

var BUSHIDO_URL="http://www.bushido-villach.at"

function ieOnly()
{
	alert('Diese Funktionalität steht leider nur Benutzern des Microsoft Internet Explorers ab Version 5 zur Verfügung!');
}

function setStartPage()
{
	if (window.external)
	{	
		var url=BUSHIDO_URL;
		var title="Bushido Villach Homepage";
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(url);
	}
	else
		ieOnly();
}

function doBookmark()
{
	if (window.external)
	{	
		var url=BUSHIDO_URL;
		var title="Bushido Villach Homepage";
		window.external.AddFavorite(url,title);
	}
	else
		ieOnly();
}

/*####################################################
####################FRAMESET SICHERN##################
####################################################*/

function ensureFrameset()
{
	if  (this==top || !top.framesetcontroller)
	{
	//alert(escape(document.location.href));
		document.location.href='../'; //?content_url=' + escape(document.location.href);
	}
}

/*####################################################
####################STATUSBAR#########################
####################################################*/
//Default Statusbar Message
var statusvar;

function RefreshStatus()
{
	//if (window.status != statusvar)
	//	window.status=statusvar;
	//	setTimeout('RefreshStatus()', 2000);
}

function SetStdStatus()
{
	statusvar=":::::::::: Bushido Villach - Karate, Qigong, Taijiquan ::::::::::";
	self.defaultStatus=statusvar;
	self.status=statusvar;
}

function SetStatus(state)
{
	statusvar=self.status=state;
	return true;
}	

if (self==top) // nur bei einem Fenster starten
{
SetStdStatus();
RefreshStatus();
}
