// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// 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] = '/engineering/jtmcoef1.jpg'
Pic[1] = '/engineering/jtmcoef2.jpg'
Pic[2] = '/engineering/jtmcoef3.jpg'
Pic[3] = '/engineering/jtmcoef4.jpg'
Pic[4] = '/engineering/jtmcoef5.jpg'
Pic[5] = '/engineering/jtmcoef6.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 MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i>a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function validatefrm(t,secverify)
{

	if(t.name.value=="")
	{
		alert("Please specify your Name....");
		t.name.focus();
		return 0;
	}

		var emailID=t.email
		if (echeck(emailID.value)==false)
		{
			emailID.focus()
			return false
		}

	  if(secverify==1)
	  	{
	Item = t.sectorname.selectedIndex; 
	Result1 = t.sectorname.options[Item].text; 

    if (Result1 == "---- Select ----") 
	{
		alert("Please specify your Sector Name....");
		t.sectorname.focus();
		return false;
	}
	}
	if(secverify==2)
  	{
		if(t.dkeyword.value=="")
		{
			alert("Please specify your desired Keyword....");
			t.dkeyword.focus();
			return 0;
		}
	Item = t.shortcode.selectedIndex; 
	Result1 = t.shortcode.options[Item].text; 

    if (Result1 == "--- Select ---") 
	{
		alert("Please specify Short Code you wish to opt....");
		t.shortcode.focus();
		return false;
	}
	}
	if(secverify==3)
  	{
		if(t.dqty.value=="" || (t.dqty.value>='a' && t.dqty.value<='z') || (t.dqty.value>='A' && t.dqty.value<='Z'))
		{
			alert("Please specify your Numeric desired Bulk SMS Quantity....");
			t.dqty.focus();
			return 0;
		}
		if(t.dcountry.value=="")
		{
			alert("Please specify your desired Bulk sms Target Country....");
			t.dcountry.focus();
			return 0;
		}
	}

	if(t.comments.value=="")
	{
		alert("Please specify your Comments/ Suggestions....");
		t.comments.focus();
		return 0;
	}
	if(t.strCAPTCHA.value=="")
	{
		alert("Please specify Capture Code above - Used to Control Automated E-mail Postings....");
		t.strCAPTCHA.focus();
		return 0;
	}
	  
	t.submit();
	return 1;
}
function validatefrm2(t,secverify)
{
	if(t.name2.value=="")
	{
		alert("Please specify your Name....");
		t.name2.focus();
		return 0;
	}

		var emailID=t.email
		if (echeck(emailID.value)==false)
		{
			emailID.focus()
			return false
		}
	if(t.comments2.value=="")
	{
		alert("Please specify your Comments/ Suggestions....");
		t.comments2.focus();
		return 0;
	}
	if(t.strCAPTCHA2.value=="")
	{
		alert("Please specify Capture Code above - Used to Control Automated E-mail Postings....");
		t.strCAPTCHA2.focus();
		return 0;
	}
	  
	t.submit();
	return 1;
}

function resetvalue(ffield)
{	
	ffield.value="";
	return 1;
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function getimg(cntt,ipath)
{
	window.open("dispimg.asp?i=" + cntt + "&folder=" + ipath,"viewimage","resizable=yes,toolbar=0,location=0,menubar=0,status=0,height=700,top=14,left=62,width=900,,scrollbars=1");	
	//window.open("dispimg.asp?i=" + ipath,"viewimage","resizable=yes,toolbar=0,location=0,menubar=0,status=0,height=700,top=14,left=62,width=900,,scrollbars=1");	
	//window.document.getElementById('image').innerHTML="<img src='" + ipath + "' border=0>";
}


function replacecarriagereturn(textarea,replaceWith)   
{    
 textarea.value = escape(textarea.value);   
  //encode all characters in text area   
  //to find carriage return character   
 for(i=0; i < textarea.value.length; i++)   
 {    
  //loop through string, replacing carriage return    
  //encoding with HTML break tag   
  if(textarea.value.indexOf("%0D%0A") > -1)   
  {    
   //Windows encodes returns as \r\n hex   
   textarea.value=textarea.value.replace("%0D%0A",replaceWith);   
  }   
 else if(textarea.value.indexOf("%0A") > -1)   
  {    
   //Unix encodes returns as \n hex   
   textarea.value=textarea.value.replace("%0A",replaceWith);   
  }   
  else if(textarea.value.indexOf("%0D") > -1)   
  {    
  //Macintosh encodes returns as \r hex   
 textarea.value=textarea.value.replace("%0D",replaceWith);   
}   
}   
textarea.value=unescape(textarea.value);   
//decode all characters in text area back 
}

function vernotice(t)
{
	replacecarriagereturn(t.description,"<br>");
	if(t.type.value=="")
	{
		alert("Please specify notice type...");
		t.type.focus();
		return 0;
	}
	if(t.description.value=="")
	{
		alert("Please specify descrption...");
		t.description.focus();
		return 0;
	}
	t.action="addscrollnotice.asp";
	t.submit();
	return 1;
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}
