//var ROOTURL="http://localhost/COM/MAKE/scad/";
var ROOTURL="http://www.saltaire-consultants-and-design.co.uk/";

function roll_over(image_id,change_to) {
   var this_img=document.getElementById(image_id);
   this_img.src=ROOTURL+change_to;
}
function post_form($form_id){document.getElementById($form_id).submit();}
function add_event($object,$type,$fn){ 
   if($object.attachEvent){ 
      $object['e'+$type+$fn] = $fn; 
      $object[$type+$fn] = function(){$object['e'+$type+$fn]( window.event );} 
      $object.attachEvent( 'on'+$type, $object[$type+$fn] ); 
   }else{
      $object.addEventListener($type,$fn,false); 
   }
}
function remove_event($object,$type,$fn){
   if($object.detachEvent){
      $object.detachEvent('on'+$type,$object[$type+$fn]);
      $object[$type+$fn]=null;
   }else{
      $object.removeEventListener($type,$fn,false);
   }
} 
function elements_with_class($elem,$tag_name,$class_name){
   var $arr_elems=($tag_name=="*" && document.all)? document.all : $elem.getElementsByTagName($tag_name);
   var $found = new Array();
   for($i=0;$i<$arr_elems.length;$i++){  
      if($arr_elems[$i].className==$class_name) $found.push($arr_elems[$i]);
   }
   return ($found);
}
function http_location($filename){
   window.location=$filename;
}
function confirm_action($message,$url) {
	var $answer=confirm($message);
	if($answer)window.location($url);
}
function picture_window($url,$width,$height,$window) {
   window.open($url+'&width='+$width+'&height='+$height,$window,"width="+$width+",height="+$height+",scrollbars=no,left=100,top=100");
}
function popup_photo($file_path,$width,$height,$title){
   pic_window = window.open("",$title,"width="+$width+",height="+$height+",scrollbars=no,left=100,top=100");
   pic_window.document.write('<?xml version="1.0" encoding="utf-8"?>');
   pic_window.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
   pic_window.document.write('<html><head><title>'+$title+'</title></head><body onBlur="self.close()" bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">');
   pic_window.document.write('<img src=\"'+$file_path+'\" width='+$width+' height='+$height+' alt=\"'+$title+'\">');
   pic_window.document.write('</body></html>');
}
