if (document.images) {

  image1on = new Image();
  image1on.src = "/images/nhome_b.gif";

  image2on = new Image();
  image2on.src = "/images/ncomp_b.gif";

  image3on = new Image();
  image3on.src = "/images/nservices_b.gif";

  image4on = new Image();
  image4on.src = "/images/nwork_b.gif";

  image5on = new Image();
  image5on.src = "/images/ncontact_b.gif";
  
  image6on = new Image();
  image6on.src = "/images/ncampus_b.gif";
    
  image1off = new Image();
  image1off.src = "/images/nhome_w.gif";

  image2off = new Image();
  image2off.src = "/images/ncomp_w.gif";

  image3off = new Image();
  image3off.src = "/images/nservices_w.gif";

  image4off = new Image();
  image4off.src = "/images/nwork_w.gif";

  image5off = new Image();
  image5off.src = "/images/ncontact_w.gif";
  
  image6off = new Image();
  image6off.src = "/images/ncampus_w.gif";
}
  
function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
  }
}

function clipHover(clipNum) {
	var clipClient = "";
	var clipTitle = ""; 
	var clipDesc = "";
	var clipDuration = "";
	var divContent = "";
	
	divContent = document.getElementById('cliptitle');
	
	switch(clipNum) {
	
		case "001":
			clipTitle = "<ul class='navlisttitle'><li>" + clipNum + ". Mitsubishi L200<br/> TV commercial</li></ul>";
			clipDesc = "<p class='clipdesc'><strong>Client:</strong> Mitsubishi<br/><strong>Duration:</strong> 50 seconds<br/>";
			clipDesc += "<strong>Type:</strong> TV commercial<br/>";
			clipDesc += "<strong>Description:</strong> Mitsubishi All terrain vehicle image spot</p>";
			
			divContent.innerHTML = clipTitle + clipDesc;
			break;
		case "002":
			clipTitle = "<ul class='navlisttitle'><li>" + clipNum + ". National Rugby League Finals Series</li></ul>";
			clipDesc = "<p class='clipdesc'><strong>Client:</strong> Channel 9 Australia<br/><strong>Duration:</strong> 15 seconds<br/>";
			clipDesc += "<strong>Type:</strong> Opening Titles<br/>";
			clipDesc += "<strong>Description:</strong> Live action and motion graphics opening title sequence</p>";
			
			divContent.innerHTML = clipTitle + clipDesc;
			break;
		case "003":
			clipTitle = "<ul class='navlisttitle'><li>" + clipNum + ". Invest in Beauty</li></ul>";
			clipDesc = "<p class='clipdesc'><strong>Client:</strong> Unitech Group, Delhi, India<br/><strong>Duration:</strong> 30 seconds<br/>";
			clipDesc += "<strong>Type:</strong> TV Commercial<br/>";
			clipDesc += "<strong>Description:</strong> TVC for Indian property developer Unitech</p>";
			
			divContent.innerHTML = clipTitle + clipDesc;
			break;
		case "004":
			clipTitle = "<ul class='navlisttitle'><li>" + clipNum + ". Thumb Wars</li></ul>";
			clipDesc = "<p class='clipdesc'><strong>Client:</strong> Flextech, UK<br/><strong>Duration:</strong> 30 seconds<br/>";
			clipDesc += "<strong>Type:</strong> Promo<br/>";
			clipDesc += "<strong>Description:</strong> Teaser promo for youth channel Trouble’s “Vote Your Own Week”</p>";
			
			divContent.innerHTML = clipTitle + clipDesc;
			break;
		case "005":
			clipTitle = "<ul class='navlisttitle'><li>" + clipNum + ". ‘Live Sexy’ idents</li></ul>";
			clipDesc = "<p class='clipdesc'><strong>Client:</strong> Kiss Television Music channel<br/><strong>Duration:</strong> 40 seconds<br/>";
			clipDesc += "<strong>Type:</strong> ID’s<br/>";
			clipDesc += "<strong>Description:</strong> Compile from Kiss’ 2004 Promax Gold winning ident series</p>";
			
			divContent.innerHTML = clipTitle + clipDesc;
			break;
		case "006":
			clipTitle = "<ul class='navlisttitle'><li>" + clipNum + ". ASHP 2005 Video</li></ul>";
			clipDesc = "<p class='clipdesc'><strong>Client:</strong> <br/>AmerisourceBergen<br/><strong>Duration:</strong> 1 minute<br/>";
			clipDesc += "<strong>Type:</strong> Trade Show Video<br/>";
			clipDesc += "<strong>Description:</strong> Excerpt from “meeting new challenges” promotional video</p>";
			
			divContent.innerHTML = clipTitle + clipDesc;
			break;
		case "007":
			clipTitle = "<ul class='navlisttitle'><li>" + clipNum + ". ‘Q’ General Entertainment Branding</li></ul>";
			clipDesc = "<p class='clipdesc'><strong>Client:</strong> Qantas – “Q” Inflight Entertainment Package<br/><strong>Duration:</strong> 2 minutes<br/>";
			clipDesc += "<strong>Type:</strong> Brand Identity<br/>";
			clipDesc += "<strong>Description:</strong> Compilation package of brand identities, openers and stings for Qantas’ 2001 Promax Gold winning “Q” multichannel system.  </p>";
			
			divContent.innerHTML = clipTitle + clipDesc;
			break;
		case "008":
			clipTitle = "<ul class='navlisttitle'><li>" + clipNum + ". Art + Culture + Lifestyle</li></ul>";
			clipDesc = "<p class='clipdesc'><strong>Client:</strong> Bucks Magazine<br/><strong>Duration:</strong> 30 seconds<br/>";
			clipDesc += "<strong>Type:</strong> TV Commercial<br/>";
			clipDesc += "<strong>Description:</strong> Beautiful images and exciting animation techniques deliver three-fold message – Art + Culture + Lifestyle.  </p>";
			
			divContent.innerHTML = clipTitle + clipDesc;
			break;
		default:
			clipDesc = "<p class='clipdesc' style='line-height:11px;'>Please select one of the clips listed below to view.</p>";
			
			divContent.innerHTML = clipDesc;
	}
}

