
var trailimage = ["test.gif",330,355];
var compwidth = 330;
var compheight = 355; //add 30 pixels for the caption

var offsetfrommouse=[12,17]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.

function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("float")
else if (document.all)
return document.all.trailimagid
}

if (document.getElementById || document.all){
	document.write('<div id="float">');
	document.write('</div>');
}




function hidetrail(){
	gettrailobj().visibility="hidden"
	document.onmousemove=""
	gettrailobj().left="-500px"
	gettrailobjnew().visibility="hidden"
	gettrailobjnew().left="-500px"

}

function gettrailobj(){
if (document.getElementById)
return document.getElementById("float").style
else if (document.all)
return document.all.trailimageid.style
}


function showtrail(imagename,title,description){

	height = 375;
	
	if (height > 0){
		currentimageheight = height;
	}

	currentimageheight = 100;
	document.onmousemove=followmouse;



	newHTML = '<div style="padding: 2px; background-color: #FFF; border: 1px solid #888;">';
	newHTML = newHTML + '<span class="texttwo"><b><font color="#FF6600">&nbsp;' + title + '</font></b></span><br>';
	newHTML = newHTML + '<span class="textone">&nbsp;' + description + '</span><br/>';
	newHTML = newHTML + '<center><img src="' + imagename + '" border="0"></center></div>';

	gettrailobjnostyle().innerHTML = newHTML;

	gettrailobj().visibility="visible";

}



function gettrailobjnew(){
if (document.getElementById)
return document.getElementById("trailimageid").style
else if (document.all)
return document.all.trailimagid.style
}

if (document.getElementById || document.all) {
	document.write('<div id="trailimageid"><img src="/images/spacer.gif">');
	document.write('</div>');
	gettrailobjnew().width=0;
	gettrailobjnew().height=0;
    	gettrailobjnew().left="-1000px"
    	gettrailobjnew().top="0px"
	gettrailobjnew().visibility="hidden"
    	gettrailobjnew().display=""
}

function showtrailnew(comppath,title,description,iwidth,iheight,other){

var maxsize = 0
var f = 0.0
var max_comp = 325
var strimagename = ""

if (comppath.indexOf(".flv") > 0){
    // do nothing
} else if (iwidth == null || iheight == null || iwidth == 0 || iheight == 0) {
     iwidth = 325;
     iheight = 325;
} else {
	compheight = iheight;
	compwidth = iwidth;
}

document.onmousemove=followmouse;

if (comppath.indexOf(".flv") > 0) {
  //video preview
  if (iwidth == null || iheight == null || iwidth == 0 || iheight == 0) {
	compheight = 300 + 25;
	compwidth = 376;
  } else {
	compheight = iheight + 25;
	compwidth = iwidth;
  }
  strimagename = comppath.substring(comppath.lastIndexOf("/")+1,comppath.toLowerCase().lastIndexOf(".flv")).toUpperCase()

  document.getElementById("trailimageid").innerHTML = '<div style="width:'+compwidth+'px;height:'+compheight+'px;padding:4px;background-color:#fff;border:1px solid #888;"><embed src="/includes/mediaplayer.swf" width="'+compwidth+'" height="'+compheight+'" allowscriptaccess="always" flashvars="&file='+comppath+'&height='+compheight+'&width='+compwidth+'&autostart=true" /></div>'

  //var dt = new Date();
  //default to 1 year
  //dt.setTime(dt.getTime()+(1*24*3600*1000))
  //setCookie("videoloaded",strimagename.toLowerCase(),dt,"/","","");


} else if (comppath.indexOf(".mp3") > 0) {
  //audio preview
  compheight = 30
  compwidth = 160
  strimagename = comppath.substring(comppath.lastIndexOf("/")+1,comppath.toLowerCase().lastIndexOf(".mp3")).toUpperCase()
  document.getElementById("trailimageid").innerHTML = '<div style="width:160px;height:42px;padding:4px;background-color:#fff;border:1px solid #888;"><embed src="/includes/mediaplayer.swf" width="160" height="20" allowscriptaccess="always" flashvars="&file='+comppath+'&height=20&width=160&autostart=true" /><br><b>'+strimagename+'</b></div>'

} else {

  //image preview
  document.getElementById("trailimageid").innerHTML = '<div style="width:'+compwidth+'px;height:'+compheight+'px;padding:4px;background-color:#fff;border:1px solid #888;"><img src="'+comppath+'" border="0"></div>'

}

if (iwidth != 0 && iheight != 0){
	gettrailobjnew().width=compwidth;
	gettrailobjnew().height=compheight;
}
gettrailobjnew().visibility="visible";

}



