var ie=document.all
var ns6=document.getElementById&&!document.all

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body
}

function enlarge(which, e, position, imgwidth, imgheight){
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (position=="center"){
pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
horzpos=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2
vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2
if (window.opera && window.innerHeight) //compensate for Opera toolbar
vertpos=pgyoffset+window.innerHeight/2-imgheight/2
vertpos=Math.max(pgyoffset, vertpos)
}
else{
var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY
}
crossobj.style.left=horzpos+"px"
crossobj.style.top=vertpos+"px"

crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">Close</span> </div><img src="'+which+'">'
crossobj.style.visibility="visible"
return false
}
else //if NOT IE 4+ or NS 6+, simply display image in full browser window
return true
}

function closepreview(){
crossobj.style.visibility="hidden"
}

function drag_drop(e){
if (ie&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx+"px"
crossobj.style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
}
return false
}

function initializedrag(e){
if (ie&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar"){
offsetx=ie? event.clientX : e.clientX
offsety=ie? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")


adImages = new Array("images/sdmad001.jpg","images/sdmad001.jpg","images/sdmad001.jpg","images/sdmad001_charabanc.jpg","images/124_gf001.jpg","images/124_gf002.jpg","images/124_gf003.jpg","images/124_gf004.jpg","images/124_gf005.jpg","images/124_gf006.jpg","images/124_xa010.jpg","images/124_xa011.jpg","images/132_sf001.jpg","images/132_sf002.jpg","images/132_sf003.jpg","images/143_of358.jpg","images/143_ov5a.jpg","images/143_sk007.jpg","images/143_sk009.jpg","images/143_sk010.jpg","images/176_ff2.jpg")
thisAd = 0
imgCt = adImages.length

function rotate(){

if (document.images) {
thisAd++
if (thisAd == imgCt) {
thisAd= 0
}
document.adBanner.src=adImages
[thisAd]
setTimeout("rotate()",8 * 1000)
}
}


adImages2 = new Array
("images/124_gf001.jpg","images/124_gf002.jpg","images/124_gf003.jpg","images/124_gf004.jpg","images/124_gf005.jpg","images/124_gf006.jpg","images/124_xa010.jpg","images/124_xa011.jpg")
thisAd2 = 0
imgCt2 = adImages2.length

function rotate2(){

if (document.images) {
thisAd2++
if (thisAd2 == imgCt2) {
thisAd2= 0
}
document.adBanner2.src=adImages2
[thisAd2]
setTimeout("rotate2()",8 * 1000)
}
}


adImages3 = new Array
("images/132_sf001.jpg","images/132_sf002.jpg","images/132_sf003.jpg")
thisAd3 = 0
imgCt3 = adImages3.length

function rotate3(){

if (document.images) {
thisAd3++
if (thisAd3 == imgCt3) {
thisAd3= 0
}
document.adBanner3.src=adImages3
[thisAd3]
setTimeout("rotate3()",8 * 1000)
}
}


adImages7 = new Array
("images/176_ff001.jpg","images/176_ff002.jpg","images/176_ff003.jpg","images/176_ff004.jpg")
thisAd7 = 0
imgCt7 = adImages7.length

function rotate7(){

if (document.images) {
thisAd7++
if (thisAd7 == imgCt7) {
thisAd7= 0
}
document.adBanner7.src=adImages7
[thisAd7]
setTimeout("rotate7()",8 * 1000)
}
}

