function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01
	var imageWidth2 = 700;	
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><head>'); 
	newWindow.document.write('<meta http-equiv="imagetoolbar" content="no">'); 
	newWindow.document.write('<title>'+alt+'</title>'); 
	newWindow.document.write('<script language="JavaScript">');
	newWindow.document.write('var message="Function Disabled!";');
	newWindow.document.write('function clickIE() {if (document.all) {alert(message);return false;}}');
	newWindow.document.write('function clickNS(e) {if ');
	newWindow.document.write('(document.layers||(document.getElementById&&!document.all)) {');
	newWindow.document.write('if (e.which==2||e.which==3) {alert(message);return false;}}}');
	newWindow.document.write('if (document.layers) ');
	newWindow.document.write('{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}');
	newWindow.document.write('else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}');
	newWindow.document.write('document.oncontextmenu=new Function("return false")');
	newWindow.document.write('</script>');
	newWindow.document.write('</head>'); 
	newWindow.document.write('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->
/*
var message="Function Disabled!";
///////////////////////////////////
function clickIE() {if (document.all) {alert(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {alert(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")*/

<!-- ############################################################################### -->
<!-- ############################################################################### -->

//** Featured Content Slider script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
//** Last updated: Oct 28th, 06

////Ajax related settings
var csbustcachevar=0 //bust potential caching of external pages after initial Ajax request? (1=yes, 0=no)
var csloadstatustext="<img src='loading.gif' /> Requesting content..." //HTML to indicate Ajax page is being fetched
var csexternalfiles=[] //External .css or .js files to load to style the external content(s), if any. Separate multiple files with comma ie: ["cat.css", dog.js"]

////NO NEED TO EDIT BELOW////////////////////////
var enablepersist=true
var slidernodes=new Object() //Object array to store references to each content slider's DIV containers (<div class="contentdiv">)
var csloadedobjects="" //Variable to store file names of .js/.css files already loaded (if Ajax is used)

function ContentSlider(sliderid, autorun){
var slider=document.getElementById(sliderid)
slidernodes[sliderid]=[] //Array to store references to this content slider's DIV containers (<div class="contentdiv">)
ContentSlider.loadobjects(csexternalfiles) //Load external .js and .css files, if any
var alldivs=slider.getElementsByTagName("div")
for (var i=0; i<alldivs.length; i++){
if (alldivs[i].className=="contentdiv"){
slidernodes[sliderid].push(alldivs[i]) //add this DIV reference to array
if (typeof alldivs[i].getAttribute("rel")=="string") //If get this DIV's content via Ajax (rel attr contains path to external page)
ContentSlider.ajaxpage(alldivs[i].getAttribute("rel"), alldivs[i])
}
}
ContentSlider.buildpagination(sliderid)
var loadfirstcontent=true
if (enablepersist && getCookie(sliderid)!=""){ //if enablepersist is true and cookie contains corresponding value for slider
var cookieval=getCookie(sliderid).split(":") //process cookie value ([sliderid, int_pagenumber (div content to jump to)]
if (document.getElementById(cookieval[0])!=null && typeof slidernodes[sliderid][cookieval[1]]!="undefined"){ //check cookie value for validity
ContentSlider.turnpage(cookieval[0], parseInt(cookieval[1])) //restore content slider's last shown DIV
loadfirstcontent=false
}
}
if (loadfirstcontent==true) //if enablepersist is false, or cookie value doesn't contain valid value for some reason (ie: user modified the structure of the HTML)
ContentSlider.turnpage(sliderid, 0) //Display first DIV within slider
if (typeof autorun=="number" && autorun>0) //if autorun parameter (int_miliseconds) is defined, fire auto run sequence
window[sliderid+"timer"]=setTimeout(function(){ContentSlider.autoturnpage(sliderid, autorun)}, autorun)
}

ContentSlider.buildpagination=function(sliderid){
var paginatediv=document.getElementById("paginate-"+sliderid) //reference corresponding pagination DIV for slider
var pcontent=""
for (var i=0; i<slidernodes[sliderid].length; i++) //For each DIV within slider, generate a pagination link
pcontent+='<a href="#" onClick=\"ContentSlider.turnpage(\''+sliderid+'\', '+i+'); return false\">'+(i+1)+'</a> '
pcontent+='<a href="#" style="font-weight: bold;" onClick=\"ContentSlider.turnpage(\''+sliderid+'\', parseInt(this.getAttribute(\'rel\'))); return false\">Next</a>'
paginatediv.innerHTML=pcontent
paginatediv.onclick=function(){ //cancel auto run sequence (if defined) when user clicks on pagination DIV
if (typeof window[sliderid+"timer"]!="undefined")
clearTimeout(window[sliderid+"timer"])
}
}

ContentSlider.turnpage=function(sliderid, thepage){
var paginatelinks=document.getElementById("paginate-"+sliderid).getElementsByTagName("a") //gather pagination links
for (var i=0; i<slidernodes[sliderid].length; i++){ //For each DIV within slider
paginatelinks[i].className="" //empty corresponding pagination link's class name
slidernodes[sliderid][i].style.display="none" //hide DIV
}
paginatelinks[thepage].className="selected" //for selected DIV, set corresponding pagination link's class name
slidernodes[sliderid][thepage].style.display="block" //show selected DIV
//Set "Next" pagination link's (last link within pagination DIV) "rel" attribute to the next DIV number to show
paginatelinks[paginatelinks.length-1].setAttribute("rel", thenextpage=(thepage<paginatelinks.length-2)? thepage+1 : 0)
if (enablepersist)
setCookie(sliderid, sliderid+":"+thepage)
}

ContentSlider.autoturnpage=function(sliderid, autorunperiod){
var paginatelinks=document.getElementById("paginate-"+sliderid).getElementsByTagName("a") //Get pagination links
var nextpagenumber=parseInt(paginatelinks[paginatelinks.length-1].getAttribute("rel")) //Get page number of next DIV to show
ContentSlider.turnpage(sliderid, nextpagenumber) //Show that DIV
window[sliderid+"timer"]=setTimeout(function(){ContentSlider.autoturnpage(sliderid, autorunperiod)}, autorunperiod)
}

function getCookie(Name){ 
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return ""
}

function setCookie(name, value){
document.cookie = name+"="+value
}

////////////////Ajax Related functions //////////////////////////////////

ContentSlider.ajaxpage=function(url, thediv){
var page_request = false
var bustcacheparameter=""
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
thediv.innerHTML=csloadstatustext
page_request.onreadystatechange=function(){
ContentSlider.loadpage(page_request, thediv)
}
if (csbustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}

ContentSlider.loadpage=function(page_request, thediv){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
thediv.innerHTML=page_request.responseText
}

ContentSlider.loadobjects=function(externalfiles){ //function to load external .js and .css files. Parameter accepts a list of external files to load (array)
for (var i=0; i<externalfiles.length; i++){
var file=externalfiles[i]
var fileref=""
if (csloadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
csloadedobjects+=file+" " //Remember this object as being already added to page
}
}
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->


/***********************************************
* Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
* Copyright 2002-2007 by Sharon Paine
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* IMPORTANT: Put script after tooltip div or 
	 put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;

var origWidth, origHeight;

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 0;
var tipHeight= 0;
var offX= 20;	// how far from mouse to show tip
var offY= 12; 
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipBgColor= "#FFFFFF"; 
var tipBorderColor= "#F8CE6C";
var tipBorderWidth= 2;
var tipBorderStyle= "ridge";
var tipPadding= 0;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)

////////////////////  END OF CUSTOMIZATION AREA  ///////////////////


// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
//var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img width="' + tipWidth + '" width="' + tipHeight + '"src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		document.onmousemove = trackMouse;
	}
}

/////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes 
//			it to tipDiv
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,imgLoc,ntipWidth,ntipHeight) {
  
  var csstipWidth = ntipWidth + 5;
	tipcss.width = csstipWidth+"px";
	
  var startStr = '<table width="' + ntipWidth + '"><tr><td align="center" width="100%"><img width="' + ntipWidth + '" width="' + ntipHeight + '"src="';

	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	if (ie4||ie5||ns5) {
		var tip = startStr + imgLoc + midStr + endStr;
		tipcss.backgroundColor = tipBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
	standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
	mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position, 
//		offset amounts and tooltip width to position
//		tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
	if (!tipFollowMouse) {
		standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
		mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
		mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
	var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = mouseX-(tpWd+offX)+"px";
	else tipcss.left = mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = winHt-(tpHt+offY)+"px";
	else tipcss.top = mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

document.write('<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>')

<!-- ############################################################################### -->
<!-- ############################################################################### -->

function InstantGallery(galleryType)
{
	var galleryName;
	
  switch(galleryType)
	{
      case 1:  galleryName = "BlackWhite"; break;
      case 2:  galleryName = "Casual"; break;
      case 3:  galleryName = "Commercial"; break;
      case 4:  galleryName = "Fashion"; break;
      case 5:  galleryName = "Glamour"; break;
      case 6:  galleryName = "Headshots"; break;
      case 7:  galleryName = "Swimsuit"; break;
   }      
  
   PortfolioType(galleryName,1);

   var numImages = 9;
   var galleryPhoto = new Array(numImages);
   var galleryDisplay = " ";
   var gallerySpacer;
     
   for (var i=9; i>0; i--)
   {
      galleryPhoto[i] = "<a href='javascript:;'> <img src='images/Portfolio/" + galleryName + "/tn_" + galleryName +  i + ".jpg' width='50' height='75' alt='Click To Enlarge' onMouseOver=PortfolioType('"+ galleryName + "','" + i +"') onClick=openPictureWindow_Fever('undefined','images/Portfolio/" + galleryName + "/" + galleryName +  i + ".jpg','534','800','ApexVisions.com','','') border='2'></a>";
      
      if ((i == 3) || (i == 6)) {gallerySpacer = "<br />";} else {gallerySpacer = " ";}

      galleryDisplay = galleryPhoto[i] + gallerySpacer + galleryDisplay;
   }

   document.getElementById('gallery').innerHTML= galleryDisplay;
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->

function PortfolioType(pictureGallery,pictureNum)
{
     var photo1 = "<img src='images/Portfolio/" + pictureGallery + "/pr_" + pictureGallery + pictureNum + ".jpg' width='169' height='254'>"; 
     document.getElementById('picturePreview').innerHTML= photo1;

}

<!-- ############################################################################### -->
<!-- ############################################################################### -->

var emailgood=true;
var verifygood=true;
var phonegood=true;
var zipcodegood=true;
var weightgood=true;
var birthdategood=true;
var otherfieldsgood=true;
var securitygood=true;
var invalidemail = "Invalid Email Address";
var invalidverify = "Failed Email Verification";
var invalidphone = "Invalid Phone Number";
var invalidzipcode = "Invalid Zip Code";
var invalidentry = "Complete Required Item";
var invalidweight = "Invalid Weight";
var invalidsecurity = "Invalid Security Code";
var errormessage = "Please Fix Error Indicated Above";
var errorcount = 0;

<!-- ############################################################################### -->
<!-- ############################################################################### -->

function checkemail(eemail,vemail){

   var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

   eemail.value = eemail.value.toLowerCase();
   vemail.value = vemail.value.toLowerCase();
   
   if (filter.test(eemail.value))
   {
      emailgood=true;
      clearErrorMessage('emessage');
      
      if (vemail.value != "")
      {
      	  verifyemail(eemail,vemail);
      }
   }
   else
   {
      submitErrorMessage('emessage',invalidemail);
      emailgood=false;
   }
    return (emailgood);
}

<!-- ############################################################################### -->

function verifyemail(eemail,vemail)
{
   var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

   eemail.value = eemail.value.toLowerCase();
   vemail.value = vemail.value.toLowerCase();

   if (filter.test(vemail.value))
   {
	    if (eemail.value == vemail.value)
	    {
         verifygood=true;
         clearErrorMessage('vmessage');
	    }
	    else
	  	{
         submitErrorMessage('vmessage',invalidverify);
         verifygood=false;
	    }
	 }
	 else
	 {
      submitErrorMessage('vmessage',invalidemail);
      emailgood=false;
	 }
   return (verifygood);
}

<!-- ############################################################################### -->

function checkPhone(phone)
{
   var filter = /^\s*\(?\d{3}\)?[\-\ ]?\d{3}[\-\ ]?\d{4}\s*$/;
   var phoneLn = phone.value.length;
   var phoneDigit;
   var phoneString ="";
   var app =  document.getElementById("modelApp");
  
   if (filter.test(phone.value))
   {
      phonegood=true;
      clearErrorMessage('pmessage');
      
      for (var i=0; i<phoneLn; i++)
      {
      	 phoneDigit = parseInt(phone.value.substr(i,1));

         if (phoneDigit <= 9)      	 
         {
      	 	  phoneString += phoneDigit.toString();
      	 } 
      }
      
      app.phone.value = "(" + phoneString.substr(0,3) + ") " + phoneString.substr(3,3) + "-" + phoneString.substr(6,4);
   }
   else
   {
      submitErrorMessage('pmessage',invalidphone);
      phonegood=false;
   }
    return (phonegood);
}

<!-- ############################################################################### -->

function checkZipCode(zipcode)
{
   var filter = /^\d{5}(\-\d{4})?$/;

   if (filter.test(zipcode.value))
   {
      zipcodegood=true;
      clearErrorMessage('zmessage');
   }
   else
   {
      submitErrorMessage('zmessage',invalidzipcode);
      zipcodegood=false;
   }
    return (zipcodegood);
}

<!-- ############################################################################### -->

function checkWeight(weight)
{
   var filter = /^[0-9]{2,3}?$/;

   if (filter.test(weight.value))
   {
      weightgood=true;
      clearErrorMessage('weightm');
   }
   else
   {
      submitErrorMessage('weightm',invalidweight);
      weightgood=false;
   }
    return (weightgood);
}

<!-- ############################################################################### -->

function checkBirthDate(birthdate) 
{
   var filter = /^(\d{1,2})(\/)(\d{1,2})\2(\d{4})$/;
   var invalidBirthDate;
   var app =  document.getElementById("modelApp");

   if (!filter.test(birthdate.value))
   {
      invalidBirthDate = "Invalid Date Format";
      submitErrorMessage('dmessage',invalidBirthDate);
      birthdategood=false;
      return (birthdategood);
   }
   
   var bdate = birthdate.value;
   var matchArray = bdate.split("/");
   var month = parseInt(matchArray[0],10);
   var day = parseInt(matchArray[1],10);
   var year = parseInt(matchArray[2],10);

   if (month < 1 || month > 12) 
   { 
      invalidBirthDate = "Invalid Month Range";
      submitErrorMessage('dmessage',invalidBirthDate);
      birthdategood=false;
      return (birthdategood);
   }

   if (day < 1 || day > 31) 
   {
      invalidBirthDate = "Invalid Day Range";
      submitErrorMessage('dmessage',invalidBirthDate);
      birthdategood=false;
      return (birthdategood);
   }

   if ((month==4 || month==6 || month==9 || month==11) && day==31) 
   {
      invalidBirthDate = "Invalid Day For Month";
      submitErrorMessage('dmessage',invalidBirthDate);
      birthdategood=false;
      return (birthdategood);
   }

   if (month == 2) 
   { 
      var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));

      if (day>29 || (day==29 && !isleap)) 
      {
         invalidBirthDate = "Invalid Day For Month";
         submitErrorMessage('dmessage',invalidBirthDate);
         birthdategood=false;
         return (birthdategood);
      }
   }

//   app.dayofbirth.value = month.toString() + "/" + day.toString() + "/" + year.toString();
   birthdategood=true;
   clearErrorMessage('dmessage');
   return (birthdategood);
}

<!-- ############################################################################### -->

function checkOtherFields()
{
   var app =  document.getElementById("modelApp");

   otherfieldsgood=true;
   
   if (app.firstname.value =="")   {otherfieldsgood=false; submitErrorMessage('firstnamem',invalidentry);} else {clearErrorMessage('firstnamem');}
   if (app.lastname.value =="")    {otherfieldsgood=false; submitErrorMessage('lastnamem',invalidentry);}  else {clearErrorMessage('lastnamem');}
   if (app.email.value =="")       {otherfieldsgood=false; submitErrorMessage('emessage',invalidentry);}   else {checkemail(app.email,app.emailverify);}
   if (app.emailverify.value =="") {otherfieldsgood=false; submitErrorMessage('vmessage',invalidentry);}   else {verifyemail(app.email,app.emailverify);}
   if (app.phone.value =="")       {otherfieldsgood=false; submitErrorMessage('pmessage',invalidentry);}   else {checkPhone(app.phone);}
   if (app.address.value =="")     {otherfieldsgood=false; submitErrorMessage('addressm',invalidentry);}   else {clearErrorMessage('addressm');}
   if (app.city.value =="")        {otherfieldsgood=false; submitErrorMessage('citym',invalidentry);}      else {clearErrorMessage('citym');}
   if (app.state.value =="")       {otherfieldsgood=false; submitErrorMessage('statem',invalidentry);}     else {clearErrorMessage('statem');}
   if (app.zipcode.value =="")     {otherfieldsgood=false; submitErrorMessage('zmessage',invalidentry);}   else {checkZipCode(app.zipcode);}
   if (app.country.value =="")     {otherfieldsgood=false; submitErrorMessage('countrym',invalidentry);}   else {clearErrorMessage('countrym');}
   if (app.sex.value =="")         {otherfieldsgood=false; submitErrorMessage('sexm',invalidentry);}       else {clearErrorMessage('sexm');}
   if (app.race.value =="")        {otherfieldsgood=false; submitErrorMessage('racem',invalidentry);}      else {clearErrorMessage('racem');}
   if (app.dayofbirth.value =="")  {otherfieldsgood=false; submitErrorMessage('dmessage',invalidentry);}   else {checkBirthDate(app.dayofbirth);}
   if (app.height.value =="")      {otherfieldsgood=false; submitErrorMessage('heightm',invalidentry);}    else {clearErrorMessage('heightm');}
   if (app.weight.value =="")      {otherfieldsgood=false; submitErrorMessage('weightm',invalidentry);}    else {checkWeight(app.weight);}
   if (app.chest.value =="")       {otherfieldsgood=false; submitErrorMessage('chestm',invalidentry);}     else {clearErrorMessage('chestm');}
   if (app.cupsize.value =="")     {otherfieldsgood=false; submitErrorMessage('cupsizem',invalidentry);}   else {clearErrorMessage('cupsizem');}
   if (app.waist.value =="")       {otherfieldsgood=false; submitErrorMessage('waistm',invalidentry);}     else {clearErrorMessage('waistm');}
   if (app.hips.value =="")        {otherfieldsgood=false; submitErrorMessage('hipsm',invalidentry);}      else {clearErrorMessage('hipsm');}
   if (app.haircolor.value =="")   {otherfieldsgood=false; submitErrorMessage('haircolorm',invalidentry);} else {clearErrorMessage('haircolorm');}
   if (app.hairstyle.value =="")   {otherfieldsgood=false; submitErrorMessage('hairstylem',invalidentry);} else {clearErrorMessage('hairstylem');}
   if (app.eyecolor.value =="")    {otherfieldsgood=false; submitErrorMessage('eyecolorm',invalidentry);}  else {clearErrorMessage('eyecolorm');}
   if (app.shoesize.value =="")    {otherfieldsgood=false; submitErrorMessage('shoesizem',invalidentry);}  else {clearErrorMessage('shoesizem');}
   if (app.source.value =="")      {otherfieldsgood=false; submitErrorMessage('sourcem',invalidentry);}    else {clearErrorMessage('sourcem');}
   if (app.experience.value =="")  {otherfieldsgood=false; submitErrorMessage('experiencem',invalidentry);}else {clearErrorMessage('experiencem');}
   if (app.travel.value =="")      {otherfieldsgood=false; submitErrorMessage('travelm',invalidentry);}    else {clearErrorMessage('travelm');}
   if (app.contact.value =="")     {otherfieldsgood=false; submitErrorMessage('contactm',invalidentry);}   else {clearErrorMessage('contactm');}
   if (app.package.value =="")     {otherfieldsgood=false; submitErrorMessage('packagem',invalidentry);}   else {clearErrorMessage('packagem');}
   if (app.security_code.value ==""){otherfieldsgood=false; submitErrorMessage('securitym',invalidentry);}   else {checkSecurity(app.security_code);}

}

<!-- ############################################################################### -->

function checkAll(theAction)
{
   var theForm = document.getElementById("modelApp");
   var theFormElm;
    
   for (var i=0; i<theForm.length; i++)
   {
      theFormElm = theForm.elements[i];

      if (theFormElm.type == "checkbox" )
      {
         if (theAction == 1)
         {
            theFormElm.checked=true;
         }
         else  
         {
         	  theFormElm.checked=false;
         }
      }
   }
}

<!-- ############################################################################### -->

function clearErrorMessage(messageArea)
{
	document.getElementById(messageArea).innerHTML= "";

  if ((emailgood) && (verifygood) && (phonegood) && (zipcodegood) && (birthdategood) && (weightgood) && (otherfieldsgood) && (securitygood)) 
  {
  	  document.getElementById('erroralert').innerHTML= ""; 
  }
}

<!-- ############################################################################### -->

function submitErrorMessage(messageArea,message)
{
     document.getElementById(messageArea).innerHTML= message;
     document.getElementById(messageArea).style.color="red";

     document.getElementById('erroralert').innerHTML= errormessage;
     document.getElementById('erroralert').style.color="red";
}

<!-- ############################################################################### -->

var xmlhttp=false;
var pageResponse=null;

function checkSecurity(s_code)
{
	    var security_code = s_code.value;
	    
      xmlhttp=GetXmlHttpObject();
      if (xmlhttp==null) {alert ("Browser does not support HTTP Request"); return; }	
      xmlhttp.open('get', 'http://www.apexvisions.com/phpClasses/ApexV_Security.php?security_code='+security_code, false);
   
      xmlhttp.onreadystatechange = function (){
   	     if (xmlhttp.readyState == 4) 
         {
            if (xmlhttp.status == 200) 
            {
               security = xmlhttp.responseText; 

               if (security == 1)
               {
                  securitygood=true;
                  clearErrorMessage('securitym');
               }
               else
               {
                  submitErrorMessage('securitym',invalidsecurity);
                  securitygood=false;
               }
            }
         }
    	};
      xmlhttp.send(null);	
      
      return(securitygood);
}

<!-- ############################################################################### -->

var goodSubmit;
function confirmSubmit()
{
	//idform = document.modelapp;
	
	checkOtherFields();
	
  if ((emailgood) && (verifygood) && (phonegood) && (zipcodegood) && (birthdategood) && (weightgood) && (otherfieldsgood) && (securitygood)) 
	{
	   goodSubmit=true;
     //idform.submit();
	}
	else
	{
		 goodSubmit=false;
	}
  return goodSubmit;
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->

function checkContactOtherFields()
{
   var app =  document.getElementById("modelApp");
   
   otherfieldsgood=true;
   
   if (app.firstname.value =="")   {otherfieldsgood=false; submitErrorMessage('firstnamem',invalidentry);} else {clearErrorMessage('firstnamem');}
   if (app.lastname.value =="")    {otherfieldsgood=false; submitErrorMessage('lastnamem',invalidentry);}  else {clearErrorMessage('lastnamem');}
   if (app.email.value =="")       {otherfieldsgood=false; submitErrorMessage('emessage',invalidentry);}   else {checkemail(app.email,app.emailverify);}
   if (app.emailverify.value =="") {otherfieldsgood=false; submitErrorMessage('vmessage',invalidentry);}   else {verifyemail(app.email,app.emailverify);}
   if (app.phone.value =="")       {otherfieldsgood=false; submitErrorMessage('pmessage',invalidentry);}   else {checkPhone(app.phone);}
   if (app.address.value =="")     {otherfieldsgood=false; submitErrorMessage('addressm',invalidentry);}   else {clearErrorMessage('addressm');}
   if (app.city.value =="")        {otherfieldsgood=false; submitErrorMessage('citym',invalidentry);}      else {clearErrorMessage('citym');}
   if (app.state.value =="")       {otherfieldsgood=false; submitErrorMessage('statem',invalidentry);}     else {clearErrorMessage('statem');}
   if (app.zipcode.value =="")     {otherfieldsgood=false; submitErrorMessage('zmessage',invalidentry);}   else {checkZipCode(app.zipcode);}
   if (app.country.value =="")     {otherfieldsgood=false; submitErrorMessage('countrym',invalidentry);}   else {clearErrorMessage('countrym');}
   if (app.source.value =="")      {otherfieldsgood=false; submitErrorMessage('sourcem',invalidentry);}    else {clearErrorMessage('sourcem');}
   if (app.contact.value =="")     {otherfieldsgood=false; submitErrorMessage('contactm',invalidentry);}   else {clearErrorMessage('contactm');}
   if (app.security_code.value ==""){otherfieldsgood=false; submitErrorMessage('securitym',invalidentry);}   else {checkSecurity(app.security_code);}

}

<!-- ############################################################################### -->

var goodSubmit;
function confirmContactSubmit()
{
	//idform = document.modelapp;
	
	checkContactOtherFields();
	
  if ((emailgood) && (verifygood) && (phonegood) && (zipcodegood) && (otherfieldsgood) && (securitygood)) 
	{
	   goodSubmit=true;
     //idform.submit();
	}
	else
	{
		 goodSubmit=false;
	}
  return goodSubmit;
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->

function opn(link, theHeight, theWidth,type)
{
      open(link, type,'toolbar=no,height=' + theHeight + ',width=' + theWidth + ',directories=no,status=no,scrollbars=no,resize=no,menubar=no');
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->

function shortCut(ddl)
{
   if(ddl == null){return;}
	 
	 if(!ddl.selectedIndex && !(ddl.selectedIndex > 0)){return;}
	 
	 var selectedVal = ddl.options[ddl.selectedIndex].value.toLowerCase();
   var sTargetUrl  = '';                      
		    
   switch(selectedVal)
   {   
      case 'home':        sTargetUrl = 'http://www.apexvisions.com'; break;                                
      case 'contact':     sTargetUrl = 'http://www.apexvisions.com/Contact2.php'; break;                                
      case 'modelapp':    sTargetUrl = 'http://www.apexvisions.com/ModelApp2.php'; break;                                
      case 'rates':       sTargetUrl = 'http://www.apexvisions.com/RatesAndPackages2.php'; break;                                
      case 'aboutus':     sTargetUrl = 'http://www.apexvisions.com/AboutUs2.php'; break;                                
      case 'photography': sTargetUrl = 'http://www.apexvisions.com/Photography2.php'; break;                                
      case 'history':     sTargetUrl = 'http://www.apexvisions.com/History2.php'; break;                                
      case 'teamapex':    sTargetUrl = 'http://www.apexvisions.com/TeamApex2.php'; break;                                
      case 'compcard':    sTargetUrl = 'http://www.apexvisions.com/CompCard2.php'; break;                                
      case 'website':     sTargetUrl = 'http://www.apexvisions.com/WebSite2.php'; break;                                
      case 'touchups':    sTargetUrl = 'http://www.apexvisions.com/TouchUps2.php'; break;                
      case 'portfolio':   sTargetUrl = 'http://www.apexvisions.com/Portfolio2.php'; break;                
      default:
   } 

	location.href = sTargetUrl;
}

<!-- ############################################################################### -->
<!-- ############################################################################### -->

function SpotLightModel(modelNum,actionType)
{

  var modelName = "Lachyara";
    
  if (actionType == 1)
  {
     var photo1 = "<img src='http://www.apexvisions.com/images/ModelSpotLight/" + "pr_ModelSpotLight" + modelNum + ".jpg' width='180' height='270'>"; //
     document.getElementById('spotLightModel').innerHTML= photo1;
  } 
  else 	
	{
		 var Mname = "http://www.apexvisions.com/images/ModelSpotLight/ModelSpotLight" + modelNum + ".jpg";
		 openPictureWindow_Fever('undefined',Mname,'534','800',modelName,'','');
	}
}

<!-- ############################################################################### -->

function GetXmlHttpObject()
{

//Try to set up an IE XMLHTTP Request Object
 try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (error) {
try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (error) {
      xmlhttp = false;
}
}
//Try to set up Mozilla and Safari XMLHTTP Request Object
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
      try {
            xmlhttp = new XMLHttpRequest();
      } catch (error) {
            xmlhttp=false;
      }
}
//Try to set up IceBrowser XMLHTTP Request Object
if (!xmlhttp && window.createRequest) {
      try {
            xmlhttp = window.createRequest();
      } catch (error) {
            xmlhttp=false;
      }
}
  
   return xmlhttp;
}
