<!--
function popWin(target)
{
  winName =
    window.open(target,'unproj','width=778,height=600,toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
  winName.focus();
  return false;
}
function DoEmptyCat(des){
// Javascript:DoEmptyCat('"+des+"')
  var isGo = window.confirm('Do you want to delete this category & all its contents?');
  if (isGo) {
    document.location.href=des;
    return true;
  }
}
function DoEmptyItem(des){
  var isGo = window.confirm('Do you want to delete this item?');
  if (isGo) {
    document.location.href=des;
    return true;
  }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// JavaScript for managing images shows with captions :
// BODY Example:
// <body onLoad="mySlideShow1.play();">
// <img src="originalImage1.gif" name="slide1">
//
// SCRIPT Example:
// var mySlideList1 = ['image1.gif', 'image2.gif', 'image3.gif'];
// var myCaptionList1 = ['aaaa', 'bbbb', 'cccc'];
// var mySlideShow1 = new SlideShow(mySlideList1, 'slide1', 3000, "mySlideShow1");
// var mySlideShow1 = new SlideShow(mySlideList1, 'slide1', 3000, "mySlideShow1","myCaptionLayer",myCaptionList1);
function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
    	document.images[imgName].src = imgSrc;
		slowhigh(document.images[imgName]);
    }
  }

}

    
function SlideShow(slideList, image, speed, name, captionName, captionList)
{
  this.slideList = slideList;
  this.image = image;
  this.speed = speed;
  this.name = name;
  this.current = -1;
  this.timer = 0;
  this.captionName = captionName;
  this.captionList = captionList;
  this.isResume = false;
}
SlideShow.prototype.play = SlideShow_play;  
function SlideShow_play()       
{
  with(this)
  {
//	if (current>=0) {
//    	document.images[image].src = slideList[current];
//		slowfade(document.images[image]);
//	}

    if(current++ >= slideList.length-1) current = 0;
    if (current<0) current=0;
    if (slideList.length>0) 
      switchImage(image, slideList[current]);
    else
      switchImage(image, '/images/homepages/van-tour/GMR_logo_vt.gif');

    elem = document.getElementById(captionName);
    if (elem && slideList.length>0) 
	elem.innerHTML='<font color=green>' + captionList[current] + '</font>';
    clearTimeout(timer);
    if (isResume) {
	    timer = setTimeout(name+'.play()', 3000);
    	isResume = false;
	}
    else {
    	timer = setTimeout(name+'.play()', speed);
    }

  // cache the next image, my modification
  	if (current<slideList.length-1)
		(new Image()).src=slideList[current+1];
  }
  
  
}
SlideShow.prototype.prev = SlideShow_prev;
function SlideShow_prev()       
{
  with(this)
  {
    clearTimeout(timer);
    current--;
    current--;
    play();
  }
}

SlideShow.prototype.next = SlideShow_next;
function SlideShow_next()       
{
  with(this)
  {
    clearTimeout(timer);
    play();
  }
}

SlideShow.prototype.pause = SlideShow_pause;
function SlideShow_pause()       
{
  with(this)
  {
    clearTimeout(timer);
  }
}

