// JavaScript Document

function MM_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { 
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

MM_preloadImages('/images/nav01-over.gif', '/images/nav02-over.gif', '/images/nav03-over.gif', '/images/nav04-over.gif');

var popupwin=0;
function win_popup(v_path) {
popupwin = open(v_path, 'popupwin', 'height=600,width=800,toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=no');
}

function showPhoto(v_photo, photo_cap) {
	document.getElementById('photo_large').src='/images/photos/' + v_photo;
	document.getElementById('photo_caption_area').innerHTML=photo_cap;
}


function writeVideo(vid_url, vid_cap) {
	var so2 = new SWFObject(vid_url + "&fs=0&rel=0", 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000', '410', '332', '6', '#ffffff'); so2.addParam('wmode','opaque'); so2.write ('video_player');
	document.getElementById('video_caption_area').innerHTML=vid_cap;
}

function write_video2(vid_url, vid_cap) {
//	swfobject.embedSWF(vid_url + "&fs=0&rel=0", "video_player", "326", "264", "6", null, null, {menu:"false",wmode:"opaque"}, {id:"vidContent",name:"vidContent"});
//	var so2 = new SWFObject(vid_url, 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000', '326', '264', '6', '#ffffff'); so2.addParam('wmode','opaque'); so2.write ('video_player');
//	document.getElementById('video_caption_area').innerHTML=vid_cap;
}

$(document).ready(function(){
//$("#survivor").hide();
//$("#video").hide();
//$("#blog").hide();

$("#tabs_drawing").mouseover(function () {
	$(this).attr("src", "/images/tabs_drawing_over.gif");
});
$("#tabs_location").mouseover(function () {
	$(this).attr("src", "/images/tabs_location_over.gif");
});
$("#tabs_description").mouseover(function () {
	$(this).attr("src", "/images/tabs_description_over.gif");
});
$("#tabs_photos").mouseover(function () {
	$(this).attr("src", "/images/tabs_photos_over.gif");
});

$("#tabs_drawing").click(function(event){
	$("#location").hide();
	$("#description").hide();
	$("#drawing").fadeIn(400);
});

$("#tabs_location").click(function(event){
	$("#description").hide();
	$("#drawing").hide();
	$("#location").fadeIn(400);
});

$("#tabs_description").click(function(event){
	$("#location").hide();
	$("#drawing").hide();
	$("#description").fadeIn(400);
});

$("#myController").jFlow({
		slides: "#mySlides",
		controller: ".jFlowControl", // must be class, use . sign
		slideWrapper : "#jFlowSlide", // must be id, use # sign
		selectedWrapper: "jFlowSelected",  // just pure text, no sign
		width: "100%",
		height: "370px",
		duration: 400,
		prev: ".jFlowPrev", // must be class, use . sign
		next: ".jFlowNext" // must be class, use . sign
	});


});

var tab_select='tabs_drawing';
function click_tab(tabid) {
	document.getElementById('tabs_drawing').src='/images/tabs_drawing.gif';
	document.getElementById('tabs_location').src='/images/tabs_location.gif';
	document.getElementById('tabs_description').src='/images/tabs_description.gif';
	document.getElementById('tabs_photos').src='/images/tabs_photos.gif';
	tab_select=tabid;
	if (tabid == 'tabs_drawing'){
	document.getElementById('tabs_drawing').src='/images/tabs_drawing_over.gif';
	}
	if (tabid == 'tabs_location'){
	document.getElementById('tabs_location').src='/images/tabs_location_over.gif';	
	}
	if (tabid == 'tabs_description'){
	document.getElementById('tabs_description').src='/images/tabs_description_over.gif';	
	}
	if (tabid == 'tabs_photos'){
	document.getElementById('tabs_photos').src='/images/tabs_photos_over.gif';	
	}
}

function tab_restore(tabover) {
	if (tabover == tab_select) {
	document.getElementById(tabover).src='/images/' + tabover + '_over.gif';
	}else{
	document.getElementById(tabover).src='/images/' + tabover + '.gif';
	}
}

function showProdPhoto(v_photo, photo_cap) {
$('#photo_large').hide();
$('#photo_large').load(function() {
	$(this).fadeIn('slow');
	}).attr('src', v_photo);
//$('#photo_large').attr('src', v_photo);
$('#photo_caption_area').text(photo_cap);
//$('#photo_large').show('normal');
//	document.getElementById('photo_large').src=v_photo;
//	document.getElementById('photo_caption_area').innerHTML=photo_cap;
}

function show_prod_photo(v_photo, photo_cap, loc) {
	document.getElementById('photo_large').src='/images/' + loc + '/' + v_photo;
//	$("img#photo_large").attr("src", "/aire/images/photos/" + v_photo);
	document.getElementById('photo_caption_area').innerHTML=photo_cap;
}
