window.onload=function() { 
	setupSideBar();
	Event.observe(window,'resize',sizeContent);
	sizeContent();
	//alert('height: '+document.viewport.getDimensions().height);
	//synco_initialize();
}

//var curHighlight;

function sizeContent() {
	$('verticalContent').style.height = ( document.viewport.getDimensions().height > 500 ?
										  document.viewport.getDimensions().height - 168 : 332 ) + 'px';
	
    fleXenv.updateScrollBars();
}
function setupSideBar() {
	$('emailEntryText').value = '';
	Element.observe('emailEntryText','keypress', function(event) {
		if(event.keyCode == 13) {
			$('emailEntrySent').style.display = 'inline';
			$('emailEntryText').style.display = 'none';
			DooadadService.addEmail($('emailEntryText').value);
		}
	});
}

function fadeIn(picObj) {
	if(typeof picObj.highlightObj == 'undefined') {
		picObj.highlightObj = picObj.clone();
		picObj.highlightObj.addClassName('highlight');
		picObj.parentNode.appendChild(picObj.highlightObj);
		picObj.highlightObj.style.zIndex = -1;
	}
	picObj.fade({ duration: 0.5, queue: { position: 'end', scope: picObj.id }});
}

function fadeOut(picObj) {
	picObj.appear({ duration: 0.5, queue: { position: 'end', scope: picObj.id }}); 
}

function fnLoadPngs() {
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);

	for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--) {
		if (itsAllGood && img.src.match(/\.png$/i) != null) {
			var src = img.src;
			var div = document.createElement("DIV");
			div.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizing='scale')"
			div.style.width = img.width + "px";
			div.style.height = img.height + "px";
			img.replaceNode(div);
		}
		img.style.visibility = "visible";
	}
}

