var arType = new Array();

arType = [['frog'],['bug'],['calligrapha'],['turtle']];







function thisMovie(movieName) {

	if (navigator.appName.indexOf("Microsoft") != -1) {

		return window[movieName]

	} else {

		return document[movieName]

	}

}



function select_pics(id, id2, cover){

	var img = '/i/collect_' + id + '_sel.' + cover;



	document.getElementById(id2).style.background ='url(/i/' + id + '_fon.jpg)';



	for (var j=0; j<arType.length; j++){

		if (document.getElementById(id).src != img & id == arType[j]){

			document.getElementById(id).src = '/i/collect_' + id + '_sel.' + cover;

			document.getElementById('title_img').src = '/i/title_' + id + '.gif';

		}else{

			document.getElementById(arType[j]).src = '/i/collect_' + arType[j] + '.' + cover;

		}

	}

		thisMovie("slider").changeItem(id);

}



function check_email (el,msg){

var reg=/^[^@]+@([a-z0-9\-]+\.)+[a-z]{2,4}$/i;

		if (!reg.test(el.value)){

		alert(msg);

		el.focus();

		return false;

	}

	return true;

}





function check(el, msg) {

	if(el.value == ''){

		alert(msg);

		el.focus();

		return false;

	}

	return true;

}





function check_form(form) {

		return check(form.name, 'Please enter your First name.')&& check_email(form.email, 'Please enter a valid e-mail address.') && check(form.comment, 'Please enter your message.');

}

function check_form2(form) {

		return check(form.name, 'Please enter your Name.')&& check_email(form.email, 'Please enter a valid e-mail address.');

}





