 var oldTab = "tab_desc_2008";
 var oldTabDiv = "tab_desc_content_2008";
 var oldThumbObj = "";

 function showTab(tabId)
 {
  document.getElementById(oldTab).className = "tabBack";
  document.getElementById(oldTabDiv).style.display="none";
  oldTab = "tab_" + tabId + "_2008";
  oldTabDiv = "tab_" + tabId + "_content_2008";
  document.getElementById(oldTab).className = "tabFront";
  document.getElementById(oldTabDiv).style.display = "";
 }

 function showImgViewPreview(tdObj)
 {
  document.getElementById('div_preview_08').style.display = '';
  document.getElementById('div_standard_08').style.display = 'none';
  // red highlight
  if(!oldThumbObj)
  { oldThumbObj = document.getElementById('default_thumb_08'); }
  oldThumbObj.className = '';
  oldThumbObj = tdObj;
  oldThumbObj.className = 'selectedThumb08';
 }

 function showImgViewDefault(tdObj)
 {
  document.getElementById('div_preview_08').style.display = 'none';
  document.getElementById('div_standard_08').style.display = '';
  // red highlight
  if(!oldThumbObj)
  { oldThumbObj = document.getElementById('default_thumb_08'); }
  oldThumbObj.className = '';
  oldThumbObj = tdObj;
  oldThumbObj.className = 'selectedThumb08';
 }

function removeFrame08()
{
 var defaultThumb = document.getElementById('default_thumb_08');
 showImgViewDefault(defaultThumb);
 document.getElementById('choose_frame_2008').scrollLeft = '0px';
 changeFrameFP08(-2);
}
function is_select_oil()
{
 if(typeof(basePrice08)=="undefined")
 {
	 document.getElementById('bu_content').style.display='none';
	 document.getElementById('bu_tip').style.display='block';
	 return false;
 }	
 if(frameprice==0)
 {
	document.getElementById('bu_content').style.display='none';
	document.getElementById('bu_tip2').style.display='block';
 }


}
function is_select_oil_out()
{
 if(typeof(basePrice08)=="undefined")
 {
	 document.getElementById('bu_content').style.display='block';
	 document.getElementById('bu_tip').style.display='none';	
	 return false;
 }	
  if(frameprice>0)
 {
	document.getElementById('bu_content').style.display='block';
	document.getElementById('bu_tip2').style.display='none';
	 return false;
 }
}

