
  var min=10;
  var max=16;
  tags = new Array ( "p", "td", "div" );

  function increaseFontSize() {
  for (j=0; j<tags.length; j++) {
           var p = document.getElementsByTagName(tags[j]);
           for(i=0;i<p.length;i++) {
              if(p[i].style.fontSize) {
                 var s = parseInt(p[i].style.fontSize.replace("px",""));
             } else {
                 var s = 12;
              }
              if(s!=max) {
                 s += 1;
              }
             p[i].style.fontSize = s+"px"
           }
        }
      }
  function decreaseFontSize() {
  for (j=0; j<tags.length; j++) {
           var p = document.getElementsByTagName(tags[j]);
           for(i=0;i<p.length;i++) {
             if(p[i].style.fontSize) {
                 var s = parseInt(p[i].style.fontSize.replace("px",""));
              } else {
                 var s = 12;
              }
              if(s!=min) {
                 s -= 1;
              }
              p[i].style.fontSize = s+"px"
           }
        }
      }


function paCreateRollOvers(){
	if(document.getElementById){
		var paImages = document.getElementsByTagName('IMG');
		var paButtons = document.getElementsByTagName('INPUT');
	}else if(document.all && navigator.userAgent.indexOf('Mac')==-1){
		var paImages = document.all['mouseovers'].all.tags('IMG');
		var paButtons = document.all['mouseovers'].all.tags('INPUT');
	}else return;
	paPreloads = new Object();

	for (var i = 0; i < paImages.length; i++){
		var paImageOffSrc = paImages[i].src + "";
		if(paImageOffSrc.indexOf("_off.") != -1){
			var paImageOnSrc = paImageOffSrc.replace(/_off\./g, "_on.");
			paPreloads['paImageOff_' + i] = new Image();
			paPreloads['paImageOff_' + i].src = paImageOffSrc;
			paPreloads['paImageOn_' + i] = new Image();
			paPreloads['paImageOn_' + i].src = paImageOnSrc;
			/*paPreloads['paImageOn_' + i].onerror = function(){this.src='/images/blank.gif';}*/
			paImages[i].onmouseover = function(){this.src = this.src.replace(/_off\./g, "_on.");}
			paImages[i].onmouseout = function(){this.src = this.src.replace(/_on\./g, "_off.");}
		}
	} 

	for (var i = 0; i < paButtons.length; i++){
		if(paButtons[i].src){
		var paImageOffSrc = paButtons[i].src + "";
		if(paImageOffSrc.indexOf("_off.") != -1){
			var paImageOnSrc = paImageOffSrc.replace(/_off\./g, "_on.");
			paPreloads['paImageOff_' + i] = new Image();
			paPreloads['paImageOff_' + i].src = paImageOffSrc;
			paPreloads['paImageOn_' + i] = new Image();
			paPreloads['paImageOn_' + i].src = paImageOnSrc;
			/*paPreloads['paImageOn_' + i].onerror = function(){this.src='/images/blank.gif';}*/
			paButtons[i].onmouseover = function(){this.src = this.src.replace(/_off\./g, "_on.");}
			paButtons[i].onmouseout = function(){this.src = this.src.replace(/_on\./g, "_off.");}
		}
		}
	} 
}

window.onload = paCreateRollOvers;

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_findObj(n, d) { //v4.0
  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_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function hide(id){ 
if (document.getElementById){ 
obj = document.getElementById(id); 
obj.style.display = "none"; 
} 
} 

function show(id){ 
if (document.getElementById){ 
obj = document.getElementById(id); 
obj.style.display = ""; 
} 
}

function showhide(id){
if (document.getElementById){
obj = document.getElementById(id); 
if (obj.style.display == "none"){ 
obj.style.display = ""; 
} else { 
obj.style.display = "none"; 
} 
} 
} 

function showhide_cal(id,cid,use_2nd,use_overnight,use_saturday){
	
//!!!
	cost_2nd=iscosts[cid][0];
	cost_overnight=iscosts[cid][1];
	cost_saturday=iscosts[cid][2];
	if (use_2nd != "0")
	{
		MM_setTextOfLayer("scost_2nd_"+cid,"","2nd Day ($"+iscosts[cid][0]+")");
	}
	else
		 MM_setTextOfLayer("scost_2nd_"+cid,"","N/A");		
	if (use_overnight != "0")
		MM_setTextOfLayer("scost_overnight_"+cid,"","Overnight ($"+iscosts[cid][1]+")");
	else
		 MM_setTextOfLayer("scost_overnight_"+cid,"","N/A");
	if (cost_saturday != 0 && (use_saturday != "0"))
		MM_setTextOfLayer("scost_saturday_"+cid,"","Saturday ($"+iscosts[cid][2]+")");
	else
		 MM_setTextOfLayer("scost_saturday_"+cid,"","N/A");
	
//!!!	
if (document.getElementById){
obj = document.getElementById(id); 
if (obj.style.display == "none"){ 
obj.style.display = ""; 
} else { 
obj.style.display = "none"; 
} 
} 
}

myUrl = location.href;
mySub1 = ".php";
mySub2 = "-all.php";

function leftFromSubStringToBeginningOfFullString(fullString, subString) {
if (fullString.lastIndexOf(subString) == -1) {
return "";
} else {
return fullString.substring(0, fullString.lastIndexOf(subString));
}
}

function viewall() {
myText = leftFromSubStringToBeginningOfFullString(myUrl, mySub1);
document.write('<A HREF="');
document.write(myText); 
document.write('-all.php">');
document.write('View All');
document.write('</A>');
}

function normalview() {
myText = leftFromSubStringToBeginningOfFullString(myUrl, mySub2);
document.write('<A HREF="');
document.write(myText); 
document.write('.php">');
document.write('View Larger Photos');
document.write('</A>');
}

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

function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
cntfield.value = maxlimit - field.value.length;
}

