function launchLogin(){
	if(screen){
	  leftPos=screen.width-300;
	  leftPos=(leftPos/2)-5;
	  topPos=screen.height-150;
	  topPos=(topPos/2)-30;
	}
	shrevesLoginWin=window.open("/members/login.php", "shrevesLoginWin", "width=300,height=150,left="+leftPos+",top="+topPos);
}

function launchCurrentSale() 
{
	if(screen){
	  leftPos=screen.width-770;
	  leftPos=(leftPos/2)-5;
	  topPos=screen.height-530;
	  topPos=(topPos/2)-30;
	}
	shrevesInsiderWin=window.open("/currentSale.php", "shrevesInsiderWin", "resizable=yes,width=700,height=500,left="+leftPos+",top="+topPos);

}

function launchInsider(){
	if(screen){
	  leftPos=screen.width-770;
	  leftPos=(leftPos/2)-5;
	  topPos=screen.height-530;
	  topPos=(topPos/2)-30;
	}
	shrevesInsiderWin=window.open("/insider/insider.pdf", "shrevesInsiderWin", "resizable=yes,width=770,height=530,left="+leftPos+",top="+topPos);
}

function enlargePhoto(url){
	if(screen){
	  leftPos=screen.width-300;
	  leftPos=(leftPos/2)-5;
	  topPos=screen.height-150;
	  topPos=(topPos/2)-30;
	}
	url="/js/enlarge_photo.php?"+url;
	shrevesBigStampWin=window.open(url, "shrevesBigStampWin", "width=5,height=5,left="+leftPos+",top="+topPos);
}

function enlargePhoto2(url,w,h){
	// this function automatically opens the correct size instead of loading the page and then resizing
	if(screen){
	  leftPos=screen.width-w;
	  leftPos=(leftPos/2)-5;
	  topPos=screen.height-h;
	  topPos=(topPos/2)-30;
	}
	url="/js/enlarge_photo.php?"+url;
	shrevesBigStampWin=window.open(url, "shrevesBigStampWin", "width="+w+",height="+h+",left="+leftPos+",top="+topPos);
}

function enlargeStamp(url,w,h){
	if(screen){
	  leftPos=screen.width-w;
	  leftPos=(leftPos/2)-5;
	  topPos=screen.height-h;
	  topPos=(topPos/2)-30;
	}
	url="/show_stamp.php?url="+url;
	shrevesBigStampWin2=window.open(url, "shrevesBigStampWin2", "width="+w+",height="+h+",left="+leftPos+",top="+topPos);
}


function launchPlayer(clip){
	if(screen){
	  leftPos=screen.width-786;
	  leftPos=(leftPos/2)-5;
	  topPos=screen.height-539;
	  topPos=(topPos/2)-30;
	}
	url="http://cst.clickstreamtv.net/gateway/open.html?account=shreves&clip="+clip;
	shrevesPlayerWin=window.open(url, "shrevesPlayerWin", "width=786,height=539,left="+leftPos+",top="+topPos);
}

function launchPDF(id){
	url="/prices_realized/pdf/pr_"+id+".pdf";
	window.open(url, "shrevesPDF", "toolbar=0,location=0,resizable=yes");
}

function launchCatalogPDF(sale_id,file_name){
	url="/catalog/pdf/sale_"+sale_id+"/"+file_name;
	window.open(url, "shrevesPDF", "toolbar=0,location=0,resizable=yes");
}

function checkContactForm(){
	if(!document.myForm.name.value){
	  alert("Please include your NAME.");
	  document.myForm.name.focus();
	  return false;
	}
	if(!document.myForm.email.value){
	  alert("Please include your EMAIL ADDRESS.");
	  document.myForm.email.focus();
	  return false;
	}
}

