// xInnerHtml, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL

function flash_var(nuFlash)
{
	var sObject = '<object type="application/x-shockwave-flash" data="swf/projects/' + nuFlash + '.swf" width="349" height="266"><param name="movie" value="swf/projects/' + nuFlash + '.swf" /><img src="img/index/image_pool/timwren_truck.png" width="349" height="266" alt="Creative Fibre - Client Images" /></object>';
	var replaceDiv = xGetElementById('client_data');
	if (replaceDiv){
		xInnerHtml(replaceDiv, sObject);
	}
	var replaceContent = xGetElementById('client_content');
	if (replaceContent){
		xInnerHtml(replaceContent, content[nuFlash]);
	}
}

function xInnerHtml(e,h)
{
  if(!(e=xGetElementById(e)) || !xStr(e.innerHTML)) return null;
  var s = e.innerHTML;
  if (xStr(h)) {e.innerHTML = h;}
  return s;
}

function xGetElementById(e)
{
  if(typeof(e)!='string') return e;
  if(document.getElementById) e=document.getElementById(e);
  else if(document.all) e=document.all[e];
  else e=null;
  return e;
}

function xStr(s)
{
  for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])!='string') return false;}
  return true;
}

function goto_URL(object) {window.location.href = object.options[object.selectedIndex].value;}

function goback(){history.back();}

var win= null;
function NewWindow(mypage,myname,w,h,scroll){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=no';
  win=window.open(mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

