var rof = document.cookie.match ( "referreronfile" + '=(.*?)(;|$)' );
if (rof == null) {
    document.cookie = "referreronfile=" + (document.referrer) + "; path=/" ; 
}

var myHeight;
var myWidth;
var myCount;
var mySets;
function HowMany(form) {
var cost;
var characters;
var costperchar;
if (myCount < 11) {
cost = ((myHeight * myWidth / 57) + (myCount * .35)) * mySets ; 
}
if (myCount > 10 && myCount < 21) {
cost = ((myHeight * myWidth / 57) + (myCount * .315)) * mySets ; 
}
if (myCount > 20 && myCount < 41) {
cost = ((myHeight * myWidth / 57) + (myCount * .28)) * mySets ; 
}
if (myCount > 40 && myCount < 61) {
cost = ((myHeight * myWidth / 57) + (myCount * .245)) * mySets ; 
}
if (myCount > 60) {
cost = ((myHeight * myWidth / 57) + (myCount * .21)) * mySets ; 
}

if (mySets > 1 && mySets < 6) {
cost = cost *.95;
}
if (mySets > 5 && mySets < 11) {
cost = cost *.90;
}
if (mySets > 10 && mySets < 26) {
cost = cost *.85;
}
if (mySets > 25 && mySets < 51) {
cost = cost *.80;
}
if (mySets > 50) {
cost = cost *.75;
}
cost = cost + 15
if (cost < 100.01) {
cost = 100.00
}
costperchar = cost / (mySets*myCount)

form.Fdiff.value = '$' + cost.toFixed(2); 
form.cpc.value = '$' + costperchar.toFixed(2); 
}



function SetMyHeight(height) {
myHeight = height.value;
}
function SetMyWidth(width) {
myWidth = width.value;
}
function SetMyCount(count) {
myCount = count.value;
}
function SetMySets(sets) {
mySets = sets.value;
}

function ClearForm(form){
form.myHeight.value = "";
form.myWidth.value = "";
form.myCount.value = "";
form.mySets.value = "";
form.Fdiff.value = "";
form.cpc.value = "";
}
// End -->

<!-- Begin
function CountCharacters (this_field, show_char_count) {
	if (show_char_count == null) {
		show_char_count = false;
		}
	var char_count = this_field.value.length;
	cc = this_field.value; // customers charcters
	var i;
	for (i = 0; i < cc.length; i++) { 
		if (cc.charCodeAt(i) == 32) {  // test for spaces
			char_count --; // char_count = char_count - 1
			}
		if ((cc.charCodeAt(i) == 13) && (cc.charCodeAt(i + 1) == 10)) { // test for cr and lf
			char_count --; 
			char_count --; 
			}
	}
	if (char_count == 1) {
		charOrChars = " character";
		} 
	else {
		charOrChars = " characters";
		}
	if (show_char_count) {
		price.justCount.value = char_count;
		}
	}
// End -->


m = "Please respond as soon as possible...";
u = "Please include the following in your email 1) the height and width that you would like the graphics to cover. 2) the text you would like on your graphics. 3) if you have a preference, the font name. 4) the quantity of graphics. 5) the color of the graphics - We will email you back a firm quote.";
function send_email() {
// the following expression must be all on one line...
window.location = "mailto:orders@vinyl-graphics-lettering.com?subject="+m+"&body="+u;
}

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];}}
}

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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

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];}
}
