var checkNum,word,checkString
// تابعي براي چك كردن مقدار فيلد كه حروف باشد

function isBadchar(word) { 

	if (word.value.indexOf("!") != -1 || 
		word.value.indexOf(" ") != -1 || 
		word.value.indexOf("@") != -1 || 
		word.value.indexOf("#") != -1 || 
		word.value.indexOf("$") != -1 || 
		word.value.indexOf("%") != -1 || 
		word.value.indexOf("^") != -1 || 
		word.value.indexOf("&") != -1 || 
		word.value.indexOf("*") != -1 || 
		word.value.indexOf("(") != -1 || 
		word.value.indexOf(")") != -1 || 
		word.value.indexOf("'") != -1 || 
		word.value.indexOf("|") != -1 || 
		word.value.indexOf("?") != -1 || 
		word.value.indexOf("/") != -1 || 
		word.value.indexOf("[") != -1 || 
		word.value.indexOf("]") != -1 ) 
	return false; 
	else return true; 
} 

function checkLoginForm () {
	
	if (isBadchar(document.Login.txtUserName) == false){
		alert("نام كاربر  نمي تواند شامل كاراكترهاي@#$%^&*()'/[]?\ باشد");
		document.Login.txtUserName.focus();
		return false;
	}

	if (isBadchar(document.Login.txtUserPass) == false){
		alert("كلمه عبور نمي تواند شامل كاراكترهاي@#$%^&*()'/[]?\ باشد");
		document.loginForm.txtUserName.focus();
		return false;
	}

		
	return true;
}


function addSanatSelectArzehTaghaza(SCode) {	

        window.opener.document.location.href= "ArzehTaghaza.asp?SCode="+(SCode.substring(0,SCode.indexOf(",")))+"&Tarikh="+(SCode.substring(SCode.indexOf(",")+1,SCode.indexOf("/")))+"&TimeSelect="+(SCode.substring(SCode.indexOf("/")+1,SCode.length)); 
        window.close();
}

function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}
function addSanatSelectAmarDaily(SCode) {	 
        window.opener.document.location.href= "amarDaily.asp?SCode="+(SCode.substring(0,SCode.indexOf(",")))+"&amarDate="+(SCode.substring(SCode.indexOf(",")+1,SCode.length));
        window.close();
}

function addSanatSelectLastPrice(SCode) {	 
	window.opener.document.location.href= "lastPricesArchive.asp?SCode="+(SCode.substring(0,SCode.indexOf(",")))+"&Tarikh="+(SCode.substring(SCode.indexOf(",")+1,SCode.indexOf("/")))+"&TimeSelect="+(SCode.substring(SCode.indexOf("/")+1,SCode.length)); 
        window.close();
}
function addSanatSelectCompanyList(SCode) {	 
	window.opener.document.location.href= "company_list.asp?SCode="+SCode+"&search=+";
        window.close();
}
