// JavaScript Document

function PlayLaPazMovie1()
{
	document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" \n');
	document.write('codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" \n');
	document.write('width="320" height="256" align="middle"/>\n');
	document.write('<param name="src" value="video/LaPazMacro.mp4" />\n');
	document.write('<param name="autoplay" value="true" /> \n <embed src="video/LaPazMacro.mp4" \n');
	document.write('autoplay="true" width="320" height="256" align="middle" bgcolor="black" \n');
	document.write('pluginspage="http://www.apple.com/quicktime/download/ "> </embed></object>\n');
}
function PlayLaPazMovie2()
{
	document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" \n');
	document.write('codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" \n');
	document.write('width="320" height="256" align="middle"/>\n');
	document.write('<param name="src" value="video/LaPazWide.mp4" />\n');
	document.write('<param name="autoplay" value="true" /> \n <embed src="video/LaPazWide.mp4" \n');
	document.write('autoplay="true" width="320" height="256" align="middle" bgcolor="black" \n');
	document.write('pluginspage="http://www.apple.com/quicktime/download/ "> </embed></object>\n');
}

function PlayPalauMovie()
{
	document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" \n');
	document.write('codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" \n');
	document.write('width="575" height="343" align="middle"/>\n');
	document.write('<param name="src" value="video/SEASICK-575X323-Bit-Rate-1100.mov" />\n');
	document.write('<param name="autoplay" value="true" /> \n <embed src="video/SEASICK-575X323-Bit-Rate-1100.mov" \n');
	document.write('autoplay="true" width="575" height="343" align="middle" bgcolor="black" \n');
	document.write('pluginspage="http://www.apple.com/quicktime/download/ "> </embed></object>\n');
}

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
// PRODUCT DETAIL TABS

function toggle( id ) {

	collapseDivs(); // first hide all the tabs
	doButtons();
	
	// then open the tab that is clicked
	var loc = document.getElementById( id );
	if( loc.className == 'hide' ) {
		loc.className = 'show';
	} else {
		loc.className = 'hide';
	}

	// changed the class of the selected tab heading
	var button = id  + '-button';
	var loc_button = document.getElementById( button );
	if( loc_button.className == '' ) {
	 	loc_button.className = 'selected';
	} else {
	 	loc_button.className = '';
	}
	
	// expand all divs within the selected tab	
	var allDivs = document.getElementById( id ).getElementsByTagName( 'div' );
	for ( var i = 0; i < allDivs.length; i++ ) {
		allDivs[i].className = 'show';
  }
	
}

// collapse all divs within tab-content
function collapseDivs() { 
  var allDivs = document.getElementById( 'tab-content' ).getElementsByTagName( 'div' );
	for ( var i = 0; i < allDivs.length; i++ ) {
		allDivs[i].className = 'hide';
  }
}
function doButtons() {
	var deselectTabs = document.getElementById( 'tab-headings' ).getElementsByTagName( 'a' );
	for ( var i = 0; i < deselectTabs.length; i++ ) {
		deselectTabs[i].className = '';
  }
}

function show(content_id){
	document.getElementById(content_id).style.visibility="visible";
}

function hide(content_id){
	document.getElementById(content_id).style.visibility="hidden";
}

// Gallery Functions

function get_next_gallery_age () {
	var sPath = window.location.pathname;
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	alert(sPage);
}
