/*
//---------------------------------------------------------------------------//
//              By: kevin@chard.ca                              //
//---------------------------------------------------------------------------//
*/

var isdhtml = ( document.getElementById || document.all || document.layers ); 

	// ONMOUSEOVER
	function omosON(sMsg){
	   window.status="Numeral - " + statusMsg[sMsg];
	   }



	// ONMOUSEOUT
	function omosOFF(){
	    window.status=' ';
	   }


     function loadiMg(img_num){ /* display portfolio image */
        if(!isdhtml){
              alert('sorry your browser does not support the proper DOM.');
           }else{
           a = new getObj('backdrop');
           a.style.display='block';
           b = new getObj('flash');
           b.style.display='none';
           x = new getObj('backdrop');
           x.innerHTML = '<div id="info" align="left"></div>'+img_obj[img_num]+' ';

           infDisplay(img_num);
      }
     }


     // CAPTION INFORMATION DISPLAY
     var isopen= 0;

     function closeBD(){ /* close content display set image back to blank.gif */
        if(!isdhtml){
              alert('sorry your browser does not support the proper DOM.');
           }else{

           a = new getObj('backdrop');
           a.style.display='none';
           b = new getObj('flash');
           b.style.display='block';
           x = new getObj('backdrop');
           x.innerHTML =  '<div id="info" align="left"></div><img src="images/blank.gif" width="740" height="460" alt=""/>';
           isopen = 0;

      }
     }

     function infDisplay(img_num){
         if(!isdhtml){
              alert('sorry your browser does not support the proper DOM.');
            }else{
     // caption display variables
     var capClose     ='<a href="javascript:closeBD();"><img src="images/ctrlbox/close.gif" border="0" width="45" height="16" alt="close" title="close" /></a>';
     var capHide      ='<a href="javascript:infDisplay(' + img_num +  ');" title="hide information"><img src="images/ctrlbox/view.gif" border="0" width="45" height="16" alt="view samples" title="view samples"/></a>';
     var capShow      ='<a href="javascript:infDisplay(' + img_num + ');" title="show information"><img src="images/ctrlbox/info.gif" border="0" width="45" height="16" alt="show information" title="show information" /></a>';
     var capNone      ='<img src="images/ctrlbox/none.gif" border="0" width="45" height="16" alt="none" title="none" />';
     var capNextPrev  ='<a href="javascript:prev(' +img_num+  ');"><img src="images/ctrlbox/prev.gif" border="0" width="45" height="16" alt="prev" title="prev" /></a><a href="javascript:next(' +img_num+  ');"><img src="images/ctrlbox/next.gif" border="0" width="45" height="16" alt="next" title="next" /></a>';
      // IF OPEN
      isopen++

      if(inf_obj[img_num] == ""){

         a = new getObj('info');
         a.style.display='block';        
         x = new getObj('info');
         x.innerHTML =  '<div class="capMenu_hide">'+capClose+''+capNone+''+capNextPrev+'</div>';
         isopen = 0;



          }else if(isopen == 1){

          a = new getObj('info');
          a.style.display='block';
          x = new getObj('info');
          x.innerHTML =  '<div id="capMenu_hide" class="capMenu_hide">'+capClose+''+capShow+''+capNextPrev+'</div>';

               }else{

           a = new getObj('info');
           a.style.display='block';
           x = new getObj('info');
           x.innerHTML =   '<div class="bg_fade"><div class="capMenu">'+capClose+''+capHide+''+capNextPrev+'</div><div class="inf_bg"><div class="inf_con">'+inf_obj[img_num]+'</div></div></div>';
           isopen = 0;

          }
         }
        }



       // NEXT BUTTON SETUP
       function next(img_num){
          isopen = 0;
          if(img_num == 5){
             img_num = 0;
             loadiMg(img_num);
            }else{
             img_num++
             loadiMg(img_num);
         }
       }

       // PREV BUTTON SETUP
       function prev(img_num){
          isopen = 0;
          if(img_num == 0){
             img_num = 5;
             loadiMg(img_num);
            }else{
             img_num--
             loadiMg(img_num);
         }
       }





// MINI WINDOW FUNCTIONS

     function smHide(){
        if(!isdhtml){
              alert('sorry your browser does not support the proper DOM.');
          }else{
             a = new getObj('samples');
             a.style.display='none';
             b = new getObj('fadeout');
             b.style.display='none';
             c = new getObj('flash');
             c.style.display='block';
             winframe.location='miniwin.php?pl=default';

      }
     }





     function miniWin(minLoc){
       if(!isdhtml){

          }else{

          a = new getObj('samples');
          a.style.display='block';
          b = new getObj('fadeout');
          b.style.display='block';
          c = new getObj('flash');
          c.style.display='none';

          if(navigator.appName=="netscape"){
             frames['winframe'].location.href= minLoc+'ns';
          }else{
             frames['winframe'].location.href= minLoc;
          }

      }
     }


      // BACKGROUND ALERT CONFIRM CLOSE
      var numclick  = 0;

    function clickout(){
        numclick++
      if(numclick == 2){
        numclick = 0;

      var ok = confirm("You must close the 'MiniWindow'\nBefore you can select a new section! \nSelect OK to close window!");

          if(ok == true){
              ok = smHide();
              }
             }
            }


       // PRINT FUNCTION

    function printpage(){
     if(!netmoz){
       window.print();
    }else{
       window.print();
       }
     }  


       // OPEN NEW BROWSER WINDOW
       function winBRopen(theURL, Name, popW, popH, scroll) { // V 1.0
          var winleft = (screen.width - popW) / 2;
          var winUp = (screen.height - popH) / 2;

        winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable=no'
        Win = window.open(theURL, Name, winProp)
                    if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }}
