var FULLURL = "http://www.aratoys.ro/";
/*
	Set menu On/Off fucntion
*/
var meniul = {
	setOn: function(id) {
		$(id).src = FULLURL + "images/menus/" + id + "_on.jpg";
	},
	setOff: function(id) {
		$(id).src = FULLURL + "images/menus/" + id + "_off.jpg"
	}
}

// Sterge VALUE din campuri daca este completat
function clearfield(id) {
	$(id).value = "";
}

// Comentarii
function lasaComentariu() {
	new Effect.toggle('commentFrm', 'slide', {duration:0.7});
}

// product details
function placeBig(id, src) {
	$(id).src = src;
	$(id + "_2").src = src;
	
	setZoomImage();
}

function placeBig2(id, src, w, h) {
	// resize			
	target = 120;
	if(w > h)
		procent = (target / w);
	else
		procent = (target / h);
		
	width = Math.round(w * procent);
	height = Math.round(h * procent);
	
	$(id).src = src;
	$(id).width = width;
	$(id).height = height;
	$(id + "_2").src = src;
	
	setZoomImage();
}

function showImage() {
	new Effect.Appear('thisIsTheBigImage', {duration:0.1});
}
function closeImage() {
	new Effect.Fade('thisIsTheBigImage', {duration:0.1});
}


function makeHeight() {	
	var filterh = $('filters').offsetHeight;
	//var bodyh = $('bodyPage').offsetHeight;
	$('bodyPage').style.minHeight = (filterh + 10 + "px");
}

function setRank(nota) {
	$('comment_rank').value = nota;
}


// CATEGORII SEARCH
function releaseDropdown() {
	new Effect.toggle('categDropDown', 'appear', {duration:0.7});
}
function setDropdown(nr, name) {
	$('categorie').value = nr;
	$('categorie2').value = name;
	new Effect.Fade('categDropDown', {duration:0.7});
}

// Aici ascumdem Meniul Drop Down al categoriilor
document.onclick = function() {
	var element = $('categDropDown').style.display;
	if(element != "none") {
		new Effect.Fade('categDropDown', {duration:0.7});
	}
}

function refreshContact() {
	document.location.href = "contact.php?action=resetMessage";
}
