function getElementsByClassName(node, classname)
{
    var a = [];
    var re = new RegExp('\\b' + classname + '\\b');
    var els = node.getElementsByTagName("*");
    for(var i=0,j=els.length; i<j; i++)
        if(re.test(els[i].className))a.push(els[i]);
    return a;
}


function shadowText(originalClass, shadowClass) {
		var els = getElementsByClassName(document, originalClass);
		for (i=0;i<els.length;i++) {
			var text = els[i].innerHTML;
			els[i].className = originalClass;
			els[i].innerHTML = text + '<span class="'+shadowClass+'">'+text+'</span>';
		}
}

var opened_div = '';

function showpic(id, onload_id) {
	onload_div = 'ibig' + onload_id;
	closeDiv(onload_div);
	closeDiv(opened_div);
    opened_div = 'ibig' + id;

    var div = document.getElementById(opened_div);
    if ((typeof(div) != 'undefined') && (div != null)) {
        div.style.display = 'block';
    }
}

function closeDiv(id) {
    var div = document.getElementById(id);
    if ((typeof(div) != 'undefined') && (div != null)) {
        div.style.display = 'none';
    }
}

function openpopup(url) {
    popup=window.open(url,"popup","width=200,height=200,top=0,left=0,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no");
    return false;
}

function openPopupGallery(url) {
    var windowTop = 50;
    var windowLeft = 50;
    w = 600;
    h = 600;
    var Options = "width=" + w + ",height=" + h + ",top=" + windowTop + ",left=" + windowLeft + ",resizable=no,scrollbars=no"
    var imageWindow = window.open (url, "imageWin", Options);
    imageWindow.document.close ();
    if (window.focus) imageWindow.focus();
    //return false;
}