/* surtreat javascript file */

//preload indicator images
preload("ind_home_off", "/images/layout/t.gif");
preload("ind_home_on", "/images/icons/indicator_blue.gif");
preload("ind_about_off", "/images/layout/t.gif");
preload("ind_about_on", "/images/icons/indicator_blue.gif");
preload("ind_sales_off", "/images/layout/t.gif");
preload("ind_sales_on", "/images/icons/indicator_blue.gif");
preload("ind_tech_off", "/images/layout/t.gif");
preload("ind_tech_on", "/images/icons/indicator_blue.gif");
preload("ind_project_off", "/images/layout/t.gif");
preload("ind_project_on", "/images/icons/indicator_blue.gif");
preload("ind_archives_off", "/images/layout/t.gif");
preload("ind_archives_on", "/images/icons/indicator_blue.gif");
preload("ind_admin_off", "/images/layout/t.gif");
preload("ind_admin_on", "/images/icons/indicator_blue.gif");

//preload function 
function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}
//image changing function
function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
  }
}

/*******************************************************
popup function
*******************************************************/
function openWindow(url,windowWidth,windowHeight) {
   	var left = Math.floor( (screen.width - windowWidth) / 2);
    var top = Math.floor( (screen.height - windowHeight) / 2);
	newWindow = window.open(url,"pop","width="+windowWidth+",height="+windowHeight+",left="+left+",top="+top+",scrollbars=yes,status=yes");
	newWindow.focus();
}



