

var speed = 50 
var pause = 5000 
var timerID = null
var texttype = false
var ar = new Array()

ar[0] = "--<<    Welcome To Somayeh Foodstuff Production Company WebSite    >>--"
ar[1] = "Thanks For You Visiting... We Are hopeful For See You Again..."
ar[2] = "Please Visit Somayeh Production In Products Page..."
ar[3] = "You Can Use Of Quick Mail For Send Any Comments"
ar[4] = "Producing Under The Licenses ISO 9001:2000 and HACCP"
ar[5] = "For More Acquaintance With Somayeh and History, Visit About Us Page"

var msgnow = 0
var offset = 0

function stopBanner() {
        if (texttype)
                clearTimeout(timerID)
        texttype = false
}

function startBanner() {
        stopBanner()
        showBanner()
}

function showBanner() {
        var text = ar[msgnow]

        if (offset < text.length) {
                if (text.charAt(offset) == " ")
                        offset++                        

                var partialMessage = text.substring(0, offset + 1) 
                window.status = partialMessage
                offset++ 
                timerID = setTimeout("showBanner()", speed)
                texttype = true
        } else {
                offset = 0
                msgnow++
                if (msgnow == ar.length)
                        msgnow = 0

                timerID = setTimeout("showBanner()", pause)
                texttype = true
        }
}


// Script for select a group by combo box and jump to target page
function surfto(form) {
var myindex=form.select_Group.selectedIndex
if (form.select_Group.options[myindex].value != 0) {
location=form.select_Group.options[myindex].value;}
}


/*----- Verify Quick Mail Form Fields ------------*/
function verify()
{
if (document.somayeh_form.Name.value=="") 
	{
		alert ("Please Enter Your Name")
		document.somayeh_form.Name.focus();
		return false;
	}
if (document.somayeh_form.Company.value=="") 
	{
		alert ("Please Enter Your Company Name")
		document.somayeh_form.Company.focus();
		return false;
	}
if (document.somayeh_form.Country.value=="") 
	{
		alert ("Please Enter Your Country Name")
		document.somayeh_form.Country.focus();
		return false;
	}

if (document.somayeh_form.email.value=="") 
	{
		alert ("Please Enter Your Email")
		document.somayeh_form.email.focus();
		return false;
	}

// -------------------------- E-Mail -----------------------------
var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
var regex = new RegExp(emailReg);
if (!regex.test(document.somayeh_form.email.value))
   {
    alert("Please Enter Correct Email Address");
    document.somayeh_form.email.focus();
    return false;
   }


if (document.somayeh_form.Subject.value=="") 
	{
		alert ("Please Enter Subject")
		document.somayeh_form.Subject.focus();
		return false;
	}

return true;

}
