$(document).ready(function() {
  $('.catNav ul li.tlcLI').hover(function() {
    $(this).addClass('selected2');
  }, function() {
    $(this).removeClass('selected2');
  });
});


function eyacc(n){
var mc="SubSection-"+n;

if (document.getElementById(mc).style.display == "block") {
$("#SubSection-"+n).slideUp("slow");
//document.getElementById('SubSection-'+n).style.display='none';
$("#Arrow-"+n).attr("src","http://lib.store.yahoo.net/lib/wind-sun/ey-plus.jpg");
//document.getElementById('Arrow-'+n).src='http://lib.store.yahoo.net/lib/wind-sun/ey-plus.jpg';
} 
else {

$("#SubSection-"+n).slideDown("slow");
//document.getElementById('SubSection-'+n).style.display='block';
$("#Arrow-"+n).attr("src","http://lib.store.yahoo.net/lib/wind-sun/ey-minus.jpg");
//document.getElementById('Arrow-'+n).src='http://lib.store.yahoo.net/lib/wind-sun/ey-minus.jpg';
}
}

function changeTab(b){
$(".tabs").css("display","none");
$("#Tab"+b).css("display","block");
}

function formatCurrency(num) {num = num.toString().replace(/\$|\,/g,'');if(isNaN(num))num = "0";sign = (num == (num = Math.abs(num)));num = Math.floor(num*100+0.50000000001);cents = num%100;num = Math.floor(num/100).toString();if(cents<10)cents = "0" + cents;for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));return (((sign)?'':'-') + '$' + num + '.' + cents);}

Number.prototype.formatMoney = function(c, d, t){
	var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
	return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
};

function changePrice()
{

var tempOut;
var tempOut2;
var tempOut3;
var tempOut4;
var numberOption;
var newTotal=0;
var tempValue;
var accValue=0;
var f=parseFloat(price);

for (m=0; m<document.forms.length; m++)
{
	for (i=0; i<document.forms[m].elements.length; i++)
 	 {
	    if(document.forms[m].elements[i].type=="select-one")
  		  {
   		   tempValue=document.forms[m].elements[i].value;

                   accValue=accValue + tempValue;
                   tempOut=tempValue.split("$");
				   
				   
				   if(tempOut.length > 1)
				   {
					   tempOut2=tempOut[1];
					   tempOut3=tempOut2.split(")");
					   tempOut4=tempOut3[0];
					   numberOption=parseFloat(tempOut4);
					   f=f+numberOption;
					   newTotal=Math.round(parseFloat(f) * 100) / 100;
					}
					
    
       		  }
 	 }

}

 $("#NewPrice").text("");
 $(".orderSalePrice").css("text-decoration", "none");
if(newTotal !=0)
{
 $(".orderSalePrice").css("text-decoration", "line-through");
 $("#NewPrice").append("<div class=priceWithOptionsText>Price With Options: <font color=\"#e12500\">"+formatCurrency(newTotal)+"</font></div>");
}
}

function check()
{
  if(document.theform.fname.value.length==0)
  {
   alert('Please enter your first name');
   document.theform.fname.focus();
   return;
  }
  if(document.theform.lname.value.length==0)
  {
   alert('Please enter your last name');
   document.theform.lname.focus();
   return;
  }
  if(document.theform.email.value.length==0)
  {
   alert('Please enter your email address');
   document.theform.email.focus();
   return;
  }
  if(document.theform.subject.value.length==0)
  {
   alert('Please enter a subject for the email');
   document.theform.subject.focus();
   return;
  }
  if(document.theform.message.value.length==0)
  {
   alert('Please enter your inquiry');
   document.theform.message.focus();
   return;
  }
document.theform.submit();
}