function changeFrameFP08(num) {
 // figure new prices    if(typeof(varObj)=="undefined")

 if(typeof(basePrice08)=="undefined")
 {
	 default_thumb_08.text='plase select oil first';
	 return false;
 }
 basePrice08 = basePrice08 * 1;
 var newPrice08 = basePrice08 * 1 + (framePricesAry08[num] * 1);
 if(newPrice08 > basePrice08)
 {
  var framePrice08 = (framePricesAry08[num] * 1);
  framePrice08 = framePrice08.toFixed(2);
  newPrice08 = newPrice08.toFixed(2);
  var frameTxt08 = "<span class='framePrice08'>Frame Price: $" + framePrice08 + "</span> <a href='javascript:;' onClick='removeFrame08();'>[remove frame]</a><br><span class='yourPrice08'>Your Total Price: $" + newPrice08 + "</span>";
  document.getElementById('totalPrice2008').innerHTML = frameTxt08;
  document.getElementById('total_cart_price').value = newPrice08;
  document.getElementById("frame_price").value= framePrice08; 
  document.getElementById("frame_detail").value= num;

}
 else
 {
  newPrice08 = basePrice08.toFixed(2);
  var frameTxt08 = "<span class='framePrice08'>Frame Price: $0.00</span><br><span class='yourPrice08'>Your Total Price: $" + newPrice08 + "</span>";
  document.getElementById('totalPrice2008').innerHTML = frameTxt08;
  document.getElementById('total_cart_price').value = newPrice08;
  document.getElementById("frame_price").value= framePrice08; 
  document.getElementById("frame_detail").value= num;
 }

	var useNum;
	if(document.all) {
		var blurbDiv = document.all("blurb");
		var totalDiv = document.all("totalPrice");
		var f = document.all("frames_options");
	} else {
		var blurbDiv = document.getElementById("blurb");
		var totalDiv = document.getElementById("totalPrice");
		var f = document.getElementById("frames_options");
	}
	blurbDiv.innerHTML = "Complement this painting with the perfect frame.<br> Save up to <font color=\"#ae0011\"> 50% off</font> local frame shop prices.";
	totalDiv.innerHTML = "Painting unframed and rolled in a tube<br> No additional cost.";
	if(num > -1) useNum = num; else useNum = f.selectedIndex-1;
	if ((f.selectedIndex!=0&&num!=-2) || num > -1) {
		
		//if(num==0)
		//{
		//	blurbDiv.innerHTML = "Complement this painting with the perfect frame.<br> Save up to <font color=\"#ae0011\"> 50% off</font> local frame shop prices.";
		//}
		//else
		//{	
		useblurb = a[useNum].blurbText;
		blurbDiv.innerHTML = "<b>Frame Details:</b><br>" + useblurb+"<br>Frame photos may not to scale, please click \"see frame details\" button  to view frames ";
		//}
		useTotal = a[useNum].priceF;
		totalDiv.innerHTML = useTotal;
		s=a[useNum].imSrc;
		var i,j;
		i=s.indexOf(" src=",0);
		j=s.indexOf(" ",i+1);
		var s1=s.substring(i+5,j)
		ff=MM_findObj("framim");
		if (s1.substring(0,1)=='"') {
			s1=s1.substring(1,s1.length-1)
		}
		ff.src=s1;
	} else {
		ff=MM_findObj("framim");
		ff.src="/spacer.gif";
	};
	if(num >= 0){
		f.selectedIndex = num;
	}
	if(num < 0)
	{
		f.selectedIndex = 0;
		ff=MM_findObj("framim");
		ff.src="/spacer.gif";
		blurbDiv.innerHTML = "Complement this painting with the perfect frame.<br> Save up to <font color=\"#ae0011\"> 50% off</font> local frame shop prices.";
		totalDiv.innerHTML = "Painting unframed and rolled in a tube. <br> No additional cost.";
	}
};


function showFramesArea08()
{
}


function addLoadEvent(func) {
   var oldonload = window.onload;
   if (typeof window.onload != 'function') {
      window.onload = func;
   }
   else {
      window.onload = function() {
      oldonload();
      func();
    }
  }
}

function TextScroll(scrollname, div_name, up_name, down_name)
{
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = document.getElementById(this.div_name).scrollLeft;
    this.speed = 5;
    this.timeoutID = 0;
    this.div_obj = null;
    this.up_name = up_name;
    this.dn_name = down_name;

{
        if (document.getElementById) {
            div_obj = document.getElementById(this.div_name);
            if (div_obj) {
                this.div_obj = div_obj;
                this.div_obj.style.overflow = 'auto';
            }
            div_up_obj = document.getElementById(this.up_name);
            div_dn_obj = document.getElementById(this.dn_name);
            if (div_up_obj && div_dn_obj) {
div_up_obj.onmouseover = function() { eval(scrollname + ".scrollUp();") };
div_up_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };

div_dn_obj.onmouseover = function() { eval(scrollname + ".scrollDown();") };
div_dn_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };

            }
        }
    }

this.stopScroll = function() {
        clearTimeout(this.timeoutID);
this.scrollCursor = document.getElementById(this.div_name).scrollLeft;
    }

this.scrollUp = function() {
        if (this.div_obj) {
this.scrollCursor = document.getElementById(this.div_name).scrollLeft;
            this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
            this.div_obj.scrollLeft = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollUp()", 30);
        }
    }

this.scrollDown = function() {
        if (this.div_obj) {
this.scrollCursor = document.getElementById(this.div_name).scrollLeft;
            this.scrollCursor += this.speed;
            this.div_obj.scrollLeft = this.scrollCursor;
        if (this.div_obj.scrollLeft == this.scrollCursor) {
		this.timeoutID = setTimeout(this.name + ".scrollDown()", 30);
	} 
	else {
		this.scrollCursor = this.div_obj.scrollLeft;
	}

        }
    }

this.resetScroll = function() {
        if (this.div_obj) {
            this.div_obj.scrollLeft = 0;
            this.scrollCursor = 0;
        }
    }
}
