function email() {
	document.write('<a href="mailto:info@samanaplus.com?subject=Ïèñüìî ñ ñàéòà">info@samanaplus.com</a>');
}

function isNumber(data){ 
	var numStr="0123456789"; 
	var thisChar; 
	var counter=0;
	
	for (var i=0; i<data.length; i++)
		{ 
		thisChar = data.substring(i, i+1); 
		if (numStr.indexOf(thisChar) != -1) counter++; 
		}
		
	if (counter == data.length)
		{
		return 1; 
		}
		else
		{
		return 0; 
		}
	}


function send_arhiv(){
	flag=0;
	
	if (document.frm.per_page.value == "" || document.frm.per_page.value == "0" || isNumber(document.frm.per_page.value) == 0)
		{
		flag=1;
		}
		
	if (flag == "1")
		{
		alert('Ââåäèòå íîìåð ñòðàíèöû.');
		}
		else
		{
		document.frm.submit();
		}
	}

function arhiv(page){
	document.frm.page.value=page;
	
	send_arhiv();
	}

function flash (version, filename, name, width, height, wmode, bgcolor, menu, flashvars) {
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+version+"' width='"+width+"' height='"+height+"' id='"+name+"' align='middle'>");
	document.write("<param name='FlashVars' value='"+flashvars+"' />");
	document.write("<param name='allowScriptAccess' value='sameDomain' />");
	document.write("<param name='wmode' value='"+wmode+"' />");
	document.write("<!-- Flash FIX v0.1 | www.mega.by -->");
	document.write("<param name='bgcolor' value='"+bgcolor+"' />");
	document.write("<param name='salign' value='lt' />");
	document.write("<param name='movie' value='"+filename+"' /><param name='menu' value='"+menu+"' /><param name='quality' value='high' /><embed src='"+filename+"' wmode='"+wmode+"' menu='"+menu+"' quality='high' FLashVars='"+flashvars+"' salign='lt' width='"+width+"' height='"+height+"' bgcolor='"+bgcolor+"' name='"+name+"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}

function get_photo(dep, img, sx, sy) {
	sx = sx+40;
	sy = sy+30;
	wnd = window.open("img/"+dep+"/"+img,"_blank",
	"toolbar=no,location=no,directoties=no,"+
	"statusbar=no,menubar=no,scrollbars=yes,resizable=no,"+
	"width="+sx+","+"height="+sy+",left=0,top=0");
}

function feedback_form(id,lang) 
	{
	var error=0;
	emailTest = "^[_\\.0-9a-z-]+@([0-9a-z][0-9a-z_-]+\\.)+[a-z]{2,4}$";
	var regex = new RegExp(emailTest);
	
	if(!document.getElementById(id).org.value)
		{
		error++;
		
		if (lang=="ru")
			{
			alert("Ââåäèòå íàçâàíèå îðãàíèçàöèè.");
			}
			else
			{
			alert("Enter the name of the organization.");
			}
			
		document.getElementById(id).org.focus();
		return 0;
		}


	if(!document.getElementById(id).name.value)
		{
		error++;
		
		if (lang=="ru")
			{
			alert("Ââåäèòå Âàøå Èìÿ!");
			}
			else
			{
			alert("Enter your Name!");
			}
			
		document.getElementById(id).name.focus();
		return 0;
		}
		
	if(!regex.test(document.getElementById(id).email.value))
		{
		error++;
		
		if (lang=="ru")
			{
			alert("Óêàçàí íåâåðíûé E-mail!");
			}
			else
			{
			alert("It is specified incorrect E-mail!");
			}
			
		document.getElementById(id).email.focus();
		return 0;
		}
		
	if(!document.getElementById(id).message.value)
		{
		error++;
		
		if (lang=="ru")
			{
			alert("Ââåäèòå Âàøå ñîîáùåíèå!");
			}
			else
			{
			alert("Enter your message!");
			}

		document.getElementById(id).message.focus();
		return 0;	
		}
		
	if(!error)
		{
		document.getElementById(id).submit();
		}
}

function order_form() 
		{
		var error=0;
		emailTest = "^[_\\.0-9a-z-]+@([0-9a-z][0-9a-z_-]+\\.)+[a-z]{2,4}$";
		var regex = new RegExp(emailTest);
	
		blFlag=0;
 
		if(document.frm.name.value == "")
				{
				blFlag=1;
				alert("Ââåäèòå íàèìåíîâàíèå.");
				document.frm.name.focus();
				return;
				}
 
		if(document.frm.country.value == "")
				{
				blFlag=1;
				alert("Ââåäèòå ñòðàíó.");
				document.frm.country.focus();
				return;
				}
 
		if(document.frm.sity.value == "")
				{
				blFlag=1;
				alert("Ââåäèòå ãîðîä.");
				document.frm.sity.focus();
				return;
				}
 
		if(document.frm.str.value == "")
				{
				blFlag=1;
				alert("Ââåäèòå óëèöó.");
				document.frm.str.focus();
				return;
				}
 
		if(document.frm.tel.value == "")
				{
				blFlag=1;
				alert("Ââåäèòå òåëåôîí.");
				document.frm.tel.focus();
				return;
				}
 
		if(document.frm.fax.value == "")
				{
				blFlag=1;
				alert("Ââåäèòå ôàêñ.");
				document.frm.fax.focus();
				return;
				}
 
		if(!regex.test(document.frm.mail.value))
				{
				blFlag=1;
				alert("Ââåäèòå e-mail.");
				document.frm.mail.focus();
				return;
				}
 
		if(document.frm.message.value == "")
				{
				blFlag=1;
				alert("Ââåäèòå çàïðîñ.");
				document.frm.message.focus();
				return;
				}
   
		if(blFlag == 0)
				{
				document.frm.submit();
				}
}