function seriestrail(title, photos, one, two, three, four, five, six, seven, eight, nine, ten, eleven, tweleve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty, twentyone, twentytwo, twentythree, twentyfour, twentyfive, twentysix, twentyseven, twentyeight, twentynine, thirty){

	height = 375;
	
	if (height > 0){
		currentimageheight = height;
	}

	currentimageheight = 100;
	document.onmousemove=followmouse;


	newHTML = '<div style="padding: 2px; background-color: #FFF; border: 1px solid #888;">';
	newHTML = newHTML + '<table width="330" border="0" cellspacing="" cellpadding="2" align="center">';
  newHTML = newHTML + '<tr valign="middle">'; 
    newHTML = newHTML + '<td colspan="6" class="texttwo"><b><font color="#FF6600">&nbsp;' + title + '</font></b></td>';
  newHTML = newHTML + '</tr>';
  newHTML = newHTML + '<tr valign="middle">'; 
    newHTML = newHTML + '<td><div align="center">' + one + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + two + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + three + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + four + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + five + '</div></td>';
	newHTML = newHTML + '<td><div align="center">' + six + '</div></td>';
  newHTML = newHTML + '</tr>';
  newHTML = newHTML + '<tr valign="middle">';
    newHTML = newHTML + '<td><div align="center">' + seven + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + eight + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + nine + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + ten + '</div></td>';
	newHTML = newHTML + '<td><div align="center">' + eleven + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + tweleve + '</div></td>';
  newHTML = newHTML + '</tr>';
  newHTML = newHTML + '<tr valign="middle"> ';
    newHTML = newHTML + '<td><div align="center">' + thirteen + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + fourteen + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + fifteen + '</div></td>';
	newHTML = newHTML + '<td><div align="center">' + sixteen + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + seventeen + '</div></td>';
	newHTML = newHTML + '<td><div align="center">' + eighteen + '</div></td>';
  newHTML = newHTML + '</tr>';
  newHTML = newHTML + '<tr valign="middle">'; 
    newHTML = newHTML + '<td><div align="center">' + nineteen + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twenty + '</div></td>';
	 newHTML = newHTML + '<td><div align="center">' + twentyone + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twentytwo + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twentythree + '</div></td>';
	    newHTML = newHTML + '<td><div align="center">' + twentyfour + '</div></td>';
  newHTML = newHTML + '</tr>';
  newHTML = newHTML + '<tr valign="middle"> ';
    newHTML = newHTML + '<td><div align="center">' + twentyfive + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twentysix + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twentyseven + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twentyeight + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twentynine + '</div></td>';
	 newHTML = newHTML + '<td><div align="center">' + thirty + '</div></td>';
  newHTML = newHTML + '</tr>';
    newHTML = newHTML + '<tr valign="middle">'; 
    newHTML = newHTML + '<td colspan="6" class="verandaeleven" align="center"><b><font color="#999999">Containing ' + photos + ' Photos</font></b></td>';
  newHTML = newHTML + '</tr>';
newHTML = newHTML + '</table>';



	gettrailobjnostyle().innerHTML = newHTML;

	gettrailobj().visibility="visible";

}


function seriestrail2(title, photos, content_html){
	var newHTML;

	height = 375;
	
	if (height > 0){
		currentimageheight = height;
	}

	currentimageheight = 100;
	document.onmousemove=followmouse;

	newHTML = '<div style="padding: 2px; background-color: #FFF; border: 1px solid #888;">';
	newHTML = newHTML + '<table width="330" border="0" cellspacing="" cellpadding="2" align="center">';
 	newHTML = newHTML + '<tr valign="middle">'; 
    	newHTML = newHTML + '<td colspan="6" class="texttwo"><b><font color="#FF6600">&nbsp;' + title + '</font></b></td>';
 	newHTML = newHTML + '</tr><tr valign="middle">';

	newHTML = newHTML + content_html;

        newHTML = newHTML + '</tr><tr valign="middle">'; 
        newHTML = newHTML + '<td colspan="6" class="verandaeleven" align="center"><b><font color="#999999">Containing ' + photos + ' Photos</font></b></td></tr>';
	newHTML = newHTML + '</table></div>'; 

	gettrailobjnostyle().innerHTML = newHTML;

	gettrailobj().visibility="visible";

}

