/* GENERAL FUNCTIONS - START */

function showPic(image) { 	
	try { 
		win.close(); 
	} catch(e){ 
		// nothing 
	}
	win = window.open("http://static.blogsoft.org/blogsoft/image_zoom.html?img=" + image,'image','status=yes,toolbar=yes,menubar=yes,location=no');	
	win.focus();
}

/* CALENDAR FUNCTIONS - START */

function checkIt(s) {
	place = detect.indexOf(s) + 1;
	thestring = s;
	return place;
}

function wrapIt(s) {
	re=/;/g
	return s.replace(re, "; ")
}

var detect = navigator.userAgent.toLowerCase();
var OS, browser, version, thestring, place;

if (checkIt('konqueror')) {
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari";
else if (checkIt('omniweb')) browser = "OmniWeb";
else if (checkIt('k-meleon')) {
	browser = "K-Meleon";
	var rv = detect.match(/k-meleon ([\w.]+)/);

	if (rv) {
		rv = rv[0];
		version = rv.substr(3);
	}
}
else if (checkIt('opera')) browser = "Opera";
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer";
else if (checkIt('moz')) browser = "Firefox";   //added 26.09.06
else if (!checkIt('compatible')) {
	browser = "Netscape Navigator"
	version = detect.charAt(8);

	if (typeof(navigator.product) != "undefined") {
		browser = "Mozilla";
		rv = navigator.userAgent.match(/([Mozilla ]?Fire\w+)\/([\w|\+.]+)/);
		
		if (rv) {
			browser = rv[1];
			version = rv[2];
		}
		else {
			rv = navigator.userAgent.match(/rv:([\w|\+.]+)/);

			if (rv) {
				rv = rv[0];
				version = rv.substr(3);
			}
		}
	}
}
else browser = "An unknown browser";

if (!version) {
	version = detect.charAt(place + thestring.length);
}

var browsername = "";

if (browser)
	browsername += browser;

if (version)
	browsername += " " + version;


// Default displaytype
var displayType = "block";

if (browser == "Internet Explorer")
	displayType = "block";
else if(browser == "Opera")
	displayType = "table-row";
else if(browser == "Firefox")		//added 26.09.06
	displayType = "table-row";		//added 26.09.06 - block doesn't work with firefox

function toggleDay(dayFieldId, entryBoxId) {
	if (document.getElementById) {

		// Day cell (td)
		dayField = document.getElementById(dayFieldId);
		
		// Assign span that hold the entries
		entryBox = document.getElementById(entryBoxId);
		
		if (entryBox.style.display == displayType) {
			entryBox.style.display = "none";
			dayField.className = "cssDayMouseOut";
		} 
		else {
			// Show content
			entryBox.style.display = displayType;
			dayField.className = "cssDayMouseOver";
		}
	}
}

function dayMouseOver(dayFieldId, entryBoxId, style) {
	if(document.getElementById) {

		dayField = document.getElementById(dayFieldId);
		entryBox = document.getElementById(entryBoxId);

		if(entryBox.style.display != displayType) {
			switchStyle(dayFieldId, style);
		}
	}
}

function dayMouseOut(dayFieldId, entryBoxId, style) {
	if(document.getElementById) {

		dayField = document.getElementById(dayFieldId);
		entryBox = document.getElementById(entryBoxId);

		if(entryBox.style.display != displayType) {
			switchStyle(dayFieldId, style);
		}
	}
}

function switchStyle(targetId, style) {
	if(document.getElementById) {
		target = document.getElementById(targetId);
		target.className = style;
	}
}

/* CALENDAR FUNCTIONS - END */

// Remove borders on images with class "image" or "thumbnail" - DISABLED
//window.onload = function () {
//	if(document.getElementsByTagName) {
//		obj = document.getElementsByTagName("img");
//		for (var i = 0; i < obj.length; i++) {
//	   	if(obj[i].className == "thumbnail" || obj[i].className == "image") {
//				obj[i].setAttribute("style","border:0");
//			}
//		} 
//	}
//}

