function validate_string(str)
{
	while (str.indexOf("  ") != -1)
	str = str.replace("  ", " ");
// removing all extra spaces from the
// string
	if (str =="" || str == " ")  return false;
}
function validate_integer(num,max,min)
{
	n = parseFloat(num);
	if (isNaN(n))
		return false;
	else if (n>max || n<min)
		return false;
}
function validate_email(str)
{
	l = str.length;
	at=str.indexOf("@");
	lastdot = str.lastIndexOf(".");
	if (at < 1 || (lastdot > l-3) || (lastdot-at < 2))
	return false;
}
function validate_form1(form, img)
{
	if (validate_string(form.elements[1].value) ==false)
	{
		alert("Invalid Name!");
		form.elements[1].focus();
		return false;
	}
	if (validate_email(form.elements[2].value) ==false)
	{
		alert("Invalid email address!");
		form.elements[2].focus();
		return false;
	}
	if (validate_string(form.elements[3].value) ==false)
	{
		alert("Invalid Company or Subject!");
		form.elements[3].focus();
		return false;
	}
	if (validate_string(form.elements[img].value) == false)
	{
		alert("Enter the verification string, please!");
		form.elements[img].focus();
		return false;
	}
return true;
}

function validate_form(form)
{
return validate_form1(form, 26) ;
}

function thanks()
{
	alert("Thanks for contacting me!") ;
	return ;
}
function autoreply()
{
	document.write("Thanks for contacting me!") ;
	return ;
}

function SwitchImg()
{ //start
  var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
    for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
    	store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
    if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
        (store.indexOf('document.all[')==0 && document.all==null))
         store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
         obj = eval(store);
    if (obj != null) {
   	   switcher[keep++] = obj;
      switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
      obj.src = SwitchImg.arguments[rem+2];
  } }
  document.Data = switcher;
} //end

function RestoreImg()
{ //start
  if (document.Data != null)
    for (var rem=0; rem<(document.Data.length-1); rem+=2)
      document.Data[rem].src=document.Data[rem+1];
} //end

qnum = 0 ;
var qimages=new Array() ;

function PrologN(quote, dude, face, num)
{
var AnimID = face + num + 1 ;
var ImgID = face + num + 'a' ;
var Img = 'img/' + face + '.gif' ;
var ImgCol = 'img/' + face + 'c.gif' ;

document.write('<table align="center" width="70%" border="0" rules="none">'
 + ' <tr onmouseover="this.bgColor = \'#400000\'" '
 + ' onmouseout="this.bgColor = \'#000000\'">'
 + ' <td width="80%" onmouseout="RestoreImg()"'
 + ' onmouseover="SwitchImg(\'document.'+ ImgID + '\',\'document.'
 + ImgID + '\',\'' + ImgCol + '\')">'
 + ' <table border="0"><tr><td ID="' + AnimID + '"> '
 + ' <i>"' + quote +'"</i></td></tr>'
 + ' <tr><td align="right">&#8212; ' + dude + '</td></tr>'
 + ' </table></td><td align="center"'
 + ' onmouseout="RestoreImg()"'
 + ' onmouseover="SwitchImg(\'document.' + ImgID + '\','
 + ' \'document.' + ImgID +'\',\'' + ImgCol + '\')">'
 + ' <img src="' + Img + '" name='+ ImgID + '></td></tr></table>') ;
 
 document.write('<SCRIPT language="JavaScript"> animate(\'' + AnimID 
 + '\', \'#FF8080\') ; </SCRIPT> ');

 // preload the color image
 qimages[qnum] = new Image() ;
 qimages[qnum].src = ImgCol ;
 qnum++ ;
}

function Prolog(quote, dude, face)
{
 PrologN(quote, dude, face, '0') ;
}

function footnote(fn)
{
 document.write('<a title="' + fn + '"><sup>Note</sup></a> ') ;
}

	// Flooble.com's Animated Text script. Will animate a specified 
	// bit of text (determined by the ID of containing tag) by 
	// highlighting it with specified color one character at a time 
	// in a moving pattern.
	//
	// Summary of use: 
	//     call animate(tagID, color); where "tagID" is the ID 
	//     of the tag that contains text to be animated,
	//     and "color" is the color to use to highlight the text with.
	//
	// For more information, and detailed instructions, see 
	//     http://www.flooble.com/scripts/animate.php
	//
	// Copyright (c) 2002 by Animus Pactum Consulting Inc.
	// This script comes with no warranties whatsoever. 
	// Animus Pactum Consulting will not be responsible
	// for any damages resulting from its use.

var ie4 = false;
if(document.all) {
  ie4 = true; 
}       
function setContent(name, value) {
  var d;  
  if (ie4) { 
    d = document.all[name];
  } else {
    d = document.getElementById(name);
  }       
  d.innerHTML = value;    
}       

function getContent(name) {
  var d;
  if (ie4) {
    d = document.all[name];
  } else {
    d = document.getElementById(name);
  }
  return d.innerHTML;
}

function setColor(name, value) {
  var d;  
  if (ie4) { 
    d = document.all[name];
  } else {
    d = document.getElementById(name);
  }
  d.style.color = value;  
}

