
// Init JS stuff at load
function Init() {
	// Set focus in username field
	if((document) && (document.getElementById('login'))) {
		document.getElementById('login').username.focus()
	}

	// Set Vote -button invisible
	if((document) && (document.getElementById('vote_button'))) {
		document.getElementById('vote_button').style.display = "none"
	}
}


// Use to confirm submit
function Confirm(str) {
	var confirmed = confirm(str)
	if(confirmed) {
		return true
	} else {
		return false
	}
}


// Open images when Cell is clicked
function OpenImage(image) {
	window.location = "/kuva/"+image+"/"
}


// Add BBCode
function BBCode(tag, name) {
	eval("var post = document.getElementById('BBCode_form')."+name+".value");
	eval("document.getElementById('BBCode_form')."+name+".value = post + tag");
	eval("document.getElementById('BBCode_form')."+name+".focus()");
}
