﻿function sendFriend(h){
	window.open (h, 'sendfriend.is', 'width=361,height=261,top=250,left=280,scrollbars=0,location=0,resizeable=0');
}
function chAnimalSelect(animalid, f)
{
	f = document.getElementById(f);
	dat = petTypes[animalid].split(';');

	clearList(f)

	for(i = 0; i < dat.length; i++)
	{
		a = dat[i].split(':');

		f.options[i] = new Option(a[1],a[0]);
	}
}
function chAnimalSelect2(animalid)
{
	f = document.getElementById("typeF");
	dat = petTypes[animalid].split(';');

	clearList(f)
	var a = new Array();
	
	for(i = 0; i < dat.length; i++)
	{
		
		a = dat[i].split(':');

		f.options[i] = new Option(a[1],a[0]);
	}
}

function clearList(oList)
{
	for (var i = oList.options.length; i >= 0; i--)
	oList.options[i] = null;

	oList.selectedIndex = (-1);
}

function tOnclick(id,b){
	var el;
	el = document.getElementById('iT'+id);
	if(document.getElementById('iAd'+id).style.display == '') {
		el.className = b;
		document.getElementById('iAd'+id).style.display = 'none';
	} else {
		if(document.getElementById('iAd'+id).className != 'adReady'){
			document.getElementById('iAd'+id).src = "/ads/display?"+id+"&b="+b;
			document.getElementById('iAd'+id).className = 'adReady';
		}
		el.className = 'b3';
		document.getElementById('iAd'+id).style.display = '';
	}
}

function checkSelectedAds(obj){
	lst = obj.getElementsByTagName('input');
	chkd = 0;
	for(i = 0; i < lst.length; i++){
		if(lst[i].type == 'checkbox' && lst[i].className == 'lst' && lst[i].checked)
		chkd++;
	}

	if(chkd == 0){
		alert('יש לסמן מודעות לתצוגה');
		return false;
	}
	return true;
}