var int2='';

function goSizes() {
    window.open('/sizes.php','', 'toolbar=0,width=500,height=600');
	return false;
}

function sendToFriend() {
	var obj = document.getElementById('sendToFriend');
	var btn = document.getElementById('sendToFriend_btn');

	if(obj.style.display=='') {
		obj.style.display='none';
		btn.style.display='';
		if(int2) clearInterval(int2);
	} else {
		int2 = setInterval(checkSendToFriendFrom, 100);
		obj.style.display='';
		btn.style.display='none';
	}
	return false;
}

function checkSendToFriendFrom() {
	var form = document.forms['send2Friend'];
	var email = form.email;
	var comment = form.comment;
	var sendBtn = form.send_link;
	var valid=1;
	
	if(!/[0-9a-z_]+@[0-9a-z_^\.]+\.[a-z]{2,3}/i.test(email.value)) {
		valid=0;
	}
	sendBtn.disabled = (valid) ? '' : 'disabled';
}

function swapValues(t,o,d) {

	if(d){
	if(o.value==t){		
			o.value='';
			o.style.color='#000'
	}
	} else {
	if(o.value==''){		
		o.value=t;
		o.style.color='#aaa'
	}
	}

}

function imageShow(src) {
	var img=document.getElementById('imageViewer');

	img.src=src;
}

function expand(i) {
	obj = document.getElementById('news_'+i);
	if(obj.style.display=='none') {
		Effect.BlindDown('news_'+i, {duration:0.3});
	} else {
		Effect.BlindUp('news_'+i, {duration:0.3});
	}

	return false;
}

function editCat(o) {
	return false;
}

function changeColor(id, sizes, o) {
	document.getElementsByClassName('selectedColor')[0].className='nsel';
	o.parentNode.className='selectedColor';
	$('itempic').href='/pictures/big/'+id;
	$('itempic1').src='/pictures/normal/'+id;
	$('spansizes').innerHTML = sizes;
	return false;
}

