

userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
function findElement(n,ly) {
	if (browserVers < 4)		return document[n];
	var curDoc = ly ? ly.document : document;
	var elem = curDoc[n];
	if (!elem) {
		for (var i=0;i<curDoc.layers.length;i++) {
			elem = findElement(n,curDoc.layers[i]);
			if (elem) return elem;
		}
	}
	return elem;
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (document.layers) {
				img = findElement(changeImages.arguments[i],0);
			}
			else {
				img = document.images[changeImages.arguments[i]];
			}
			if (img) {
				img.src = changeImages.arguments[i+1];
			}
		}
	}
}


function openpopWindow(theURL,winName,features){//v2.0
window.open(theURL,winName,features)

}
var preloadFlag = false;
function preloadImages(){ 
window.focus()
						 
	if (document.images) {
		image1_over = newImage("images/guide_off.jpg");
		image2_over= newImage("images/marda_off.jpg");
		image3_over= newImage("images/par_off.jpg");
		image4_over= newImage("images/bk.jpg");
		image5_over= newImage("images/grid.gif");
		image6_over= newImage("images/rebecca_off.jpg");
		preloadFlag = true;
	}
}

//change link descriptions to your own. Extend as needed
var linktext=new Array()
linktext[0]="Parque Lezama: A neighborhood plaza in Buenos Aires, Argentina systematically photographed over two months to understand patterns of community making."
linktext[1]="My friend Marda Stark showed me her family photographs and let me photograph her.Ê What happens when the story behind the photograph is more important than the actual image?"
linktext[2]="<b>Guided Tour: E1</b> <br> is an exploration of community through portraits at the Toynbee Hall Senior Care Centre, East London."
linktext[3]="Kaushik Panchal\'s portfolio of work in interactive media."
linktext[4]=""
linktext[5]="A collaborative project between a photographer and a designer,buscada.com represents our ongoing efforts to use the medium of the web tofind new ways to build contextualframeworks for our design, photography, and narrative projects. Designer, Kaushik Panchal. Photographer, Gabrielle Bendiner-Viani."

var ns6=document.getElementById&&!document.all
var ie=document.all

function show_text(thetext, whichdiv){
if (ie) eval("document.all."+whichdiv).innerHTML=linktext[thetext]
else if (ns6) document.getElementById(whichdiv).innerHTML=linktext[thetext]
}

function reset(whichdiv){
if (ie) eval("document.all."+whichdiv).innerHTML=' '
else if (ns6) document.getElementById(whichdiv).innerHTML=' '
}

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

// Show/Hide functions for non-pointer layer/objects
function show(id) {
	if (ns4) document.layers[id].visibility = "show"
	else if (ie4) document.all[id].style.visibility = "visible"
}

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

function hide(id) {
	if (ns4) document.layers[id].visibility = "hide"
	else if (ie4) document.all[id].style.visibility = "hidden"
}

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

function show_lyr(lyr) {
	var theLyr = (document.layers)? getLyrRef(lyr,document) : (document.all)? document.all[lyr].style : (document.getElementById)? document.getElementById(lyr).style: null;
	if (!theLyr) return;
	theLyr.zIndex=100;
	theLyr.visibility = "visible";
}

function hide_lyr(lyr) {
	var theLyr = (document.layers)? getLyrRef(lyr,document) : (document.all)? document.all[lyr].style : (document.getElementById)? document.getElementById(lyr).style: null;
	if (!theLyr) return;
	theLyr.zIndex=1;
	theLyr.visibility = "hidden";	
}


function shownew(object) {
    if (document.getElementById && document.getElementById(object) != null)
         node = document.getElementById(object).style.visibility='visible';
    else if (document.layers && document.layers[object] != null)
        document.layers[object].visibility = 'visible';
    else if (document.all)
        document.all[object].style.visibility = 'visible';
}

function hidenew(object) {
    if (document.getElementById && document.getElementById(object) != null)
         node = document.getElementById(object).style.visibility='hidden';
    else if (document.layers && document.layers[object] != null)
        document.layers[object].visibility = 'hidden';
    else if (document.all)
         document.all[object].style.visibility = 'hidden';
}

      if (document.images) {
            img01on = new Image();          
            img01on.src = "images/button_1_on.gif";   
            img02on = new Image();          
            img02on.src = "images/button_2_on.gif";     		
            img03on = new Image();          
            img03on.src = "images/button_3_on.gif";    
            img04on = new Image();          
            img04on.src = "images/support_on.gif";    
            img05on = new Image();          
            img05on.src = "images/contact_us_on.gif";// Active Images (rollover)
			  
			  img01off = new Image();          
            img01off.src = "images/button_1_off.gif";   
            img02off = new Image();          
            img02off.src = "images/button_2_on.gif";     		
            img03off = new Image();          
            img03off.src = "images/button_3_on.gif";    
            img04off = new Image();          
            img04off.src = "images/support.gif";    
            img05off = new Image();          
            img05off.src = "images/contact_us.gif";// INactive Images
			  
			  img01ad = new Image();         
            img01ad.src = "images/image_1.gif";      
            img02ad = new Image();         
            img02ad.src = "images/messprod.gif";
            img03ad = new Image();         
            img03ad.src = "images/messerv.gif";       
            img04ad = new Image();         
            img04ad.src = "images/messupp.gif";      
            img05ad = new Image();         
            img05ad.src = "images/messcont.gif";// Secondary popup Images
        }
// Function to 'activate' images.
function imgOn(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "on.src");
            document["photo"].src = eval(imgName + "ad.src");
        }
}
// Function to 'deactivate' images.
function imgOff(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "off.src");
            document["photo"].src = "images/photo1.gif"; // Initially loaded Secondary popup Image
        }
}