function seriestrailleft(title, photos, one, two, three, four, five, six, seven, eight, nine, ten, eleven, tweleve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty, twentyone, twentytwo, twentythree, twentyfour, twentyfive, twentysix, twentyseven, twentyeight, twentynine, thirty){

	height = 375;
	
	if (height > 0){
		currentimageheight = height;
	}

	currentimageheight = 100;
	document.onmousemove=leftstickmouse;


	newHTML = '<div style="padding: 2px; background-color: #FFF; border: 1px solid #888;">';
	newHTML = newHTML + '<table width="330" border="0" cellspacing="" cellpadding="2" align="center">';
  newHTML = newHTML + '<tr valign="middle">'; 
    newHTML = newHTML + '<td colspan="6" class="texttwo"><b><font color="#FF6600">&nbsp;' + title + '</font></b></td>';
  newHTML = newHTML + '</tr>';
  newHTML = newHTML + '<tr valign="middle">'; 
    newHTML = newHTML + '<td><div align="center">' + one + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + two + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + three + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + four + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + five + '</div></td>';
	newHTML = newHTML + '<td><div align="center">' + six + '</div></td>';
  newHTML = newHTML + '</tr>';
  newHTML = newHTML + '<tr valign="middle">';
    newHTML = newHTML + '<td><div align="center">' + seven + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + eight + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + nine + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + ten + '</div></td>';
	newHTML = newHTML + '<td><div align="center">' + eleven + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + tweleve + '</div></td>';
  newHTML = newHTML + '</tr>';
  newHTML = newHTML + '<tr valign="middle"> ';
    newHTML = newHTML + '<td><div align="center">' + thirteen + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + fourteen + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + fifteen + '</div></td>';
	newHTML = newHTML + '<td><div align="center">' + sixteen + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + seventeen + '</div></td>';
	newHTML = newHTML + '<td><div align="center">' + eighteen + '</div></td>';
  newHTML = newHTML + '</tr>';
  newHTML = newHTML + '<tr valign="middle">'; 
    newHTML = newHTML + '<td><div align="center">' + nineteen + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twenty + '</div></td>';
	 newHTML = newHTML + '<td><div align="center">' + twentyone + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twentytwo + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twentythree + '</div></td>';
	    newHTML = newHTML + '<td><div align="center">' + twentyfour + '</div></td>';
  newHTML = newHTML + '</tr>';
  newHTML = newHTML + '<tr valign="middle"> ';
    newHTML = newHTML + '<td><div align="center">' + twentyfive + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twentysix + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twentyseven + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twentyeight + '</div></td>';
    newHTML = newHTML + '<td><div align="center">' + twentynine + '</div></td>';
	 newHTML = newHTML + '<td><div align="center">' + thirty + '</div></td>';
  newHTML = newHTML + '</tr>';
    newHTML = newHTML + '<tr valign="middle">'; 
    newHTML = newHTML + '<td colspan="6" class="verandaeleven" align="center"><b><font color="#999999">Containing ' + photos + ' Photos</font></b></td>';
  newHTML = newHTML + '</tr>';
newHTML = newHTML + '</table>';



	gettrailobjnostyle().innerHTML = newHTML;

	gettrailobj().visibility="visible";

}


