// JavaScript Document



isNS = (navigator.appName == 'Netscape');
isIE = (navigator.appName.indexOf('Microsoft') != -1);
isOP = (navigator.appName == 'Opera');
ns4 = (document.layers);
ie4 = (document.all && !document.getElementById);
ie5 = (document.all && document.getElementById);
ns6 = (!document.all && document.getElementById);

function show_(what) {
 document.getElementById(what).className = 'on';
}

var active=0;

function over_(what) {
 if(what!=active) {	
 	document.getElementById(what).className = 'icon_over';
 }
 
}
function out_(what) {
 if(what!=active) {	
 	document.getElementById(what).className = 'icon';
 }
}

function checked_(what) {
	var i=1;
	while(document.getElementById('logo'+i)) {
		document.getElementById('logo'+i).className = 'icon';
		i++;
	}
 	document.getElementById(what).className = 'icon_over';
 	document.getElementById('big').src = '/pictures/logos/'+what+'.gif';
	active=what;
}
function checked2_(what) {
	var i=1;
	while(document.getElementById('logo'+i)) {
		document.getElementById('logo'+i).className = 'icon';
		i++;
	}
 	document.getElementById(what).className = 'icon_over';
 	document.getElementById('big').src = '/pictures/photo/'+what+'.jpg';
	active=what;
}


function xGetElementById(e) {
	if(typeof(e)!='string') return e;
	if(document.getElementById) e=document.getElementById(e);
	else if(document.all) e=document.all[e];
	else e=null;
	return e;
} 


function getNewCaptcha(n) {
	var _img = xGetElementById('captcha'+n);
	var _rnd = 12574*Math.random();
	_img.src = "/Scripts/myCaptcha.php?id="+_rnd;
}

function send_mail_() {
var name = document.send_mail.name.value;
var email = document.send_mail.email.value;
var comment = document.send_mail.comment.value;
var ran = document.send_mail.ran.value;

var emailRegxp = /^([\w]+)(.[\w]+)*@([\w]+)(.[\w]{2,3}){1,2}$/;


	if( (name=="") || (comment=="") || (ran=="")) {
		alert("Не сте попълнили всички полета!");	
	} else	 if ((emailRegxp.test(email) != true) || (email == "")) {
		 alert("Въвели сте невалиден e-mail адрес!");			
	} else {
		document.send_mail.submit();
	}
}

