function menu_toggle(elem)
{
	if(elem.className == "menu_selected")
		elem.className = "menu";
	else
		elem.className = "menu_selected";

}
function menu_over(elem)
{
	if(elem.className!='menu_selected')
		elem.className="menu_over";
}
function menu_out(elem)
{
	if(elem.className!='menu_selected')
		elem.className='menu'
}

function side_menu_toggle(elem)
{
	if(elem.className == "side_menu_selected")
		elem.className = "side_menu";
	else
		elem.className = "side_menu_selected";

}
function side_menu_over(elem)
{
	if(elem.className!='side_menu_selected')
		elem.className="side_menu_over";
}
function side_menu_out(elem)
{
	if(elem.className!='side_menu_selected')
		elem.className='side_menu'
}

function changeImg(picture) {
document.mainImg.src = picture
}

function thumb_over(elem)
{
	if(elem.className!='thumb_selected')
		elem.className="thumb_over";
}
function thumb_out(elem)
{
	if(elem.className!='thumb_selected')
		elem.className='thumb'
}



/* PHOTO GALLERY */

num_images = 30;

thumb_width=65;   /*change to match the height of all your images */
thumb_height=65;   /* change to match the width of all your images */

pic_width=250;   /*change to match the height of all your images */
pic_height=250;   /* change to match the width of all your images */

border_size=0;   /* change to the border size you want on the images */
alignment=1;      /* 0=left,1=center */

/* define image urls */

 

/* no need to edit past this point (unless you want to add more image slots) */

if (alignment==1)
 {
  cent_it="<center>";
  cent_it2="</center>";
 }
else
 {
  cent_it="";
  cent_it2="";
 }
 
function get_random(maxNum)
{
  if (Math.random && Math.round)
  {
    var ranNum= Math.round(Math.random()*(maxNum-1));
    ranNum+=1;
    return ranNum;
  }
  else
  {
  today= new Date();
  hours= today.getHours();
  mins=   today.getMinutes();
  secn=  today.getSeconds();
  if (hours==19)
   hours=18;
  var ranNum= (((hours+1)*(mins+1)*secn)%maxNum)+1;
  return ranNum;
  }
}


function get_random_image()
{ 
  var rand_num = get_random(num_images);  
  
  padded = PadDigits(rand_num,3);
  imageName = "images/gallery/"+padded+"_250.gif"

  document.write("<img src='"+imageName+"' width='250' height='166' style='BORDER-LEFT: #A0A0A0 1px solid; BORDER-TOP: #A0A0A0 1px solid; BORDER-RIGHT: #666 3px solid; BORDER-BOTTOM: #9B9B9B 3px solid;'>");
}

function get_image(num)
{ 
  
  padded = PadDigits(num,3);
  imageName = "images/gallery/"+padded+"_250.gif"

  document.write("<img src='"+imageName+"' width='250' height='166' style='BORDER-LEFT: #A0A0A0 1px solid; BORDER-TOP: #A0A0A0 1px solid; BORDER-RIGHT: #666 3px solid; BORDER-BOTTOM: #9B9B9B 3px solid;'>");
}

function get_Images()
{

  var NumRows = 3;
  var NumCols = 3;
  
  var i = 0;
  var j = 0;
  var rand_thumbs = new Array(NumRows*NumCols);
  rand_thumbs = GetUnique(NumRows*NumCols);
  
  document.write("<table>");
  
  var imgNum = 0;
  for (i=0;i<NumRows;i++)
  {
	  document.write("<tr>");
	  for(j=0;j<NumCols;j++)
	  {
	    	padded = PadDigits(rand_thumbs[imgNum],3);
	  	imageName = "images/gallery/"+padded+".gif"	  	
	  	thumbName = "images/gallery/"+padded+"_thumb.gif";
	  	largeImageName = "images/gallery/"+padded+"_large.gif";
	  	document.write("<td class='thumb' onmouseover='thumb_over(this);changeImg(\""+imageName+"\")'; onmouseout='thumb_out(this)'; onclick='enlarge(\""+largeImageName+"\")'>");
	  	document.write("<img src='"+thumbName+"' width='"+thumb_width+"' height='"+thumb_height+"' border='"+border_size+"'>");
  		document.write("</td>");
	  	imgNum++;
	  }
	  document.write("</tr>"); 
  }
  document.write("</table>");

}

