/**
 * @author Alexandr Smirnov (Regio)
 */

YAHOO.util.Event.onDOMReady(function() {
	Shadowbox.init({
		// let's skip the automatic setup because we don't have any
		// properly configured link elements on the page
		skipSetup: true
	});
	
	var a = document.getElementsByTagName('a');
	for(var i=0; i<a.length; i++) {
		var r = a[i].rel;
		if (r) {
			var s = (''+r).split('|');
			a[i].href = "javascript:openbox('"+s[0]+"', "+s[1]+")";
		}
	};
});

function openbox(q, z) {
    Shadowbox.open({
        type:       'iframe',
        content:    'http://www2.regio.ee/alex/Blogger/gcAdmin/gcAdmin.html?q=' + (q ? encodeURIComponent(q) : '') + '&z=' + (z ? z : ''),
        height:     560,
        width:      800
    });
}