//RANDOM IMAGE ROTATER


gSlideshowInterval = 9;
gNumberOfImages = 3;

gImages = new Array(gNumberOfImages);
gImages[0] = "images/q1.jpg";
gImages[1] = "images/q2.jpg";
gImages[2] = "images/q3.jpg";


function canManipulateImages() {
	if (document.images)
		return true;
	else
		return false;
}
function loadSlide(imageURL) {
	if (gImageCapableBrowser) {
		document.slide.src = imageURL;
		return false;
	}
	else {
		return true;
	}
}
function nextSlide() {
	gCurrentImage = (gCurrentImage + 1) % gNumberOfImages;
	loadSlide(gImages[gCurrentImage]);
}
gImageCapableBrowser = canManipulateImages();
gCurrentImage = 0;
setInterval("nextSlide()",gSlideshowInterval * 1000);




//RANDOM TESTIMONIAL QUOTES

var Quotation=new Array() 

Quotation[0] = '"<i>Three cheers for Adam<br> and Nortic Consulting</i>."<br><br>Dr. Salvatore Campagna, Licensed Clinical Professional Counselor';

Quotation[1] = '"<i>Nortic&#39;s service is second to none, quick responses and solutions to any computer needs. IT support and service only<br> one phone call away</i>."<br><br>Michael Hurwitz, VP Sales<br>Imperial Packaging Corp';

Quotation[2] = '"<i>Adam has been very reliable and knowledgeable. We are very satisfied</i>." <br><br>Cara and Alan Young';

Quotation[3] = '"<i>Adam knows what he is doing. He does it well, quickly, and efficiently. I recommend him with pleasure.</i>" <br><br>Verinder K. Syal<br> Syal Consult Inc.';

Quotation[4] = '"<i>Adam and his Nortic Team have always provided my organization (and family) with excellent and timely results. I insist you not only consider Nortic services, but hire Nortic for your next networking, troubleshooting or<br> general IT project</i>." <br><br>David Stuart, Guy in Charge<br>Improv Playhouse';

Quotation[5] = '"<i>Nortic Consulting has been extremely knowledgeable in setting up and servicing my home computer network. We have used them for over three years and been completely satisfied with their service and expertise. I wouldn&#39;t hesitate to recommend them to anyone for<br> their home or business</i>..."<br><br>Joseph Rossie, Executive Manager<br> East Bank Club Chicago';

Quotation[6] = '"<i>Nortic Consulting was very creative and efficient in the development<br> of our web site.</i>" <br><br>Bob Tinucci<br> Tinucci Real Estate Investments, Inc.';

Quotation[7] = '"<i>I can&#39;t say enough about the professionalism and knowledge of Adam Citron and his staff. All questions were always answered immediately and in an understanding way when I worked with Nortic Consulting on my website</i>."<br><br> Absolute Dust Free Wood Flooring, Inc.';


var Q = Quotation.length;
var whichQuotation=Math.round(Math.random()*(Q-1));



function checkEmail(myForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.ea.value)){
return (true)
}
alert("Invalid E-mail Address! Please re-enter.")
return (false)
}



document.write('<STYLE TYPE="text/css">.imgTrans{ filter:blendTrans(duration=0.0,transition=21) }</STYLE>');

var onImages=new Array();
function Rollover(imgName, imgSrc)
{
	onImages[imgName] = new Image();
	onImages[imgName].src = imgSrc;
}

function turnOn(imgName){ 
	if(document.images[imgName].filters != null)
		document.images[imgName].filters[0].apply();
	document.images[imgName].offSrc = document.images[imgName].src;
	document.images[imgName].src    = onImages[imgName].src;
	if(document.images[imgName].filters != null)
		document.images[imgName].filters[0].play();
}

function turnOff(imgName){ 
	if(document.images[imgName].filters != null)
		document.images[imgName].filters[0].stop();
	document.images[imgName].src = document.images[imgName].offSrc;
}

var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}



//Specify name of participating images, plus paths to their onMouseover replacements:


Rollover("home",  "navs/home_on.jpg");
Rollover("company",  "navs/company_on.jpg");
Rollover("services",  "navs/services_on.jpg");
Rollover("portfolio",  "navs/portfolio_on.jpg");
Rollover("contact",  "navs/contact_on.jpg");
Rollover("quote",  "navs/quote_on.jpg");
Rollover("site",  "navs/site_on.jpg");
Rollover("privacy",  "navs/privacy_on.jpg");
Rollover("blog",  "navs/blog_on.jpg");



//Contents for menu 1
var menu1=new Array()
menu1[0]='<a class="links" href="adamcitron.html">&nbsp;About Adam Citron</a><br>'
menu1[1]='<a class="links" href="about.html">&nbsp;About Us</a><br>'
menu1[2]='<a class="links" href="testimonials.html">&nbsp;Testimonials</a><br>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a class="links" href="web.html">&nbsp;Website Design & Development</a><br>'
menu2[1]='<a class="links" href="seo.html">&nbsp;Search Engine Marketing (SEM)</a><br>'
menu2[2]='<a class="links" href="maintenance.html">&nbsp;Website Maintenance</a><br>'
menu2[4]='<a class="links" href="tekworking.html">&nbsp;Tekworking</a><br>'
menu2[5]='<a class="links" href="business.html">&nbsp;Business Computer Support</a><br>'





//Contents for menu 3, and so on
var menu3=new Array()
menu3[0]='<a class="links" href="websites.html">&nbsp;Websites</a><br>'
menu3[1]='<a class="links" href="sem.html">&nbsp;Search Engine Marketing (SEM)</a><br>'








		
var menuwidth='223px' //default menu width
var menubgcolor='999999'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge+200")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge+2")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu



//Automate Copyright Year

today=new Date();
y0=today.getFullYear();





//VALIDATE CONTACT FORM

var empty = new Image(); empty.src = "fieldempty.gif";
var email = new Image(); email.src = "emailerror.gif";
var phone = new Image(); phone.src = "phoneerror.gif";

var haveerrors = 0;
function showImage(imagename, imageurl, errors) {
document[imagename].src = imageurl;
if (!haveerrors && errors) haveerrors = errors;
}

function validateForm(f) {
haveerrors = 0;
(f.A_Name.value.length < 1) // validate first name length
? showImage("firstnameerror", "fieldempty.gif", true)   // no semi-colon after this line!
: showImage("firstnameerror", "blankimage1.gif", false); // true = errors, false = no errors





phonenumlength = f.B_area.value.length + 
f.C_exchange.value.length + f.D_number.value.length;

(phonenumlength != 10) // validate phone number length
? showImage("phoneerror", "fieldempty.gif", true)
: showImage("phoneerror", "blankimage1.gif", false);

(f.E_Email.value.search("@") == -1 || f.E_Email.value.search("[.*]") == -1) // validate email
? showImage("emailerror", "fieldempty.gif", true)
: showImage("emailerror", "blankimage1.gif", false);

return (!haveerrors);

}


function autotab(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()
}

