function showhide(id) {
	if (document.getElementById) {
		obj = document.getElementById(id);
		if (obj.style.display == "none"){
			obj.style.display = "";
		} else {
			obj.style.display = "none";
		}
	}
}

function viewAlbum(albumId,view) {
	if (albumId != "" && view != "thumbnail") {
		window.location.href = 'index.php?album=' + albumId;
	}
	if (albumId == "" && view != "thumbnail") {
		window.location.href = 'index.php';
	}
	if (albumId != "" && view == "thumbnail") {
		window.location.href = 'index.php?view=' + view + '&album=' + albumId;
	}
	if (albumId == "" && view == "thumbnail") {
		window.location.href = 'index.php?view=thumbnail';
	}
}

function viewArtist(albumId) {
	if (albumId != "") {
		window.location.href = 'index.php?page=artist&id=' + albumId;
	}
	if (albumId == "") {
		window.location.href = 'index.php';
	}
}

function changePicBattleGender(gender) {
	if (gender != "") {
		window.location.href = 'index.php?page=battle&gender=' + gender;
	}
	if (gender == "") {
		window.location.href = 'index.php?page=battle';
	}
}

function InstaSmilie () {
	return;
}
function AddSmile(SmileCode) {
	var cache = document.niceform.desc.value; // Please change these values
	this.code = SmileCode;
	document.niceform.desc.value = cache + SmileCode;
	document.niceform.desc.focus();	
}

var OnKeyRequestBufferDorama = {
	bufferText: false,
	bufferTime: 500, 
	modified : function(strId) {
		setTimeout('OnKeyRequestBufferDorama.compareBuffer("'+strId+'","'+xajax.$(strId).value+'");', this.bufferTime);
	},
	compareBuffer : function(strId, strText) {
		if (strText == xajax.$(strId).value && strText != this.bufferText) {
			this.bufferText = strText;
			OnKeyRequestBufferDorama.makeRequest(strId);
		}
	}, 
	makeRequest : function(strId) {
		xajax_doramaQuickSearch(xajax.$(strId).value);
	}
}

$(document).ready(function() {
	$(".show_favorites").fancybox({
		'transitionIn':'elastic',
		'transitionOut':'elastic',
		'speedIn':600, 
		'speedOut':200,
		'overlayShow':true,
		'hideOnOverlayClick':true
	});	
});
