// JavaScript Document

//BROWSER SNIFF
var isIE4 = (document.all && !document.getElementById) ? true : false;
var isIE5 = (document.all && document.getElementById) ? true : false;
var isNS6 = (!document.all && document.getElementById) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var isDHTML = (isIE5 || isNS6);
var isPc = navigator.userAgent.indexOf("Windows") != -1;
var isMac = !isPc;

var thisPic = 0;

function picMainChange(picName,picNum) {

	var prevPic = thisPic - picNum;
	
    if (document.images)
        document.picMain.src = 'images/portfolio/'+picName+'.jpg';
		
		if (isIE4==true){
		obj = eval('document.all.portpic' + picNum + '.style');
        	obj.visibility = 'visible';
			//###################################################
        	//TURN OFF ALL OTHERS
        	//loop through all pics
        	for(i=1;i<7;i++) {
        		//if this one is NOT the one we are turning on AND if there is indeed a pic at this number, turn off (hide) this description
        		if(i!=picNum && (obj = eval('document.all.portpic' + i + '.style'))!=null){
					//obj = eval('document.all.pic' + i);
        			obj.visibility = 'hidden';
        		}
        	}
	} else if (isIE5==true){
        	obj = eval('document.all.portpic' + picNum);
        	obj.style.visibility = 'visible';
			//###################################################
        	//TURN OFF ALL OTHERS
        	//loop through all pics
        	for(i=1;i<7;i++) {
        		//if this one is NOT the one we are turning on AND if there is indeed a pic at this number, turn off (hide) this description
        		if(i!=picNum && (obj = eval('document.all.portpic' + i))!=null){
					//obj = eval('document.all.pic' + i);
        			obj.style.visibility = 'hidden';
        		}
        	}
   	} else if (isNS6==true){
        	obj = document.getElementById('portpic' + picNum);
        	obj.style.visibility = 'visible';
			//###################################################
        	//TURN OFF ALL OTHERS
        	//loop through all pics
        	for(i=1;i<7;i++) {
        		//if this one is NOT the one we are turning on AND if there is indeed a pic at this number, turn off (hide) this description
        		if(i!=picNum && (obj = document.getElementById('portpic' + i))!=null){
					//obj = eval('document.all.pic' + i);
        			obj.style.visibility = 'hidden';
        		}
        	}
    	}
}