﻿function frmCheck()
{
	if (document.forms.frmInfo.fld_3.value && document.forms.frmInfo.fld_4.value && document.forms.frmInfo.fld_7.value && document.forms.frmInfo.fld_8.value)
	{
		return true;
	}
	else
	{
		alert("لطفا همه قسمت های مشخص شده با ستاره را پر کنید");
		return false;
	}
}

function frmCheck2()
{
	if (document.forms.frmInfo2.fld_6.value && document.forms.frmInfo2.fld_5.value && document.forms.frmInfo2.fld_4.value && document.forms.frmInfo2.fld_3.value)
	{
		return true;
	}
	else
	{
		alert("لطفا همه قسمت های مشخص شده با ستاره را پر کنید");
		return false;
	}
}

function DeleteConfirm()
{
	a = window.confirm("آیا موارد انتخابی حذف شوند ؟");
	if (a == true)
		return true;
	else
		return false;
}

var id = 0;
var n = 0;
var total = 0;

function showItem (str1, str2)
{
	id = str1;
	total = document.getElementById('pic_'+id).innerHTML;
	document.getElementById('image').innerHTML = "<img src='"+document.getElementById('pic_'+str1+'_1').innerHTML+"'>";
	document.getElementById('ttl').innerHTML = str2;
	n = 1;
}

function next()
{	
	if (n < total)
		n++;
	else 
		n = 1;
		
	document.getElementById('image').innerHTML = "<img src='"+document.getElementById('pic_'+id+'_'+n).innerHTML+"'>";
}

var tim = 0, x;
function goDown()
{
	tim = tim - 5; 
	document.getElementById('pageTexts').style.top = tim + 'px';
	x = window.setTimeout('goDown()', 100);
}

function goUp()
{
	tim = tim + 5; 
	document.getElementById('pageTexts').style.top = tim + 'px';
	x = window.setTimeout('goUp()', 100);
}

function nothing()
{
	clearTimeout(x);
}