function getColor(name) {
  var d;
  if (ie4) {
    d = document.all[name];
  } else {
    d = document.getElementById(name);
  }
  return d.style.color;
}

function animate(name, col) {
  var value = getContent(name);
  if (value.indexOf('<span') >= 0) { return; }
  var length = 0;
  var str = '';
  var ch;
  var token = '';
  var htmltag = false;	
  for (i = 0; i < value.length; i++) {
    ch = value.substring(i, i+1);
    if (i < value.length - 1) { nextch = value.substring(i+1, i+2); } else { nextch = ' '; }
    token += ch;
    if (ch == '<' && '/aAbBpPhHiIoOuUlLtT'.indexOf(nextch) >= 0) { htmltag = true; }
    if (ch == '>' && htmltag) { htmltag = false; }
    if (!htmltag && ch.charCodeAt(0) > 30 && ch != ' ' && ch != '\n') {		
      str += '<span id="' + name + '_' + length + '">' + token + '</span>';
      token = '';
      length++;
    }
  }
  setContent(name, str);
  command = 'animateloop(\'' + name + '\', ' + length + ', 0, 1, \'' + col + '\')';
  setTimeout(command , 70);
}

function animateloop(name, length, ind, delta, col) {
  var next = ind + delta;
//  if (next >= length) { delta = delta * -1; next = ind + delta; }
//  if (next < 0) { delta = delta * -1; next = ind + delta; }
  if (next >= length) { next = 0 }
  setColor(name + '_' + ind, getColor(name + '_' + next));
  setColor(name + '_' + next, col);
  command = 'animateloop(\'' + name + '\', ' + length + ', ' + next + ', ' + delta + ', \'' + col + '\')';
  setTimeout(command , 70);
}

function popUp(URL) {
id = 600;
eval("pageUp = window.open(URL, '" + id + 
"','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=500,left = 10,top = 10');");
if (pageUp == null) {
 alert('Error while launching new window! Your browser maybe blocking popups.'
 + '\nPlease allow popups from this web site to see this content.'
 + '\nOr, use <Control><Alt> click on the link to temporarily allow the popup.') ;
 }
else {
 pageUp.focus() ;
 }
}

function popUpWide(URL) {
id = 800;
eval("pageWide = window.open(URL, '" + id + 
"','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=600,left = 10,top = 10');");
if (pageWide == null) {
 alert('Error while launching new window! Your browser maybe blocking popups.'
 + '\nPlease allow popups from this web site to see this content.'
 + '\nOr, use <Control><Alt> click on the link to temporarily allow the popup.') ;
 }
else {
 pageWide.focus() ;
 }
}

function popUpFat(URL) {
id = 1000 ;
eval("pageFat = window.open(URL, '" + id + 
"','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=1000,height=780,left = 10,top = 10');");
if (pageFat == null) {
 alert('Error while launching new window! Your browser maybe blocking popups.'
 + '\nPlease allow popups from this web site to see this content.'
 + '\nOr, use <Control><Alt> click on the link to temporarily allow the popup.') ;
}
else {
 pageFat.focus() ;
 }
}

<!--
// copyright 1999-2001 Idocs, Inc. http://www.idocs.com/tags/
// Distribute this script freely, but keep this 
// notice with the code.
var submitRolls = new Object();
function submitroll(src, oversrc, name, ttip)
{
this.src=src;
this.oversrc=oversrc;
this.name=name;
this.alt=ttip;
this.write=submitroll_write;
}
function submitroll_write()
{
var thisform = 'document.forms[' + (document.forms.length - 1) + ']';
submitRolls[this.name] = new Object();
submitRolls[this.name].over = new Image();
submitRolls[this.name].over.src = this.oversrc;
submitRolls[this.name].out = new Image();
submitRolls[this.name].out.src = this.src;
document.write
(
'<A onMouseOver="if (document.images)document.images[\'' + this.name + "'].src=submitRolls['" + this.name + '\'].over.src"' + 
' onMouseOut="if (document.images)document.images[\'' + this.name + "'].src=submitRolls['" + this.name + '\'].out.src"' + 
' HREF="javascript:'
);
if (this.sendfield)
{
if (! this.sendvalue)
this.sendvalue = 1;
document.write(thisform, ".elements['", this.sendfield, "'].value='", this.sendvalue, "';");
}
document.write(thisform + '.submit();void(0);"');
if (this.msg)document.write(' onClick="return confirm(\'' , this.msg, '\')"');
document.write('>');
document.write('<IMG SRC="' + this.src + '" ALT="' + this.alt + '" BORDER=0 NAME="' + this.name + '"');
if (this.height)document.write(' HEIGHT=' + this.height);
if (this.width)document.write(' WIDTH='  + this.width);
if (this.otheratts)document.write(' ' + this.otheratts);
document.write('></A>');
if (this.sendfield)
{
document.write('<INPUT TYPE=HIDDEN NAME="' + this.sendfield + '">');
document.forms[document.forms.length - 1].elements[this.sendfield].value='';
}
}
//-->