var isNav, isIE, isN6;
var coll = "";
var styleObj = "";
var currSub = "none"
var name = "none"

if( navigator.appName == "Netscape"){
	if ( parseInt( navigator.appVersion ) >= 5 ){
		isN6 = true;
		//styleObj = ".style";
		//coll = "getElementById(";
		//styleObj = ").style";
	}
	else
		isNav = true;
	
}
else{
	isIE = true;
	coll = "all.";
	styleObj = ".style";
}



function getObject( obj ){
	var theObj, temp;
	//if( isN6 ){
		//theObj = document.getElementById( obj )
		//alert( theObj );
	//}
	if(typeof obj == "string"){
		if( isN6 ){
			theObj = document.getElementById( obj ).style;
			//theObj = eval("document."+obj+".style");
			//alert( theObj );
		}
		else
			theObj = eval("document."+coll+obj+styleObj);
	}else{
		theObj = obj;
	}
	return theObj;
}

function rollOver( imageName, imageSrc, layer ){
	
	if( imageName != ""){
		if( isNav ){
			if( layer != "" ){
				var obj = eval("document."+layer+".document");
				obj.images[imageName].src = imageSrc;
			}
			else
				document.images[imageName].src = imageSrc;
		}
		else{
			document[imageName].src = imageSrc;
		}
	}
}


function openWin( URL ) { 
  var newWin = window.open(URL,"newWin","toolbar,scrollbars,width=450,height=470");
  newWin.focus();
}




function preloadImgs() { 

		
		//img1 = new Image; 
		//img1.src = "images/menu/contacton.gif";

}

function reloadWin(){
	document.location = document.location;
}


function isEmpty( str ){


	if(( str == "") || (str == " ")){
	
		return true;
	}


}

function openwin( URL ){
	
		winwidth = 550;
		winheight = 550;
		var newWin = window.open(URL,"presswin","toolbar,scrollbars,width=" + winwidth + ",height=" + winheight );
	  	//alert("width=" + winwidth + ",height=" + winheight);
		newWin.focus();


}

function previewImg( URL ){
	winwidth = 550;
	winheight = 300;
	var newWin = window.open(URL,"presswin","toolbar,resizeable,scrollbars,width=" + winwidth + ",height=" + winheight );
	//alert("width=" + winwidth + ",height=" + winheight);
	newWin.focus();


}

function previewselectedpic(){
	d = document.mainform.picture;
	src = d.options[d.selectedIndex].value;
	if( d.selectedIndex > 0 ){
		URL = "previewimage.php?img=" + src;
		previewImg( URL );
	}

}

function previewthumpic(){
	d = document.mainform.thumbnail;
	src = d.options[d.selectedIndex].value;
	if( d.selectedIndex > 0 ){
		URL = "previewimage.php?img=" + src;
		previewImg( URL );
	}

}

function previewhomepic(){
	d = document.mainform.homepic;
	src = d.options[d.selectedIndex].value;
	if( d.selectedIndex > 0 ){
		URL = "previewimage.php?img=" + src;
		previewImg( URL );
	}

}

function previewfilepic(){
	d = document.mainform.filepath;
	src = d.options[d.selectedIndex].value;
	if( d.selectedIndex > 0 ){
		URL = "previewimage.php?img=" + src;
		previewImg( URL );
	}

}



var currentProjDetail = "";

function showProjDetails( str ){
	showdetails = true;
	
	thediv = document.getElementById(str);
	
	//if this has been clicked open already it is being shut
	if( thediv.style.display == "block"	){
		currentProjDetail = "";
		thediv.style.display = "none";
		showdetails = false;
	}
	
	//open if not open already
	if(showdetails){
		//close another one that may already be open
		hideCurrentProj();
		currentProjDetail = str;
		thediv = document.getElementById(str);
	 	thediv.style.display = "block";
	}

}

function hideCurrentProj(){
	
	if( currentProjDetail != "" ){
		thediv = document.getElementById(currentProjDetail);
 		thediv.style.display = "none";
	}
}