function clipView(clipNum) {
	var nFrm = eval("document.clipFrm");
	
	nFrm.clipSel.value = clipNum;
	
	switch(clipNum) {
		case "001":
			nFrm.clipName.value = "Works 001 Mitsubishi.mpg";
			break;
		case "002":
			nFrm.clipName.value = "Works 002 NRL FInals.mpg";
			break;
		case "003":
			nFrm.clipName.value = "Works 003 Unitech.mpg";
			break;
		case "004":
			nFrm.clipName.value = "Works 004 Thumb wars.mpg";
			break;
		case "005":
			nFrm.clipName.value = "Works 005 Kiss.mpg";
			break;
		case "006":
			nFrm.clipName.value = "Works 006 ABC ASHP.mpg";
			break;
		case "007":
			nFrm.clipName.value = "Works 007 Qantas.mpg";
			break;
		case "008":
			nFrm.clipName.value = "Works 008 Bucks.mpg";
			break;
	}
	nFrm.submit();
}

function checkRadioControl(strFieldName){
     bolSelected = false;
     for (i=0;i<strFieldName.length;i++){
     if(strFieldName[i].checked){
          bolSelected = true;
     break;
     }
}     
     if(!bolSelected){
          return false;
          }
     return true;
}

function isNumber( strValue ) {
  var objRegExp  = /(^-?\d*.\d*$)/;

  return objRegExp.test(strValue);
}

function stripChar(sValue, sChar) {
	var i, tempChar, buildString;
	buildString = ""
	for (var i=0; i<sValue.length; i++) {
		tempChar = sValue.charAt(i);
		if (tempChar != sChar) {
			buildString = buildString + tempChar;
		}
	}
	return buildString;
}

