function ToSubmit(a) {

document.selectParentForm.ProductsID.value=a;
document.selectParentForm.submit();

}

function open_window(url) {

mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=650,height=300');

}
function open_window2() {

mywin = window.open('/house/findoutmore.asp',"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=500,height=450');

}
function open_favorites(url) {

mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0, scrollbars=1,resizable=0,width=605,height=500,top=1,left=70');

}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_button_01_over = newImage("/images/home_button_01-over.gif");
		preloadFlag = true;
	}
}
function OpenCat(){
		    
		if (window.screen){
		var wx=(screen.width-750)/2
		var wy=(screen.height-429)/2
		}
		window.open("/Catalog/default.htm","catalog","resizable=yes,width=750,height=429,innerwidth=750,innerheight=429,scrollbars=0,top="+wy+",left="+wx)
}
function moreinfo(){
		    
		if (window.screen){
		var wx=(screen.width-750)/2
		var wy=(screen.height-429)/2
		}
		window.open("/house/moredetails.html","popup","resizable=no,width=415, height=326,innerwidth=750,innerheight=429,scrollbars=0,top="+wy+",left="+wx)
}
function shippingdetails(){
		    
		if (window.screen){
		var wx=(screen.width-750)/2
		var wy=(screen.height-429)/2
		}
		window.open("/house/shippingdetails.html","popup","resizable=no,width=535,height=275,innerwidth=750,innerheight=429,scrollbars=0,top="+wy+",left="+wx)
}

function mOvr(src,clrOver){if(!src.contains(event.fromElement)){src.bgColor = clrOver;}}function mOut(src,clrIn){if(!src.contains(event.toElement)){src.bgColor = clrIn;}}

//opens newpopup.htm, or maintains focus and updates the content
function fireWindow(whichWindow,whichStage)	{
stageTwo = 0;
region = whichWindow;
windowStage = whichStage;
props ='height=243,width=464,status=no,resizable=no,toolbar=no,scrollbars=no,location=no'
		if(!window.openIt)	{
		openIt = window.open('/house/sale.htm','',props);
							}
		else if((window.openIt.closed != null) && window.openIt.closed) 
							{
		openIt = window.open('/house/sale.htm','',props);
							}
		else {
		window.openIt.location = '/house/sale.htm';
		window.openIt.focus();
			}

	//place popup at center of screen
	CenterX = (screen.availWidth / 2) - 225;
	CenterY = (screen.availHeight / 2) - 150;
	openIt.moveTo(CenterX,CenterY)
}

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_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_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];}
}

function chooseCity(bs)
{
	if (bs=="1")
		for (var i=0; i < document.anonymous.CorrectBillToCity.length; i++)
		{
			if (document.anonymous.CorrectBillToCity[i].checked)
			{
				document.anonymous.BillTocity.value = document.anonymous.CorrectBillToCity[i].value;
				document.anonymous.dnvbc.value = 0;
			}
	   }
	else
		{
			for (var i=0; i < document.anonymous.CorrectShipToCity.length; i++)
			{
				if (document.anonymous.CorrectShipToCity[i].checked)
				{
					document.anonymous.ShipTocity.value = document.anonymous.CorrectShipToCity[i].value;
					document.anonymous.dnvsc.value = 0;
				}
			}
	   }
}
function validate(field) {
var valid = "0123456789"
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
alert("Invalid entry!  Only numbers are accepted!");
field.focus();
field.select();
   }
}
function DeleteProduct(PName){
var agree = false;
agree = confirm("Are you sure you want to remove " + PName + " from your Favorites List?");
	if (agree){
	return true;
	}
	else{
	return false;
	}
}	