var sam = 'Art of Rajasthan'

var pic = null
var popImg = null  
var picTitle = null
var imgCount = 0
var imgWinName = "popImg"

function openPopImg(picName, windowTitle, windowWidth, windowHeight){
  closePopImg()
  picTitle = windowTitle
  imgWinName = "popImg" + imgCount++ 
  popImg = window.open(picName, imgWinName,
           "toolbar=no,scrollbars=no,resizable=no,width=" 
           + (parseInt(windowWidth)+20)  + ",height=" 
           + (parseInt(windowHeight)+15))
  }

function closePopImg(){  
  if (navigator.appName != "Microsoft Internet Explorer" 
      || parseInt(navigator.appVersion) >=4) 
    if(popImg != null) if(!popImg.closed) popImg.close()
  }


function setStatus(msg){ 
  status = msg
  return true
  }


var priorPic = new Array()
var noPic = 0

function openPopImg(picName, windowTitle, windowWidth, windowHeight){
  var i = 0
  var foundit = false 
  if(pic == picName && winOpen()){
    popImg.focus()
    }
  else{
    foundit = false
    for(i=0; i<=noPic; i++){
      if (priorPic[i] == picName)
        foundit = true
      }

    pic = picName
    closePopImg()
    picTitle = windowTitle
    imgWinName = "popImg" + imgCount++ 
    popImg = openPopImgWin(imgWinName, windowWidth, windowHeight)
    if(foundit){
      fabricatePage()
      }
    else{
      priorPic[noPic++] = pic
      fabricateNewImagePage()
      }
    }
  }

function openPopImgWin(imgWinName, windowWidth, windowHeight){
  var winFeatures = "toolbar=no,scrollbars=no,resizable=no,width=" 
    + windowWidth + ",height=" + windowHeight
  return window.open("", imgWinName, winFeatures)
  }

function fabricatePage(){
  var htmlStr = 
    '<HTML><HEAD><TITLE>' + picTitle + '</TITLE></HEAD>'
  + '<BODY background="' + pic + '"></BODY></HTML>'
  popImg.document.open()
  popImg.document.write(htmlStr)
  popImg.document.close()
  }

function fabricateNewImagePage(){
  var htmlStr = 
    '<HTML><HEAD><TITLE>' + picTitle + '</TITLE></HEAD>'
  + '<BODY bgcolor="#B75C24" text="#FFFF99" onLoad="opener.fabricatePage()">'
  + '<p align=center><br>'  
  + 'Loading picture....'  
  + '<BR><BR>'  
  + '<blink>Please wait</blink><BR></p>'  
  + '<IMG SRC="' + pic + '" WIDTH=100% HEIGHT=80%>' 
  + '</BODY></HTML>';

  popImg.document.open()
  popImg.document.write(htmlStr)
  popImg.document.close()
  }

function winOpen(){
  if(popImg != null){ 
    if(popImg.closed != true) return true; else return false
    }
  else
    return false
  }


function openPopImgWin(imgWinName, windowWidth, windowHeight){
  var leftX = 0  
  var topY = 0   
  var winFeatures = "toolbar=no,scrollbars=no,resizable=no,left=10,top=10,width=" 
    + windowWidth + ",height=" + windowHeight
  if (leftX>0){
    winFeatures += ",screenX=" + leftX + ",left=" + leftX	
                + ",screenY=" + topY + ",top=" + topY 
    }
  return window.open("", imgWinName, winFeatures)
  }


browserName = navigator.appName; browserVer = parseInt(navigator.appVersion); 
if (browserName == "Netscape" && browserVer >= 3) version = "n3"; 
else if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) version = "e4"; 
else version = "n2";
             if (version == "n3" || version == "e4") {
             toc01on = new Image ;
             toc01on.src = "images/about-a.gif";
             toc02on = new Image ;
             toc02on.src = "images/workshop-a.gif";
             toc03on = new Image ;
             toc03on.src = "images/enquiries-a.gif";
             toc04on = new Image ;
             toc04on.src = "images/warehouse-a.gif";

             toc1on = new Image ;
             toc1on.src = "images/on.gif";
             toc2on = new Image ;
             toc2on.src = "images/on.gif";
             toc3on = new Image ;
             toc3on.src = "images/on.gif";
 		 toc4on = new Image ;
             toc4on.src = "images/on.gif";
		 toc5on = new Image ;
             toc5on.src = "images/on.gif";
             toc6on = new Image ;
             toc6on.src = "images/on.gif";
             toc7on = new Image ;
             toc7on.src = "images/on.gif";
             toc8on = new Image ;
             toc8on.src = "images/on.gif";
             toc9on = new Image ;
             toc9on.src = "images/on.gif";
             toc10on = new Image ;
             toc10on.src = "images/on.gif";
             toc11on = new Image ;
             toc11on.src = "images/on.gif";
             toc12on = new Image ;
             toc12on.src = "images/on.gif";
             toc13on = new Image ;
             toc13on.src = "images/on.gif";
             toc14on = new Image ;
             toc14on.src = "images/on.gif";
             toc15on = new Image ;
             toc15on.src = "images/on.gif";
             toc16on = new Image ;
             toc16on.src = "images/on.gif";

             toc01off = new Image ;
             toc01off.src = "images/about.gif";
             toc02off = new Image ;
             toc02off.src = "images/workshop.gif";
             toc03off = new Image ;
             toc03off.src = "images/enquiries.gif";
             toc04off = new Image ;
             toc04off.src = "images/warehouse.gif";

             toc1off = new Image ;
             toc1off.src = "images/off.gif";
             toc2off = new Image ;
             toc2off.src = "images/off.gif";
             toc3off = new Image ;
             toc3off.src = "images/off.gif";
             toc4off = new Image ;
             toc4off.src = "images/off.gif";
             toc5off = new Image ;
             toc5off.src = "images/off.gif";
             toc6off = new Image ;
             toc6off.src = "images/off.gif";
             toc7off = new Image ;
             toc7off.src = "images/off.gif";
             toc8off = new Image ;
             toc8off.src = "images/off.gif";
             toc9off = new Image ;
             toc9off.src = "images/off.gif";
             toc10off = new Image ;
             toc10off.src = "images/off.gif";
             toc11off = new Image ;
             toc11off.src = "images/off.gif";
             toc12off = new Image ;
             toc12off.src = "images/off.gif";
             toc13off = new Image ;
             toc13off.src = "images/off.gif";
             toc14off = new Image ;
             toc14off.src = "images/off.gif";
             toc15off = new Image ;
             toc15off.src = "images/off.gif";
             toc16off = new Image ;
             toc16off.src = "images/off.gif";
             }


function img_act(imgName) {
if (version == "n3" || version == "e4") {
imgOn = eval(imgName + "on.src");
document [imgName].src = imgOn; } }

function img_inact(imgName) {
if (version == "n3" || version == "e4") {
imgOff = eval(imgName + "off.src");
document [imgName].src = imgOff; } }