SlideShow.prototype.resume = SlideShow_resume;
function SlideShow_resume()       
{
  with(this)
  {
    clearTimeout(timer);
   	isResume = true;
	   	// by setting it true, the next play will use 3 sec
    current--;
    play();
  }
}

	/***********************************************
	* Flashing Link Script- Dynamic Drive (www.dynamicdrive.com)
	* This notice must stay intact for use
	* Visit http://www.dynamicdrive.com/ for full source code
	***********************************************/
	var flashlinks=new Array()
	function changelinkcolor(){
		for (i=0; i< flashlinks.length; i++){
			var flashtype=document.getElementById? flashlinks[i].getAttribute("flashtype")*1 : flashlinks[i].flashtype*1
			var flashcolor=document.getElementById? flashlinks[i].getAttribute("flashcolor") : flashlinks[i].flashcolor
			if (flashtype==0){
				if (flashlinks[i].style.color!=flashcolor)
					flashlinks[i].style.color=flashcolor
				else
					flashlinks[i].style.color=''
			}
			else if (flashtype==1){
				if (flashlinks[i].style.backgroundColor!=flashcolor)
					flashlinks[i].style.backgroundColor=flashcolor
				else
					flashlinks[i].style.backgroundColor=''
			}
		}
	}
	
	function init(){
		initImageEffect();  // added by me
	
		var i=0
		if (document.all){
			while (eval("document.all.flashlink"+i)!=null){
				flashlinks[i]= eval("document.all.flashlink"+i)
				i++
			} 
		}
		else if (document.getElementById){
			while (document.getElementById("flashlink"+i)!=null){
				flashlinks[i]= document.getElementById("flashlink"+i)
				i++
			}
		}
		setInterval("changelinkcolor()", 1000)
	}
	
	if (window.addEventListener)
		window.addEventListener("load", init, false)
	else if (window.attachEvent)
		window.attachEvent("onload", init)
	else if (document.all) 
		window.onload=init
	/***********************************************
	* End of Flashing Link Script
	***********************************************/


/****************************************************
*	        DOM Image rollover:
*		by Chris Poole, modified for function name conflict
*		http://chrispoole.com
*               Script featured on http://www.dynamicdrive.com
*		Keep this notice intact to use it :-)
****************************************************/
function initImageEffect() {
  if (!document.getElementById) return
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].onmouseover = function() {
            imgOriginSrc = this.getAttribute('src');
            this.setAttribute('src',this.getAttribute('hsrc'))
        }
        imgarr[i].onmouseout = function() {
            this.setAttribute('src',imgOriginSrc)
        }
    }
  }
}

/*****************************************/
/*******testing***********/
/***********************************************
* Gradual Highlight image script- &copy; Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var baseopacity=10
var ie4=document.all
var dom=document.getElementById

function slowhigh(which2){
	imgobj=which2 
	instantset(baseopacity)
	highlighting=setInterval("gradualshow()",50)
}

function instantset(degree){
	if (window.highlighting)
		clearInterval(highlighting)
	if (ie4 && imgobj.filters && imgobj.filters.alpha) {
		imgobj.filters.alpha.opacity=degree
	}
	else if (dom)
		imgobj.style.MozOpacity=degree/100
}

function gradualshow(){
	if (ie4 && imgobj.filters && imgobj.filters.alpha && imgobj.filters.alpha.opacity<100) {
		var ii = imgobj.filters.alpha.opacity+10;
		if (ii>=100) {
			imgobj.filters.alpha.opacity = 99;
			clearInterval(highlighting);
		}
		else
			imgobj.filters.alpha.opacity = ii;
	}
	else if (dom && imgobj.style.MozOpacity<1) {
		var ia = parseFloat(imgobj.style.MozOpacity)+0.1;
		if (ia>= 1) {
			imgobj.style.MozOpacity=0.99;
			clearInterval(highlighting)
		}
		else
			imgobj.style.MozOpacity=ia;
	}
	else if (window.highlighting) {
		clearInterval(highlighting)
	}
}

/** the followings are not USED ****************/
function slowfade(which2){
	imgobj=which2 
	instantset(90)
	highlighting=setInterval("gradualfade()",50)
}
function gradualfade(){
	if (ie4 && imgobj.filters.alpha.opacity>10) {
		imgobj.filters.alpha.opacity = Math.max(imgobj.filters.alpha.opacity-10, 10);
	}
	else if (dom && imgobj.style.MozOpacity>0.1)
		imgobj.style.MozOpacity=Math.max(parseFloat(imgobj.style.MozOpacity)-0.1, 0.1)
	else if (window.highlighting)
		clearInterval(highlighting)
}
/*******end of testing *****************/	
//-->
