// --------------------------------------------------
// JavaScript Library
// Version: Sep 2008
// Dependencies: jquery-1.2.6.js
// --------------------------------------------------
// External Links
// --------------------------------------------------
function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName('a');
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute('href') && anchor.getAttribute('rel') == 'external') anchor.target = '_blank';
	}
}
$(function(){ externalLinks()});

// --------------------------------------------------
// Rollover Images
// --------------------------------------------------
function smartRollover(){
	if(document.getElementsByTagName){
		var imageTags = document.getElementsByTagName('img');
		for(var i=0; i < imageTags.length; i++) {
			if(imageTags[i].className == 'rollover'){
				if(imageTags[i].getAttribute('src').match('_off.')){
					imageTags[i].onmouseover = function(){
						this.setAttribute('src',this.getAttribute('src').replace('_off.','_on.'));
					}
					imageTags[i].onmouseout = function(){
						this.setAttribute('src',this.getAttribute('src').replace('_on.','_off.'));
					}
				}
			}
		}
	}
}
$(function(){ smartRollover()});

// --------------------------------------------------
// Image Toolbar Cancel
// --------------------------------------------------
function imageToolbarCancel() {
	if (!document.getElementsByTagName) return;
	var imageTags = document.getElementsByTagName('img');
	for (var i=0; i < imageTags.length; i++) {
		imageTags[i].setAttribute('galleryimg','no');
	}
}
$(function(){ imageToolbarCancel()});

// --------------------------------------------------
// Pop Up Window
// --------------------------------------------------
function popupWin(popHref,popWidth,popHeight) {
	popUpWin = window.open(
		popHref,
		'subwin',
		'width='+popWidth+',height='+popHeight+',scrollbars=1,resizable=1,directories=0,toolbar=0,status=1,location=0'
		);
	popUpWin.focus();
}

// --------------------------------------------------
// Change Photo
// --------------------------------------------------
function changePhoto(photoSrc){
	$("#photo-container p img").attr({src:photoSrc});
}