function enlarge(imgName)
{
  newWindow="_blank";	
  window.open (imgName,newWindow)
}

function get_Gallery()
{
  thumb_width_gallery=60;   /*change to match the height of all your images */
  thumb_height_gallery=60;   /* change to match the width of all your images */
  var NumRows = 10;
  var NumCols = 3;
  var i = 0;
  var j = 0;
 
  var rand_thumbs = new Array(NumRows*NumCols);
  rand_thumbs = GetUnique(NumRows*NumCols);
  
  document.write("<table>");
  
  var imgNum = 0;
  for (i=0;i<NumRows;i++)
  {
	  document.write("<tr>");
	  for(j=0;j<NumCols;j++)
	  {
	    	padded = PadDigits(rand_thumbs[imgNum],3);
	  	imageName = "images/gallery/"+padded+"_gallery.gif"
	  	thumbName = "images/gallery/"+padded+"_thumb.gif";
	  	largeImageName = "images/gallery/"+padded+"_large.gif";
	  	document.write("<td class='thumb' onmouseover='thumb_over(this);changeImg(\""+imageName+"\")' onmouseout='thumb_out(this)'>");
	  	document.write("<img src='"+thumbName+"' width='"+thumb_width_gallery+"' height='"+thumb_height_gallery+"' border='"+border_size+"'>");
  		document.write("</td>");
	  	imgNum++;
	  }
	  document.write("</tr>"); 
  }
  document.write("</table>");

}


function get_home_Gallery()
{
  thumb_width_gallery=60;   /*change to match the height of all your images */
  thumb_height_gallery=60;   /* change to match the width of all your images */
  var NumRows = 10;
  var NumCols = 3;
  var i = 0;
  var j = 0;
 
  var rand_thumbs = new Array(NumRows*NumCols);
  rand_thumbs = GetUnique(NumRows*NumCols);
  
  document.write("<table>");
  
  var imgNum = 0;
  for (i=0;i<NumRows;i++)
  {
	  document.write("<tr>");
	  for(j=0;j<NumCols;j++)
	  {
	    	padded = PadDigits(rand_thumbs[imgNum],3);
	  	imageName = "images/gallery/"+padded+".gif"	  	
	  	thumbName = "images/gallery/"+padded+"_thumb.gif";
	  	largeImageName = "images/gallery/"+padded+"_large.gif";
	  	document.write("<td class='thumb' onmouseover='thumb_over(this);changeImg(\""+imageName+"\")' onmouseout='thumb_out(this)'>");
	  	document.write("<img src='"+thumbName+"' width='"+thumb_width_gallery+"' height='"+thumb_width_gallery+"' border='"+border_size+"'>");
  		document.write("</td>");
	  	imgNum++;
	  }
	  document.write("</tr>"); 
  }
  document.write("</table>");

}

  function GetUnique(numUniq)
  {
    NumUnique = numUniq;   //The number of unique numbers required
    var Found=false;
    var Current = new Array();
    var MaxValue=num_images; //(Example 2 is equal to: 0,1,2)
    var Count=0;
  
    for (i=0;Count<NumUnique;Count++)
    {
      Found=false;
      var rndValue = get_random(num_images);
      var j=0;
      for (j=0;j<Current.length;j++)
      {
        if (Current[j] == rndValue)
        {
          Found=true;
          break;
        }
      }
      if (Found)
      {
        Count--;
      } else {
        Current[Count]=rndValue;
      }
    }
    return Current;
  }

   function PadDigits(n, totalDigits) 
    { 
        n = n.toString(); 
        var pd = ''; 
        if (totalDigits > n.length) 
        { 
            for (i=0; i < (totalDigits-n.length); i++) 
            { 
                pd += '0'; 
            } 
        } 
        return pd + n.toString(); 
    } 
    
    
    
    function toggle_testimonial(elemID)
    {
    	elem = document.getElementById(elemID);


	
		if (elem.style.visibility=="hidden"){
			elem.style.visibility="visible";
			}
		else {
			elem.style.visibility="hidden";
			}
		



    }
    
    
    
    
