function showphoto(photo, w, h) {
	image_window = open('', '', 'width='+w+',height='+h+',scrollbars=no');
	image_window.document.write('<body style="margin:0px;"><img src="format.picture.php?file='+photo+'" style="position=absolute;left=0px;top=0px;"></body>');
	image_window.document.close();
}

function open_browse() {
	upload_window = open('browse.php', 'browse', 'width=450,height=400,scrollbars=yes');
}

function highlight_off() {
	document.getElementById(elementId).style.backgroundColor=keep_style;
}

function highlight_on() {
	alert(this);
	this.style.backgroundColor='#ccff66';
}

function increase_hits(bit_id) {
	window.location.href="http://home.netscape.com/"
	window.location="http://home.netscape.com/"
	alert('increase # of hits for bit #'+bit_id);
}

function create_link(default_link) {
	create_link_window = open('create.link.php?default_link='+default_link, 'create link', 'width=300,height=100,scrollbars=no');
}

function setDimentions(margin) {
	// detect browser:
	var ua = navigator.appName;
	var isFirefox = ( ua != null && (ua.indexOf( "Netscape" ) || ua.indexOf( "Firefox" )) != -1 );
	var isMSIE = ( ua != null && ua.indexOf( "Explorer" ) != -1 );

	var MainFrame = document.getElementById? document.getElementById('whitecenter'): document.all? document.all['whitecenter']: null;
	if (MainFrame) {
		// set horizontal margins:
		MainFrame.style.left = margin + "px";
		MainFrame.style.right = margin + "px";
		
		// set vertical margins:
		window_height = 0;
		if (window.innerHeight) window_height = window.innerHeight - 18;
		else if (document.documentElement && document.documentElement.clientHeight) 
			window_height = document.documentElement.clientHeight;
		else if (document.body && document.body.clientHeight) 
			window_height = document.body.clientHeight;
		MainFrame.style.height = (window_height - 2 * margin) + "px";
		if(isMSIE) MainFrame.style.width = ( MainFrame.document.documentElement.clientWidth - 140 ) + "px";
		MainFrame.style.marginTop = Math.round( (window_height - parseInt(MainFrame.style.height) )/2 - (isMSIE ? 10 : 0)) + "px";
		
		// set height for content
		document.getElementById('page_content').style.height = (window_height - 2 * margin - document.getElementById('page_menu').offsetHeight - document.getElementById('page_title').offsetHeight - 20 ) + "px";
		
		// set position for title
		document.getElementById('page_title').style.top = (margin - document.getElementById('page_title').offsetHeight + 5) + "px";
		document.getElementById('page_title').style.left = (margin + 15) + "px";
		
		// set position for language
		document.getElementById('page_language').style.top = (margin - document.getElementById('page_language').offsetHeight + 5) + "px";
		document.getElementById('page_language').style.right = (margin + 15) + "px";
		
		// set position for admin
		document.getElementById('page_admin').style.top = (window_height - margin + 20) + "px";
		document.getElementById('page_admin').style.left = (margin + 15) + "px";
		
		// set position for trafic
		document.getElementById('page_trafic').style.top = (window_height - margin + 20) + "px";
		document.getElementById('page_trafic').style.right = (margin + 15) + "px";
	}
}
