// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 3000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'images/img.jpg'
Pic[1] = 'images/img2.jpg'
Pic[2] = 'images/img3.jpg'
Pic[3] = 'images/img4.jpg'




// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {
if (document.all) {
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}
//  End -->
function validate()
	{
		if(chk()==true)
		{
			if(chk2()==true)
			{	
				if(chk3()==true)
				{return true;}
			}
		}		
		
		return false;
	}
	function chk()
	{
			if(frm.txtname.value=="")
			{frm.txterror.value="* can't left blank";frm.txtname.focus();return false;	}
//			if(!isNaN(frm.txtname.value))
//			{frm.txterror.value="number not allow";frm.txtname.focus();return false;}
			if(frm.txtname.value.length>0)
			{
				var i,a;
				i=frm.txtname.value;
				for(j=0;j<i.length;j++)
				{
					a=i.charAt(j);
					if(a=="." || a=="-" || a=="," || a=="[" ||a=="]"||a=="!"||a=="#"||a=="$"||a=="%"||a=="^"||a=="&"||a=="*"||a=="@")
					{
						frm.txterror.value="* simbol not allow";frm.txtname.focus();return false;
					}	
					if(a=='0'||a=='1'||a=='2'||a=='3'||a=='4'||a=='5'||a=='6'||a=='7'||a=='8'||a=='9')
					{
						frm.txterror.value="* number not allow";frm.txtname.focus();return false;
					}
				}
			}

			frm.txterror.value="";
			return true;
	}
function chk2()
{			
			if(frm.txtemail.value=="")
			{msg("can't left blank");return false;	}
			
			//check valid email
			var str=frm.txtemail.value;
			var at='@';var dot='.';var lat=str.indexOf(at);var lstr=str.length;var ldot=str.indexOf(dot);
			var lastdot=str.lastIndexOf(dot);var stlen=str.split("@");
			if(stlen[0].length<3){msg("Invalid EmailID");frm.txtemail.focus();return false;}
			if(str.substring(lat+2,lat+3)==dot){msg("Invalid EmailID");frm.txtemail.focus();return false;}
			if(str.indexOf(at)==-1){msg("Invalid E-mail ID");frm.txtemail.focus();return false;}
			if(lstr==lastdot+1){msg("Invalid E-mail ID");frm.txtemail.focus();return false;}
			if(str.indexOf(at)==-1||str.indexOf(at)===0||str.indexOf(at)==lstr){msg("Invalid E-mail ID");frm.txtemail.focus();return false;}
			if(str.indexOf(dot)==-1||str.indexOf(dot)===0||str.indexOf(dot)==lstr){msg("Invalid E-mail ID");frm.txtemail.focus();return false;}
			if(str.indexOf(at,(lat+1))!=-1){msg("Invalid E-mail ID");frm.txtemail.focus();return false;}
			if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){msg("Invalid E-mail ID");frm.txtemail.focus();return false;}
			if(str.indexOf(dot,(lat+2))==-1){msg("Invalid E-mail ID");frm.txtemail.focus();return false;}
			if(str.indexOf(" ")!=-1){msg("Invalid E-mail ID");frm.txtemail.focus();return false;}
			frm.txterror2.value="";
			return true;
			
	}
	function chk3()
	{
			if(frm.txtmsg.value==""){frm.txterror3.value="*can't left blank";return false;}
			frm.txterror3.value="";
			return true;
	}
	function msg(str)
	{
		frm.txterror2.value="*"+str;
	}
	
