/*--------------Holdlink()---------------*/
function holdlink(id, sub_id){
	if(id=='services'){
	document.getElementById(id).className='fly current';
	document.getElementById(sub_id).className='current';
	} else
	document.getElementById(id).className='current';
}
/*--------------Holdlink()---------------*/

/*--------------------------CaseStudies() ----------------------------*/
function casestudies(path)
{

	var NewWin3;
	NewWin3=window.open('casestudies/'+path+'.htm','NewWin1','height=650,width=621,top=10,left=150,location=no,status=no,toolbar=no,menubar=no,scrollbars=yes');
	NewWin3.focus();
}

function wclose()
{
	window.close();	
}
/*--------------------------CaseStudies() ----------------------------*/

/*--------------------------consultation() ----------------------------*/
function consultation()
{

	var NewWin3;
	NewWin3=window.open("requestconsultation.htm",'NewWin1','height=500,width=420,top=10,left=150,location=no,status=no,toolbar=no,menubar=no,scrollbars=no');
	NewWin3.focus();
}
/*--------------------------consultation() ----------------------------*/

/*---------------------Photo Gallery Functions-------------------------*/
var currentImage = 0;
	var totalImages = 30;
	var viewSize = 4;
	var scroll_active=0;
	var imageHeight =308;
	var nextimage=4;
	var prevlink='img1';
	function moveToPrevious()
	{
	  if(currentImage > 0 && scroll_active==0)
	  {
		scroll_active=1;
		new Effect.Move('imageBoxInside', { x: 0, y: imageHeight, transition: Effect.Transitions.sinoidal });
		currentImage=currentImage-nextimage;
		setTimeout('scroll_active=0;',1000);
	  }
	  
	}
	
	
	function moveToNext()
	{
	  if(currentImage < totalImages-viewSize  && scroll_active==0)
	  {
		scroll_active=1;
		new Effect.Move('imageBoxInside', { x: 0, y: -imageHeight, transition: Effect.Transitions.sinoidal });
		currentImage=currentImage+nextimage;
		setTimeout('scroll_active=0;',1000);
	  }
	}

function changeImg(path) {
	document.getElementById(prevlink).className='gallery_image';
	document.getElementById('img'+path).className='gallery_image_selected';
	prevlink='img'+path;	
	
	if(document.getElementById('bigimg').src!='images/projectgallery/big'+path+'.jpg') {
	imgPreloader = new Image();
	
	// once image is preloaded, resize image container
	document.getElementById('bigimg').style.display="none";
	document.getElementById('loading_img').style.display="";
	imgPreloader.onload=function(){
	document.getElementById('loading_img').style.display="none";
	document.getElementById('bigimg').src='images/projectgallery/big'+path+'.jpg';
	//document.getElementById('bigimg').style.display="";
	new Effect.Appear('bigimg',{ duration: 0.7, from: 0.0, to: 1.0});
	imgPreloader.onload=function(){};
	imgPreloader.src="";
	}
	imgPreloader.src='images/projectgallery/big'+path+'.jpg';
	}
}
/*---------------------Photo Gallery Functions-------------------------*/

/*------------include function---------------------*/
function include_file(id, url) {
	
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
  if (req) {
    // Synchronous request, wait till we have it all
	req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } 
}
/*------------include function---------------------*/