// JavaScript Document

//reloads the window if Nav4 resized
		function MM_reloadPage(init) {  
		  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
		  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
		}
		MM_reloadPage(true);

//preloads images so there is no delay on mouse-over
		var main = 'images/main_image.jpg';
		var gallery1 = 'images/nav_bar/nav_gallery.gif';
		var gallery2 = 'images/nav_bar/nav_gallery_glow.gif';
		var bridal1 = 'images/nav_bar/nav_bridal.gif';
		var bridal2 = 'images/nav_bar/nav_bridal_glow.gif';
		var artists1 = 'images/nav_bar/nav_artists.gif';
		var artists2 = 'images/nav_bar/nav_artists_glow.gif';
		var links1 = 'images/nav_bar/nav_links.gif';
		var links2 = 'images/nav_bar/nav_links_glow.gif';
		var cj1 = 'images/cynthia_jean.jpg';
		var cj2 = 'images/cynthia_jean_glow.jpg';
		var win_link = '';
		
		function MM_preloadImages() { //v3.0
		  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
			var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
		}
		MM_preloadImages(main, gallery1, gallery2, bridal1, bridal2, links1, links2, artists1, artists2, cj1, cj2);

//passes the gallery page number
		function submitForm(action){
			document.all.gallery_sort.innerHTML = document.all.gallery_sort.innerHTML + "<input type=hidden name=submit value='" + action +"'>";
			document.all.gallery_sort.submit();
		}
		
//changes link in gallery detail display window
		function swap_link(new_link){
		}

//expandable list function
		function WM_toggle(id) {
		  if (document.all){
			if(document.all[id].style.display == 'none'){
			  document.all[id].style.display = '';
			} else {
			  document.all[id].style.display = 'none';
			}
		  } else if (document.getElementById){
			if(document.getElementById(id).style.display == 'none'){
			  document.getElementById(id).style.display = 'block';
			} else {
			  document.getElementById(id).style.display = 'none';
			}
		  } else if(document.layers) {
			  if(parseInt(id + 1)){
			  ditem = id + 1;
			  } else {
			  ditem = document.WM.hirelist.names[id];
			  }
			  if(document.WM.hirelist.expandos[ditem].clip.bottom == 0) {
				 document.WM.hirelist.expandos[ditem].clip.bottom = document.WM.hirelist.heights[ditem];
			  } else {
			  document.WM.hirelist.expandos[ditem].clip.bottom = 0;
			  }
			  WM_align();
		  }
		}
		
		function WM_align() {
			var i,j,stupid_netscape_array_infinite_loop_error;
			stupid_netscape_array_infinite_loop_error = document.WM.hirelist.expandos.length;
			for(i=0; i<stupid_netscape_array_infinite_loop_error; i++) {
				j = i + 1;
				if(document.WM.hirelist.expandos[j]){
					if(document.layers) {
						document.WM.hirelist.expandos[j].top = document.WM.hirelist.expandos[i].top + document.WM.hirelist.expandos[i].clip.bottom;
					}
				}
			}
		}

		function WM_initialize_toolbar(){
			if(document.layers) {
				for(i=0; i<document.layers['list_container'].document.layers.length; i++){
					document.WM.hirelist.expandos[i] = document.layers['list_container'].document.layers[i];
					document.WM.hirelist.names[document.layers['list_container'].document.layers[i].name] = i;
					document.WM.hirelist.heights[i] = document.WM.hirelist.expandos[i].clip.bottom;
				}
				for (p=0;p<document.WM.hirelist.expandos.length;p=p+2){
					WM_toggle(p);
				}
				document.layers['list_container'].visibility = 'visible';
			} else if (document.all){
				for(i = 0; i < document.all('list_container').all.length; i++){
					document.all('list_container').all[i].style.position = 'relative';
					if(document.all('list_container').all[i].className == 'toolbar'){
					document.all('list_container').all[i].style.display = 'none';
					}
				}
				document.all('list_container').style.visibility = 'visible';
			} else if (document.getElementsByTagName && document.getElementById){
				var contained = document.getElementById('list_container').getElementsByTagName('div');
				for(i = 0; i < contained.length; i++){
					contained[i].style.position = 'relative';
					if(contained[i].getAttribute('class') == 'toolbar'){
					contained[i].style.display = 'none';
					}
				}
			}
			WM_toggle('alabama');
			WM_toggle('florida');
			WM_toggle('idaho');
			WM_toggle('louisiana');
			WM_toggle('north_carolina');
			WM_toggle('south_carolina');
			WM_toggle('tennessee');
			WM_toggle('texas');
		}
