// 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 show_nav_item(divid) {
        $("#" + divid).slideToggle("slow");
}

function dispElement(divid, disp) {
	$("#product_images_alt").fadeOut(300, function(){
		$("#product_image").show();
		});
}

function show_color_image(v_photo) {
	document.getElementById('product_alt_image').src='/aire/images/products/colors/' + v_photo;
	$("#product_image").hide();
	$("#product_images_alt").fadeIn(300);
}

function ddnavOver(navid) {
//	document.getElementById(navid).style.display='block';
//	$("#" + navid).hide("slide", { direction: "down" }, 1000);
       $("#" + navid).slideDown("slow");
}

function ddnavOut(navid) {
//document.getElementById(navid).style.display='none';
//	$("#" + navid).hide("slide", { direction: "up" }, 1000);
       $("#" + navid).hide();
}

$(document).ready(function(){

$("#alt_close").click(function () {
	$("#product_images_alt").hide();
	$("#product_image").fadeIn(300);
});

$("#product_images_alt").click(function () {
	$("#product_images_alt").hide();
	$("#product_image").fadeIn(300);
});

$("#quicknavlink").click(function () {
	$("#quickfind").fadeIn(300);
});

$("#quickfindclose").click(function () {
	$("#quickfind").fadeOut(300);
});

$("#product_desc_tab").click(function () {
	$("#product_photos").hide();
	$("#product_acc").hide();
	$("#product_videos").hide();
	
	$("#product_desc").fadeIn(300);
});
$("#product_photos_tab").click(function () {
	$("#product_desc").hide();
	$("#product_acc").hide();
	$("#product_videos").hide();
	
	$("#product_photos").fadeIn(300);
});

$("#product_acc_tab").click(function () {
	$("#product_desc").hide();
	$("#product_photos").hide();
	$("#product_videos").hide();
	
	$("#product_acc").fadeIn(300);
});

$("#product_videos_tab").click(function () {
	$("#product_desc").hide();
	$("#product_photos").hide();
	$("#product_acc").hide();
	
	$("#product_videos").fadeIn(300);
});

});


var tab_select='tabs_1';
function click_tab(tabid) {
	document.getElementById('tabs_1').src='/aire/images/tabs_1.gif';
	document.getElementById('tabs_2').src='/aire/images/tabs_2.gif';
	document.getElementById('tabs_3').src='/aire/images/tabs_3.gif';
	document.getElementById('tabs_4').src='/aire/images/tabs_4.gif';
	tab_select=tabid;
	if (tabid == 'tabs_1'){
	document.getElementById('tabs_1').src='/aire/images/tabs_1-on.gif';
	}
	if (tabid == 'tabs_2'){
	document.getElementById('tabs_2').src='/aire/images/tabs_2-on.gif';	
	}
	if (tabid == 'tabs_3'){
	document.getElementById('tabs_3').src='/aire/images/tabs_3-on.gif';	
	}
	if (tabid == 'tabs_4'){
	document.getElementById('tabs_4').src='/aire/images/tabs_4-on.gif';	
	}
}

function tab_restore(tabover) {
	if (tabover == tab_select) {
	document.getElementById(tabover).src='/aire/images/' + tabover + '-on.gif';
	}else{
	document.getElementById(tabover).src='/aire/images/' + tabover + '.gif';
	}
}

function show_prod_photo(v_photo, photo_cap) {
	document.getElementById('photo_large').src='/aire/images/photos/' + v_photo;
//	$("img#photo_large").attr("src", "/aire/images/photos/" + v_photo);
	document.getElementById('photo_caption_area').innerHTML=photo_cap;
}


function write_video2(vid_url, vid_cap) {
//	swfobject.embedSWF(vid_url, "video_player", "326", "264", "6", null, null, {menu:"false",wmode:"opaque"}, {id: "videoContent"});
	document.getElementById("video_caption_area").innerHTML=vid_cap;
}

function write_video(vid_url, vid_cap) {
	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;
}

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');
}

var popupwin=0;
function email_popup(v_path) {
popupwin = open(v_path, 'popupwin', 'height=400,width=600,toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=no');
}

var popupwin=0;
function review_popup(v_path) {
popupwin = open(v_path, 'popupwin', 'height=400,width=600,toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=no');
}


function menuover(obj, state){
if (state=='on'){
    obj.style.background = '#9B4523';
}else{
    obj.style.background = '#FFFFFF';
}
}

function menuoverSide(obj, state){
if (state=='on'){
    obj.style.background = '#E8E8E8';
}else{
    obj.style.background = '#F3F3F3';
}
}

function navOver(divid, state){
if (state=='on'){
    document.getElementById(divid).style.background = '#9B4523';
}else{
    document.getElementById(divid).style.background = '#FFFFFF';
}
}


function preloadImages() {
  if(document.images)  {
    if(!document.imageArray) document.imageArray = new Array();
    var i,j = document.imageArray.length, args = preloadImages.arguments;
    for(i=0; i<args.length; i++)    {
      if (args[i].indexOf("#")!=0)      {
        document.imageArray[j] = new Image;
        document.imageArray[j++].src = args[i];
      }
    }
  }
}


preloadImages('/aire/images/nav01-over.gif', '/aire/images/nav02-over.gif', '/aire/images/nav03-over.gif', '/aire/images/nav04-over.gif', '/aire/images/nav05-over.gif', '/aire/images/nav06-over.gif', '/aire/images/nav07-over.gif');

function display_element(divid) {
	if(document.getElementById(divid).style.display == 'none'){
      document.getElementById(divid).style.display = 'block';
    }else{
      document.getElementById(divid).style.display = 'none';
    }

}

function show_element(divid) {
	if(document.getElementById(divid).style.visibility == 'hidden'){
      document.getElementById(divid).style.visibility = 'visible';
    }else{
      document.getElementById(divid).style.visibility = 'hidden';
    }
}


function show_bubble(divid) {
     document.getElementById(divid).style.display = 'block';
}

function hide_bubble(divid) {
	 document.getElementById(divid).style.display = 'none';
}

//-->