
// tabbed panel function -->
var ids = new Array('home_image1','home_image2','home_image3','home_image4','home_image5');
var tabs = new Array('home_tab1','home_tab2','home_tab3','home_tab4','home_tab5');


function switchid(id,tab){
	hideallids();
	showdiv(id,tab);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i],tabs[i]);
	}		  
}

function hidediv(id,tab) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
		document.getElementById(tab).className = 'def';
	}
}

function showdiv(id,tab) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
		document.getElementById(tab).className = 'sel';
	}
}

//end tabbed panel script

// tabbed panel function -->
var page = new Array('gallery1','gallery2');
var btn = new Array('work_tab1','work_tab2');


function switchpg(page,btn){
	hideallbtns();
	showpg(page,btn);
}

function hideallbtns(){
	//loop through the array and hide each element by id
	for (var i=0;i<page.length;i++){
		hidepg(page[i],btn[i]);
	}		  
}

function hidepg(page,btn) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(page).style.display = 'none';
		document.getElementById(btn).className = 'def';
	}
}

function showpg(page,btn) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(page).style.display = 'block';
		document.getElementById(btn).className = 'sel';
	}
}

//end tabbed panel script

var clickmessage="This image copyright 2011 Metal Solutions LLC. Please contact office@metalsolutionsllc.com."

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all)
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages()


