function hideLoading()
{
	document.getElementById('dhtmlpointer').style.display='none';
	document.getElementById('thumbBox').style.display='none';
	document.getElementById('thumbImage').style.display='none';
	document.getElementById('thumbLoading').style.display='none';
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=2,location=0,statusbar=1,menubar=0,resizable=0,width=650,height=525,left = 100,top = 134');");
}
function popUpSmall(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=2,location=0,statusbar=1,menubar=0,resizable=0,width=200,height=150,left = 100,top = 134');");
}
// load htmlarea
	_editor_url = "";                     // URL to htmlarea files
	var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
	if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
	if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
	if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
	if (win_ie_ver >= 5.5) {
		 document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
		 document.write(' language="Javascript1.2"></scr' + 'ipt>');  
	} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
	

browserName = navigator.appName; 
browserVer = parseInt(navigator.appVersion); 

ns3up = (browserName == "Netscape" && browserVer >= 3); 
ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4); 

function doPic(imgName) { 
if (ns3up || ie4up) { 
imgOn = ("" + imgName); 
document.mainpic.src = imgOn; 
} 
}

//google highlighter
var google_text_color = '#000000';
var google_link_colors = new Array('#ffff66','#a0ffff','#99ff99','#ff9999','#ff66ff');
function init_google(){
var pattern = /google\./i;
if (pattern.exec(document.referrer) != null){
var url_parts = document.referrer.split('?');
if (url_parts[1]){ 
var url_args = url_parts[1].split('&');
for(var i=0; i<url_args.length; i++){
var keyval = url_args[i].split('=');
if (keyval[0] == 'q'){
go_google(decode_url(keyval[1]));
return;
}}}}}
function decode_url(url){
return unescape(url.replace(/\+/g,' '));
}
function go_google(terms){
terms = terms.replace(/\"/g,"");
var terms_split = terms.split(' ');
var c = 0;
for(var i=0; i<terms_split.length; i++){
highlight_goolge(terms_split[i], document.body,google_link_colors[c]);
c = (c == google_link_colors.length-1)?0:c+1;
}}
function highlight_goolge(term, container, color){
var term_low = term.toLowerCase();
for(var i=0; i<container.childNodes.length; i++){
var node = container.childNodes[i];
if (node.nodeType == 3){
var data = node.data;
var data_low = data.toLowerCase();
if (data_low.indexOf(term_low) != -1){
//term found!
var new_node = document.createElement('SPAN');
node.parentNode.replaceChild(new_node,node);
var result;
while((result = data_low.indexOf(term_low)) != -1){
new_node.appendChild(document.createTextNode(data.substr(0,result)));
new_node.appendChild(create_node_google(document.createTextNode(data.substr(result,term.length)),color));
data = data.substr(result + term.length);
data_low = data_low.substr(result + term.length);
}
new_node.appendChild(document.createTextNode(data));
}}else{
//recurse
highlight_goolge(term, node, color);
}}}
function create_node_google(child, color){
var node = document.createElement('SPAN');
node.style.backgroundColor = color;
node.style.color = google_text_color;
node.appendChild(child);
return node;
}
if (window.addEventListener)
window.addEventListener("load", init_google, false)
else if (window.attachEvent)
window.attachEvent("onload", init_google)
else if (document.getElementById)
window.onload=init_google
//end of google highlighter
//new tip and image enlarger starts here
var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip
var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).
document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="statboxes/arrow2.gif">')
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""
function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}
function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20
var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY
var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}
//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}}
function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}}
document.onmousemove=positiontip
//new tip and image enlarger ends here
//image zoom-in starts here
var thumbnailviewer={
enableTitle: true,
enableAnimation: true,
definefooter: '',
defineLoading: '<img src="images/wait1.gif" /> Loading Image...',
scrollbarwidth: 16,
opacitystring: 'filter:progid:DXImageTransform.Microsoft.alpha(opacity=10); -moz-opacity: 0.1; opacity: 0.1',
targetlinks:[],
createthumbBox:function(){
document.write('<div id="thumbBox" onClick="thumbnailviewer.closeit()"><div id="thumbImage"></div>'+this.definefooter+'</div>')
document.write('<div id="thumbLoading">'+this.defineLoading+'</div>')
this.thumbBox=document.getElementById("thumbBox")
this.thumbImage=document.getElementById("thumbImage")
this.thumbLoading=document.getElementById("thumbLoading")
this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
},
centerDiv:function(divobj){
var ie=document.all && !window.opera
var dom=document.getElementById
var scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
var scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
var docwidth=(ie)? this.standardbody.clientWidth : window.innerWidth-this.scrollbarwidth
var docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
var docheightcomplete=(this.standardbody.offsetHeight>this.standardbody.scrollHeight)? this.standardbody.offsetHeight : this.standardbody.scrollHeight
var objwidth=divobj.offsetWidth
var objheight=divobj.offsetHeight
var topposition=(docheight>objheight)? scroll_top+docheight/2-objheight/2+"px" : scroll_top+10+"px"
divobj.style.left=docwidth/2-objwidth/2+"px"
divobj.style.top=Math.floor(parseInt(topposition))+"px"
divobj.style.visibility="visible"
},
showthumbBox:function(){
this.centerDiv(this.thumbBox)
if (this.enableAnimation){
this.currentopacity=0.1
this.opacitytimer=setInterval("thumbnailviewer.opacityanimation()", 20)
}},
loadimage:function(link){
if (this.thumbBox.style.display=="")
this.closeit()
var imageHTML='<img src="'+link.getAttribute("href")+'" style="'+this.opacitystring+'" />'
if (this.enableTitle && link.getAttribute("title"))
imageHTML+='<br />'+link.getAttribute("title")
this.centerDiv(this.thumbLoading)
this.thumbImage.innerHTML=imageHTML
this.featureImage=this.thumbImage.getElementsByTagName("img")[0]
this.featureImage.onload=function(){
thumbnailviewer.thumbLoading.style.display="none"
thumbnailviewer.showthumbBox()
}
if (document.all && !window.createPopup)
this.featureImage.src=link.getAttribute("href")
this.featureImage.onerror=function(){
thumbnailviewer.thumbLoading.style.display="none"
}},
setimgopacity:function(value){
var targetobject=this.featureImage
if (targetobject.filters && targetobject.filters[0]){
if (typeof targetobject.filters[0].opacity=="number")
targetobject.filters[0].opacity=value*100
else
targetobject.style.filter="alpha(opacity="+value*100+")"
}
else if (typeof targetobject.style.MozOpacity!="undefined")
targetobject.style.MozOpacity=value
else if (typeof targetobject.style.opacity!="undefined")
targetobject.style.opacity=value
else
this.stopanimation()
},
opacityanimation:function(){
this.setimgopacity(this.currentopacity)
this.currentopacity+=0.1
if (this.currentopacity>1)
this.stopanimation()
},
stopanimation:function(){
if (typeof this.opacitytimer!="undefined")
clearInterval(this.opacitytimer)
},
closeit:function(){
this.stopanimation()
this.thumbBox.style.display="none"
this.thumbImage.innerHTML=""
this.thumbBox.style.left="-2000px"
this.thumbBox.style.top="-2000px"
},
cleanup:function(){
this.thumbLoading=null
if (this.featureImage) this.featureImage.onload=null
this.featureImage=null
this.thumbImage=null
for (var i=0; i<this.targetlinks.length; i++)
this.targetlinks[i].onclick=null
this.thumbBox=null
},
dotask:function(target, functionref, tasktype){
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
},
init:function(){
if (!this.enableAnimation)
this.opacitystring=""
var pagelinks=document.getElementsByTagName("a")
for (var i=0; i<pagelinks.length; i++){
if (pagelinks[i].getAttribute("rel") && pagelinks[i].getAttribute("rel")=="thumbnail"){
pagelinks[i].onclick=function(){
thumbnailviewer.stopanimation()
thumbnailviewer.loadimage(this)
return false
}
this.targetlinks[this.targetlinks.length]=pagelinks[i]
}}
this.dotask(window, function(){if (thumbnailviewer.thumbBox.style.display=="") thumbnailviewer.centerDiv(thumbnailviewer.thumbBox)}, "resize")
}}
thumbnailviewer.createthumbBox()
thumbnailviewer.dotask(window, function(){thumbnailviewer.init()}, "load")
thumbnailviewer.dotask(window, function(){thumbnailviewer.cleanup()}, "unload")
//image zoom-in ends here