// Refreshing Time


function startclock(){


var thetime=new Date();

var nhours=thetime.getHours();
var nmins=thetime.getMinutes();
var nsecn=thetime.getSeconds();
var AorP=" ";

if (nhours>=12)
    AorP="P.M.";
else
    AorP="A.M.";

if (nhours>=13)
    nhours-=12;

if (nhours==0)
   nhours=12;

if (nsecn<10)
 nsecn="0"+nsecn;

if (nmins<10)
 nmins="0"+nmins;


document.clockform.clockspot.value=nhours+":"+nmins+":"+nsecn+" "+AorP

setTimeout('startclock()',1000);

} 


//--------------------------------------------------------------------------------


// Validate Email Address


function validateEmail(formName,inputName) {
	
// Validate email address

	var inputObject = document.forms[formName].elements[inputName];
	var atSign = inputObject.value.indexOf('@');
	var dot = inputObject.value.lastIndexOf('.');
	var space = inputObject.value.indexOf(' ');
	var emailLength = inputObject.value.length - 1;

	if ((atSign < 1) || (space != -1) || (dot <= atSign + 1) || (dot == emailLength)) { 
 		alert('Please enter a valid email address');
		inputObject.focus();
		return false;
	}
	return true;
}


//------------------------------------------------------------------------------------------------------


// Validate Password to Submit


function validatepassword(formName,password,passwordconfirm) {

	var inputObject = document.forms[formName].elements[password];
	var first = document.forms[formName].elements[password].value;
	var second = document.forms[formName].elements[passwordconfirm].value;	

	if (first != second) { 
 		alert('Your password did not confirm, please try again');
		document.forms[formName].elements[password].value = "";
		document.forms[formName].elements[passwordconfirm].value = "";
		inputObject.focus();
		return false;
	}
	return true;
}


//------------------------------------------------------------------------------------------------------

// Swap Image



function swapimage(name,image){
		
	document[name].src = image;
}


//------------------------------------------------------------------------------------------------------


// Add to Favorites


function bookmarkIt(title,page) { 
  var bookmarktitle = "CleverSpider.com" + title;
  var bookmarkurl = "http://www.CleverSpider.com" + page;
  var netscape
  var macintosh
  netscape="Attention Netscape Users. To Bookmark this page please click the page you would like to bookmark and press CTRL+D. If you would like to add this page to your Netscape Sidebar, please click OK on the next window which appears.";
  macintosh="Attention Macintosh User. To Bookmark this page please click the page you would like to bookmark and press CTRL+D.";

  if (window.sidebar&&window.sidebar.addPanel) { 
    alert(netscape);
    window.sidebar.addPanel(bookmarktitle, bookmarkurl,""); 
  } else if (navigator.userAgent.indexOf("Mac")!=-1) {
    alert(macintosh);
  } else if (document.all) {
    window.external.AddFavorite(bookmarkurl, bookmarktitle);
  } else if (window.opera && window.print) {
    return true;
  }
}

//--------------------------------------------------------------------------------

// Print Page


function printIt(page) { 

var url = "printpage.cfm?printpage=" + page;

var winTop = (screen.height / 2) - 300;
var winLeft = (screen.width / 2) - 325;
windowFeatures = "width=650, height=500,";
windowFeatures = windowFeatures + "left=" + winLeft + ",";
windowFeatures = windowFeatures + "top=" + winTop + ",";
windowFeatures = windowFeatures + "toolbar=no, location=no, resizable=no, scrollbars=yes, status=no";


    window.open(url,'printpage',windowFeatures) ;
}


//--------------------------------------------------------------------------------







