function selectRadio(id)
{
	var obj = document.forms.voteForm;
	obj.answer[id].checked = true;
}

function SumbitVoteForm()
{
	obj = document.forms.voteForm;
	obj.submit();
}


function trimString(s){ return s.replace(/(^\s*)|(\s*$)/,""); }
function SubmitSearchForm()
{
	var formObj = document.getElementById('search');
		//var formObj = document.forms.configForm;
		formObj.submit();
//document.forms.search.submit()
}
function SubmitConfigForm()
{
	var formObj = document.getElementById('configForm');
	//var formObj = document.forms.configForm;
	formObj.submit();
}

function SubmitQuestionForm()
{
	var formObj = document.forms.orderForm;
	if (trimString(formObj.fio.value) == false) { alert("Введите ФИО!"); return false;}
	if (trimString(formObj.phone.value) == false) { alert("Введите телефон!"); return false;}
	if (trimString(formObj.reg.value) == false) { alert("Введите организацию!"); return false;}
	if (trimString(formObj.message.value) == false) { alert("Введите текст вопроса!"); return false;}
	formObj.submit();
}
function SubmitRequestForm()
{
	var formObj = document.forms.orderForm;
	if (trimString(formObj.fio.value) == false) { alert("Введите ФИО!"); return false;}
	if (trimString(formObj.phone.value) == false) { alert("Введите телефон!"); return false;}
	if (trimString(formObj.reg.value) == false) { alert("Введите организацию!"); return false;}
	if (trimString(formObj.message.value) == false) { alert("Введите текст запроса!"); return false;}
	formObj.submit();
}

function ClearOrderForm()
{
	document.forms.orderForm.fio.value = '';
	document.forms.orderForm.email.value = '';
	document.forms.orderForm.reg.value = '';
	document.forms.orderForm.subject.value = '';
	document.forms.orderForm.message.value = '';
}

function showThanks(id) {
	window.open("Thanks.aspx?id="+id,null,"width=393,height=120,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars,titlebar=no");
}

function showPhoto(id) {
	window.open("ShowProductImage.aspx?id="+id,null,"width=483,height=483,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars,titlebar=no");
}


function checkRegisterForm()
{
	var formObj = document.forms.registerForm;
	if (trimString(formObj.login.value) == false) { alert("Введите логин!"); return false;}
	if (trimString(formObj.pass.value) == false) { alert("Введите пароль!"); return false;}
	if (trimString(formObj.pass1.value) == false) { alert("Введите подтвержение пароля!"); return false;}
	if (trimString(formObj.userName.value) == false) { alert("Введите имя пользователя!"); return false;}

	return true;
}

function checkRestoreForm()
{
	var formObj = document.forms.restorePassForm;
	if (trimString(formObj.login.value) == false) { alert("Введите логин!"); return false;}
	if(formObj.email.value.search(/^[^@\s]+@([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}$/) == -1) { alert("Введите E-mail!"); return false;}
	return true;
}

function checkLoginForm()
{
	var formObj = document.forms.login_Form;
	if (trimString(formObj.login.value) == false) { alert("Введите логин!"); return false;}
	if (trimString(formObj.pass.value) == false) { alert("Введите пароль!"); return false;}
	return true;
}

function photo_win(img_path,img_alt,width,height){	
var str, StrBody;

	str = 'resizable=yes,width='+width+',height='+height;
	StrBody = '<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#7DBC51" onblur="self.window.close();">';
	var win_op = window.open('','show', str);
	win_op.document.open();
	win_op.document.writeln('<html>');
	win_op.document.writeln('<head>');
	win_op.document.writeln('<title>' + img_alt + '</title>');
	win_op.document.writeln('</head>');
	win_op.document.writeln(StrBody);
	win_op.document.writeln('<div style="width:'+width+';height:'+height+';padding-top:15px">'); 
	win_op.document.writeln('<OBJECT id=first codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0 height=400 width=600 align=middle classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 viewastext=""><PARAM NAME="_cx" VALUE="14684"><PARAM NAME="_cy" VALUE="4736"><PARAM NAME="FlashVars" VALUE=""><PARAM NAME="Movie" VALUE='+img_path+'><PARAM NAME="Src" VALUE='+img_path+'><PARAM NAME="WMode" VALUE="Window"><PARAM NAME="Play" VALUE="-1"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="SAlign" VALUE=""><PARAM NAME="Menu" VALUE="0"><PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE="always"><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE=""><PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1"><PARAM NAME="Profile" VALUE="0"><PARAM NAME="ProfileAddress" VALUE=""><PARAM NAME="ProfilePort" VALUE="0"><PARAM NAME="AllowNetworking" VALUE="all"><PARAM NAME="AllowFullScreen" VALUE="false"><embed src='+img_path+' quality="high" bgcolor="#7DBC51" name="first" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="400" width="600"></OBJECT>')
	win_op.document.writeln('<div style="float:right;padding-right:25px;"><table cellpadding="0" cellspacing="7" class="leftMenu"><tr><td><a href="http://fimtec.ru/PrintInfoMoskva.aspx" target="_blank" style="color:#143A5C;font-weight:bold;font-size:12px;">Bерсия для печати</a></td><td><a href="javascript:window.close();" style="color:#143A5C;font-weight:bold;font-size:12px;">Закрыть</a></td></tr></table></div>');
	win_op.document.writeln('</div>');
	win_op.document.writeln('</body>');
	win_op.document.writeln('</html>');		
	win_op.document.close();
}