function followmouse(e){
  var xcoord=offsetfrommouse[0]
  var ycoord=offsetfrommouse[1]

  var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
  var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight)

  
    if (typeof e != "undefined") {
      // Mozilla
      xcoord+=e.pageX
      ycoord+=e.pageY
      if (xcoord+trailimage[1] >docwidth-15)
        xcoord = e.pageX - compwidth - offsetfrommouse[0] - 20
      if (ycoord+trailimage[1]+27> docheight + truebody().scrollTop)
        ycoord = (truebody().scrollTop+docheight) - compheight - 35

      // this is to move the .top up if it is too far down from the mouse pointer
      if (ycoord > (truebody().scrollTop+e.pageY) + 10)
         ycoord  = ycoord  - (ycoord - (truebody().scrollTop+e.pageY))

    } else if (typeof window.event !="undefined") {
      // IE browser
      xcoord+=truebody().scrollLeft+event.clientX
      ycoord+=truebody().scrollTop+event.clientY

      if (xcoord+trailimage[1] > docwidth-15) 
        xcoord = (truebody().scrollLeft+event.clientX) - compwidth - offsetfrommouse[0] - 20
      if (ycoord+trailimage[1]+27 > docheight + truebody().scrollTop) 
        ycoord = (truebody().scrollTop+docheight) - compheight - 27

      // this is to move the .top up if it is too far down from the mouse pointer
      if (ycoord > (truebody().scrollTop+event.clientY) + 10)
         ycoord  = ycoord  - (ycoord - (truebody().scrollTop+event.clientY))

    }


  if (xcoord < 0 || ycoord < 0) {
    gettrailobj().visible="none"
    gettrailobj().display=""
    gettrailobjnew().visible="none"
    gettrailobjnew().display=""
  } else {
    gettrailobj().display=""
    gettrailobj().left=xcoord+"px"
    gettrailobj().top=ycoord+"px"
    gettrailobjnew().display=""
    gettrailobjnew().left=xcoord+"px"
    gettrailobjnew().top=ycoord+"px"
  }  
}


function leftstick(imagename,title,description){

	height = 375;
	
	if (height > 0){
		currentimageheight = height;
	}

	currentimageheight = 100;
	document.onmousemove=leftstickmouse;



	newHTML = '<div style="padding: 2px; background-color: #FFF; border: 1px solid #888;">';
	newHTML = newHTML + '<span class="texttwo"><b><font color="#FF6600">&nbsp;' + title + '</font></b></span><br>';
	newHTML = newHTML + '<span class="textone">&nbsp;' + description + '</span><br/>';
	newHTML = newHTML + '<center><img src="' + imagename + '" border="0"></center></div>';

	gettrailobjnostyle().innerHTML = newHTML;

	gettrailobj().visibility="visible";

}


function leftstickmouse(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight)


	if (typeof e != "undefined"){
		if (docwidth - e.pageX < 300){
			xcoord = e.pageX - xcoord - 340; // Move to the left side of the cursor
		} else {
			xcoord = e.pageX - xcoord - 340; // Move to the left side of the cursor
		}
		ycoord += e.pageY - Math.max(0,(225 + currentimageheight + e.pageY - docheight - truebody().scrollTop));


	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < 300){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - 340; // Move to the left side of the cursor
		} else {
			xcoord = event.clientX + truebody().scrollLeft - xcoord - 340; // Move to the left side of the cursor
		}
		if (docheight - event.clientY < (currentimageheight + 105)){
			ycoord += truebody().scrollTop + event.clientY -100;
		} else {
			ycoord += truebody().scrollTop + event.clientY -100;
		}
	}

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)

	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"

}




function rightstick(imagename,title,description){

	height = 375;
	
	if (height > 0){
		currentimageheight = height;
	}

	currentimageheight = 100;
	document.onmousemove=rightstickmouse;



	newHTML = '<div style="padding: 2px; background-color: #FFF; border: 1px solid #888;">';
	newHTML = newHTML + '<span class="texttwo"><b><font color="#FF6600">&nbsp;' + title + '</font></b></span><br>';
	newHTML = newHTML + '<span class="textone">&nbsp;' + description + '</span><br/>';
	newHTML = newHTML + '<center><img src="' + imagename + '" border="0"></center></div>';

	gettrailobjnostyle().innerHTML = newHTML;

	gettrailobj().visibility="visible";

}


function rightstickmouse(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight)


	if (typeof e != "undefined"){
		if (docwidth - e.pageX < 300){
			xcoord = e.pageX - xcoord +30; // Move to the left side of the cursor
		} else {
			xcoord = e.pageX - xcoord +30; // Move to the left side of the cursor
		}
		
		ycoord += e.pageY - Math.max(0,(325 + currentimageheight + e.pageY - docheight - truebody().scrollTop));


	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < 300){
			xcoord = event.clientX + truebody().scrollLeft - xcoord +30; // Move to the left side of the cursor
		} else {
			xcoord = event.clientX + truebody().scrollLeft - xcoord +30; // Move to the left side of the cursor
		}
		if (docheight - event.clientY < (currentimageheight + 105)){
			ycoord += truebody().scrollTop + event.clientY -100;
		} else {
			ycoord += truebody().scrollTop + event.clientY -100;
		}
	}

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)

	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"

}