//Products
var cX = 0; var cY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
	d.style.left = (cX-150) + "px";
	d.style.top = (cY-150) + "px";
}

function HideContent(d) {
	if(d.length < 1) { return; }
	document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
	if(d.length < 1) { return; }
	var dd = document.getElementById(d);
	AssignPosition(dd);
	dd.style.display = "block";
}


allrows=new Object();
allcols=new Object();
colsrows=new Object();
function get_itemsh_val(obj){
	if(obj.length && obj.length>0){
		for(i=0;i<obj.length;i++){
			if(obj[i].checked) return(obj[i].value);
		}
	}
	if(obj.options) return(obj.options[obj.options.selectedIndex].value);
	else return(obj.value);
}
function setopts(form_name, prefix, item_id, set_col, set_layers, set_img_link){
	f=document.forms[form_name];
//Set cols
	if(set_col && f['comb_col'+prefix].options){
		currrowval=-1;
		if(f['comb_col'+prefix].options) currcolval=f['comb_col'+prefix].options[f['comb_col'+prefix].options.selectedIndex].value;
//Clear options
		if(f['comb_col'+prefix].options) for(i=f['comb_col'+prefix].options.length;i>-1;i--) f['comb_col'+prefix].options[i]=null;
		newrowval=get_itemsh_val(f['comb_row'+prefix]);
		n=0;
		for(var i in colsrows[item_id][newrowval]){
			no = document.createElement("OPTION");
			no.text=allcols[item_id][i];
			no.value=i;
			if(i==currcolval) no.selected=1;
			f['comb_col'+prefix].options[n]=no;
			n++;
		}
	}
	if(set_layers){
		newrowval=get_itemsh_val(f['comb_row'+prefix]);
		newcolval=get_itemsh_val(f['comb_col'+prefix]);
//Set price
		MM_setTextOfLayer('pricelayer'+prefix,'',colsrows[item_id][newrowval][newcolval]['price_displ']);
		MM_setTextOfLayer('pricesalelayer'+prefix,'',colsrows[item_id][newrowval][newcolval]['price_sale_displ']);
		MM_setTextOfLayer('skulayer'+prefix,'',colsrows[item_id][newrowval][newcolval]['sku_displ']);
	}
	if(set_img_link){
		document.images.picthumb.src=colsrows[item_id][newrowval][newcolval]['pic_list'];
		document.images.picthumb.style.width=colsrows[item_id][newrowval][newcolval]['pic_width'];
		document.images.picthumb.style.height=colsrows[item_id][newrowval][newcolval]['pic_height'];
		currrowid=newrowval;
	}
}

function EnsureNumeric()
{
	var k = window.event.keyCode;
	if (( k < 48 || k > 57) && k != 8 && k != 13 && k != 44) {window.event.returnValue = false; }
}

function CheckPhoneNumber(ob){
	f=ob.form;
	n=ob.name;
	v=ob.value;
	nextfield=0;
	currfield=parseInt(n.substr(n.length-1,1));
	fn=n.substr(0,n.length-1);
	if(currfield<3) nextfield=currfield+1;
	if(nextfield){
		if(v.length>=3){
			f[fn+nextfield].focus();
		}
	}
}
function shipMethod(inputID, day, method) {
	input = document.getElementById("shippingMethod" + inputID);
	/*if (method == "2Day") input.selectedIndex = 1;
	else if (method == "overNight") input.selectedIndex = 2;
	else input.selectedIndex = 3;*/
	if (method == "2Day") input.value = "2nd Day - $15.00";
	else if (method == "overNight") input.value = "Overnight - $54.00";
	else input.value = "Saturday - $85.00";
	input = document.getElementById("deliveryDate" + inputID);
	input.value = day;
	/*input.disabled = false;*/
	showhide("calendarPopUp" + inputID);
}