﻿// JScript File
function changeColor(tag)
{
   tag.style.color="#FE0000";
  
   
}
function changeToPreviousColor(tag)
{
    tag.style.color="#1D6C97";
   
    
}

function changeBackgroundColor(tag)
{
    tag.style.background="#A4D0FD";
   
    
}

function changeToPreviousBackgroundColor(tag)
{
    tag.style.background="#1061D7";
   
    
}

function changeSecondMenuColor(tag)
{
    tag.style.color="#019934";
}

function changeToPreviousSecondMenuColor(tag)
{
    tag.style.color="#FFFFFF";
}

//function deleteText(tag)
//{
//    tag.value="";
//}

 function Navigate(txtSearch)
  {
        
        javascript:window.open("http://www.google.com/search?ie=UTF-8&oe=UTF-8&q="+txtSearch);
  }   
  
function checkForGoogleSearch()
{
    if (document.getElementById("google_url"))
    {
        
        
        googleWin=window.open(document.getElementById("google_url").value,"googleWin","width=550,height=550")
        
    }
} 

function changeImg(img,graphic_file)
{
   
   document.getElementById(img).src =graphic_file;
   
   
   
}
function changeToPreviousImg(img,graphic_file)
{
    
    document.getElementById(img).src = graphic_file;
     
}

//function changeImg(img)
//{
//  
//   document.getElementById(img).src = "images/news_over.gif";
//   
//   
//   
//}
//function changeToPreviousImg(img)
//{
//    
//    document.getElementById(img).src = "images/news.gif";
//    
//}

//function changeImgeEnglish(img)
//{
//  
//   document.getElementById(img).src = "images/news_e_over.gif";
//   
//   
//   
//}
//function changeToPreviousImgEnglish(img)
//{
//    
//    document.getElementById(img).src = "images/news_e.gif";
//    
//}

function showGallery(imgPath,itemID,catID)
{
    var org = document.URL;
	var what = /&/g;
	var newStr = org.replace(what,'@@@');
	var source = 'bigGallery.asp?path='+ imgPath + '&id='+ itemID+'&cat='+ catID +'&urlPath=' + newStr;
	win = window.open(source, "galleryBig", "top=0, left=0, status=no, resizable, scrollbars=yes")
}

// open the window for big picture.	
function showBig (path,nameP) {
	var org = document.URL;
	var what = /&/g;
	var newStr = org.replace(what,'@@@');
	var source = 'imgBig.asp?path='+ path + '&name=' + nameP + '&urlPath=' + newStr;
	win = window.open(source, "imgBig", "top=0, left=0, status=no, resizable, scrollbars=yes")
}

// Set slideShowSpeed (milliseconds)
        var slideShowSpeed = 4000

        // Duration of crossfade (seconds)
        var crossFadeDuration = 2      
        var arrImg;
        var t;
        var j = 0;
        var p ;
        var preLoad = new Array();
        var preCaption = new Array();
        
        
        function getImg(path,hdnImgArrID)
        {
            
              var arrImg1= document.getElementById(hdnImgArrID).value.split('~');            
            p = arrImg1.length;            
            for (i = 0; i < arrImg1.length; i++)
            {
                var arrImg2=arrImg1[i].split(",");
                preLoad[i] = new Image();
                preLoad[i].src = path +  arrImg2[0];
                if(arrImg2[2] != "")
                    preCaption[i]='<a href="' + arrImg2[2] + '">' + arrImg2[1] + '</a>' ;
                else
                    preCaption[i]= arrImg2[1];
            }
        }
        
       

        function runSlideShow()
        {
           
           document.getElementById("caption").innerHTML=preCaption[j]
           if (document.all)
           {             
              document.images.SlideShow.style.filter="blendTrans(duration=2)"
              document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
              document.images.SlideShow.filters.blendTrans.Apply()      
           }
           document.images.SlideShow.src = preLoad[j].src
           if (document.all)
           {
              document.images.SlideShow.filters.blendTrans.Play()
           }
           j = j + 1
           if (j > (p-1)) j=0
           t = setTimeout('runSlideShow()', slideShowSpeed)
           
           
   
      }