function checkCatalogOrderForm(){
	if(!document.myForm.name.value){
	  alert("Please include your NAME.");
	  document.myForm.name.focus();
	  return false;
	}
	if(!document.myForm.email.value){
	  alert("Please include your EMAIL.");
	  document.myForm.email.focus();
	  return false;
	}
	if(!document.myForm.street.value){
	  alert("Please include your STREET.");
	  document.myForm.street.focus();
	  return false;
	}
	if(!document.myForm.city.value){
	  alert("Please include your CITY.");
	  document.myForm.city.focus();
	  return false;
	}
	if(!document.myForm.country.value){
	  alert("Please include your COUNTRY or REGION.");
	  document.myForm.country.focus();
	  return false;
	}
	if(document.myForm.country.value=="UNITED STATES"){
		if(!document.myForm.state.value){
		  alert("Please include your STATE.");
		  document.myForm.state.focus();
		  return false;
		}
		if(!document.myForm.zip.value){
		  alert("Please include your ZIP.");
		  document.myForm.zip.focus();
		  return false;
		}
	}
}

function checkBidForm(){
	if((!document.myForm.phone1a.value)||(!document.myForm.phone1b.value)||(!document.myForm.phone1c.value)){
	  alert("Please include your complete PHONE NUMBER.");
	  document.myForm.phone1a.focus();
	  return false;
	}
	if(!document.myForm.terms.checked){
	  alert("You must agree to the TERMS before submitting.");
	  document.myForm.terms.focus();
	  return false;
	}
	if(!document.myForm.saleName.value){
	  alert("Please include the SALE NAME.");
	  document.myForm.saleName.focus();
	  return false;
	}
	if(!document.myForm.name.value){
	  alert("Please include your NAME.");
	  document.myForm.name.focus();
	  return false;
	}
	if(!document.myForm.email.value){
	  alert("Please include your EMAIL.");
	  document.myForm.email.focus();
	  return false;
	}
	if(!document.myForm.street.value){
	  alert("Please include your STREET ADDRESS.");
	  document.myForm.street.focus();
	  return false;
	}
	if(!document.myForm.city.value){
	  alert("Please include your CITY.");
	  document.myForm.city.focus();
	  return false;
	}
	if(!document.myForm.country.value){
	  alert("Please include your COUNTRY or REGION.");
	  document.myForm.country.focus();
	  return false;
	}
	if(document.myForm.country.value=="UNITED STATES"){
		if(!document.myForm.zip.value){
		  alert("Please include your ZIP CODE.");
		  document.myForm.zip.focus();
		  return false;
		}
	}
}

function tabOnEnter(field,evt){
	if(document.all){
	  // prevent IE users from inadvertantly pressing enter on form
	  var keyCode = document.layers ? evt.which : document.all ? evt.keyCode : evt.keyCode;
	  if(keyCode==13){
	    return false;
	  }
	  else{
	    return true;
	  }
	}
}

function launchTestimonial(name){
	if(screen){
	  leftPos=screen.width-670;
	  leftPos=(leftPos/2)-5;
	  topPos=screen.height-450;
	  topPos=(topPos/2)-30;
	}
	shrevesTestimonialWin=window.open("testimonial.php?name="+name, "shrevesTestimonialWin", "scolling=yes,scrollbars=yes,width=670,height=450,left="+leftPos+",top="+topPos);
}

function launchSaleChoice(){
//Uncommented lines are for multiple sale choice 
grossSale = false;
  if(grossSale){
    if(screen){
      leftPos=screen.width-786;
      leftPos=(leftPos/2)-5;
      topPos=screen.height-160;
      topPos=(topPos/2)-30;
    }
    saleChoice=window.open("/catalog/sept-2010-sale-choice.php", "saleChoice", "scolling=no,scrollbars=no,width=850,height=500,left="+leftPos+",top="+topPos);
  } 
  else{
    window.location="http://stampauctionnetwork.com/F/F137.cfm";
  }
	//window.location="http://stampauctionnetwork.com/F/F125.cfm";
}

function launchStampEnlarged(url,width,height){
	url="http://www.shreves.com/show_stamp.php?url=http://www.shreves.com/"+url;
	if(screen){
	  leftPos=screen.width-width;
	  leftPos=(leftPos/2)-5;
	  topPos=screen.height-height;
	  topPos=(topPos/2)-30;
	}
	winStampEnlarged=window.open(url, "winStampEnlarged", "scolling=no,scrollbars=no,width="+width+",height="+height+",left="+leftPos+",top="+topPos);
}
