function CheckCou( StateSelect, CountrySelect, ZipValue )
{
var ErrorInfoAll="";
	var i = StateSelect.options.selectedIndex;
	var j = CountrySelect.options.selectedIndex;
	CouSelect = StateSelect.options[i].value;
	CnSelect = CountrySelect.options[j].value;
	if (CouSelect=="")
	{
		ErrorInfoAll = ErrorInfoAll + "Please select the state!\r\n";
	}
	if (CnSelect=="")
	{
		ErrorInfoAll = ErrorInfoAll + "Please select the country!\r\n";
	}
	if(CouSelect=="O"&&CnSelect=="US")
	{
		ErrorInfoAll = ErrorInfoAll + "The State - Country combination is invalid!\r\n";
	}
	else{ if(CouSelect!="O"&&CnSelect!="US")
	{
		ErrorInfoAll = ErrorInfoAll + "The State - Country combination is invalid!\r\n";
	}
	}
	if (CouSelect!="O"&&CnSelect=="US")
	{
		 ErrorInfoAll= ErrorInfoAll + CheckNull( ZipValue )
	}
	return ErrorInfoAll;
}

function CheckNull( CName ){

	var ErrorInfoAll="";
	/*
	if(CName.value.length == 5&&is_int(CName)){ 
		return ErrorInfoAll;
	}
	else {
		ErrorInfoAll="Please check the Zip Code!\r\n"
		*/
		return ErrorInfoAll;
	//}
}

function CheckCou2( StateSelect, CountrySelect, ZipValue , Type ){
	var ErrMsg = CheckCou( StateSelect, CountrySelect, ZipValue );
	if(ErrMsg.length > 0){
		var ErrorInfoAll=Type+"\r\n";
		ErrorInfoAll+=ErrMsg;
		return ErrorInfoAll;
	}
	else return "";
}

function is_int(field){
	var Ret = true;
	var NumStr="0123456789";
	var chr;

	for (i=0;i<field.value.length;++i)
	{
		chr=field.value.charAt(i);
		if (NumStr.indexOf(chr,0)==-1)
		{
			Ret=false;
			break;
		}
	}

	return Ret;
}