function sfCheck(form) {
	var e, title, empty_fields, char_check, invalid_card, month, year, invalid_date, eMail, invalid_eMail;
	var iQuantity, quantity_check, checkSpecial, tempError, special_Error, msg, upperLine, lowerLine;
	var num, invalid_phoneNumber, passwd_mismatch, invalid_Zip, mcheck, mserrStr;
	var invalid_SSN, strReturn, invalid_payAmount, invalid_Gallon, noGallon;
	
	if (document.getElementById('GallonsNeeded'))
		noGallon = true;
	else
		noGallon = false;
		
	msg = "";
	empty_fields = "";
	char_check = "";
	special_Error = "";
	tempError = "";
	strReturn = true;
	num = form.length

	//form.sbut.disabled = true;

	for (var i = 0; i < form.length; i++) {
		e = form.elements[i]
		
		if ((e.title == null)||(e.title == "")) {
			title = e.name;
		}
		else {
			title = e.title;
		}
		if (((e.type == "text") || (e.type == "textarea")||(e.type == "password")) && !e.special && !e.disabled) {
			if (e.value.length <= 0 && !e.optional ) {
				if (e.title != "Company" && e.title != "MiddleInitial" && e.title!="Street Address 2" && e.title!="Feedback" && e.title!="Donation Dedication" && e.title!="Fax Number") {
				empty_fields += "\n            " + title;
				}
				continue;
			}
			else if (e.value.length > 0) {
				if (e.name == "email" || e.name == "femail" || e.name == "memail") {
					if (e.value.length > 0) {
						eMail = e.value;
						if ((eMail.indexOf("@") != -1) && (eMail.indexOf(".") != -1)) {
							invalid_eMail = false;
						}
						else {
						  
							invalid_eMail = true;
						}
					}
				}	
				if (e.name == "phone") {
					num = e.value;
					num = stripChar(num, " ");
					num = stripChar(num, "-");
					num = stripChar(num, "+");
					if (num.length < 10) {
						invalid_phoneNumber = true;
					}	
				}
			
			}
			            
            if (e.name == "Email") {
				eMail = e.value;
				if ((eMail.indexOf("@") != -1) && (eMail.indexOf(".") != -1)) {
					invalid_eMail = false;
				}
				else {
				  
					invalid_eMail = true;
				}
			}	
						
			if (e.name == "Phone") {
				num = e.value;
				num = stripChar(num, " ");
				num = stripChar(num, "-");
				num = stripChar(num, "+");
				if (num.length < 10) {
					invalid_phoneNumber = true;
				}	
			}
			if (e.name == "Zip" || e.name == "zip") {
				num = e.value;
				num = stripChar(num, " ");
				num = stripChar(num, "-");
				if (!isNumber(num)) {
					invalid_Zip = true;
				}
				
				if (num.length < 5) {
					invalid_Zip = true;
				}	
			}
		
		}
		
		if (e.type == "select-one" && !e.optional) {
			if (e.value == "") {
				empty_fields += "\n            " + title;
				continue;
			}
			
		}
						
	}
		
	msg = "The form was not submited due to the following error(s).\n";
	
	upperLine = "\n_________________________________________________________\n\n";
	lowerLine = "_________________________________________________________\n";
	
	if (empty_fields) {
		msg += upperLine;
		msg += "The following field(s) must be filled in:\n";
		msg += lowerLine;
		msg += empty_fields;
		strReturn = false;
	}
	if (char_check) {
		msg += upperLine;
		msg += "The following field(s) need a numeric value:\n";
		msg += lowerLine;
		msg += char_check;
		strReturn = false;
	}
	if (invalid_eMail) {
		msg += upperLine;
		msg += "Please make sure all E-mail address entered is valid.\n";
		msg += lowerLine;
		strReturn = false;
	}
	if (invalid_phoneNumber) {
		msg += upperLine;
		msg += "Please enter a valid Phone Number with area code.\n";
		msg += lowerLine;
		strReturn = false;
	}
	if (invalid_Zip) {
		msg += upperLine;
		msg += "Please enter a valid Zip or Postal code.\n";
		msg += lowerLine;
		strReturn = false;
	}
	if (!strReturn) {
		alert(msg);
		//form.sbut.disabled = false;
	}
	
	return strReturn;
}	

function isDate(sDate) {
	var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
	
	return re.test(sDate) ;
}

function contactOptional(fObj) {
	fObj.title.optional = true;
	fObj.company.optional = true;
	fObj.phone.optional = true;
	fObj.email.optional = true;
	fObj.comments.optional = true;
}
