$(document).ready(function() {
	if (window.opera) {
			if (document.documentElement.clientHeight < document.body.scrollHeight) { 
				$("#backtotop").hide();
			} else {
				$("#backtotop").show();
			}
		} else {
			if (document.documentElement.clientHeight > document.body.clientHeight) { 
				$("#backtotop").hide();
			} else {
				$("#backtotop").show();
			}
	}	
	$("#backtotop").click(function () {
		$.scrollTo( '#top', 400, {offset:-50});
		return false
	});
	//$("a[rel^='prettyPhoto']").prettyPhoto();
	$("a[rel^='prettyOverlay'],a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.35, /* Value betwee 0 and 1 */
		showTitle: true, /* true/false */
		allowresize: false, /* true/false */
		counter_separator_label: '/' /* The separator for the gallery counter 1 "of" 2 */
	});
});

function showprofile(num) {	
	$('#p'+num).slideDown("slow");
	$('#p'+num+'x').hide();
	$('#p'+num+' .toggle-close').show();
}
function hideprofile(num) {
	$('#p'+num).slideUp("slow");
	$('#p'+num+'x').show();
	$('#p'+num+' .toggle-close').hide();
}

function commentpopper(polid) {
	var url = "index.php?section=multipoll&mplid="+mplid;
	document.open(url, "_blank", "scrollbars=yes, resizable=no, history=no, toolbar=no, menubars=no, width=650, height=450");	}

function multipollpopper(mplid) {
	var url = "index.php?section=multipoll&mplid="+mplid;
	document.open(url, "_blank", "scrollbars=yes, resizable=no, history=no, toolbar=no, menubars=no, width=580, height=450");
}

function clearBox(box) {
	if(box.value == box.defaultValue) {
		box.value = "";
	}
}

function resetBox(box) {
	if (box.value == "") {
		box.value = box.defaultValue;
	}
}

