//script to handle auto jump through segments of phone numbers on catalog request page
function tabphone(field) {
	var d = eval("document.forms[0]");
	var v;
	switch (field) {
		case "home1":
			v = d.txtHomePhone1.value;
			if(v.length > 2) {
				d.txtHomePhone2.focus();
			}
			break;
		case "home2":
			v = d.txtHomePhone2.value;
			if(v.length > 2) {
				d.txtHomePhone3.focus();
			}
			break;
		case "home3":
			v = d.txtHomePhone3.value;
			if(v.length > 3) {
				d.txtWorkPhone1.focus();
			}
			break;
		case "work1":
			v = d.txtWorkPhone1.value;
			if(v.length > 2) {
				d.txtWorkPhone2.focus();
			}
			break;
		case "work2":
			v = d.txtWorkPhone2.value;
			if(v.length > 2) {
				d.txtWorkPhone3.focus();
			}
			break;
		case "work3":
			v = d.txtWorkPhone3.value;
			if(v.length > 3) {
				d.txtWorkPhoneExtension.focus();
			}
			break;
	}
}

//script to open video in yacht article
function openVideoWin(){
	popupWin = window.open("../includes/video.aspx", 'ImgView', 'width=500,height=375,left=50,top=75')
	popupWin.focus();
}

//script to handle hitting enter key stroke for forms
function getEnter(key, control, validate) {
	if(key == 13) {
		if(validate) {
			if (typeof(Page_ClientValidate) != 'function' ||  Page_ClientValidate()) __doPostBack(control,'')
		} else {
			__doPostBack(control,'');
		}
	}
}

//script ot open zoomview window
function getZoomView(id, image) {
	var loc = "../includes/zoomview.aspx?id=" + id + "&image=" + image;
	newWindow = window.open(loc,"images","directories=no,scrollbars=no,status=no,menubar=no,toolbar=no,height=350,width=550");
	newWindow.focus()
}

//monitor sizing script
function browserStats() {
	var height = screen.height;
	var width = screen.width;
	var res = screen.colorDepth;
	var bheight;
	var bwidth;
	var language;
	var plugs;
	if(navigator.appName == 'Netscape') {
		bheight = window.outerHeight;
		bwidth = window.outerWidth;
		language = navigator.language;
		/*for(var i = 0; i < navigator.plugins.length; i++) {
			plugs += navigator.plugins[i].name + "|";
		} */
	} else {
		bheight = document.body.clientHeight;
		bwidth = document.body.clientWidth;
		language = navigator.browserLanguage;
		/*for(var i = 0; i < document.plugins.length; i++) {
			plugs += document.plugins[i].name + "|";
		} */
	}
	var result = 'screenheight:' + height + ',screenwidth:' + width + ',resolution:' + res + ',browserheight:' + bheight + ',browserwidth:' + bwidth + ',language:' + language;// + ',plugins:' + plugs;
	var exp = new Date();
	var addWeek = exp.getTime() + (7 * 24 * 60 * 60 * 1000);
	exp.setTime(addWeek);
	document.cookie = 'browser=' + result + '; expires=' + exp.toDateString();
}

//image popup viewer script
function openImgView(url, h, w, doScroll)
{
	if(h == '') {h == 600;}
	if(w == '') {w == 400;}
	if(doScroll) {
		popupWin = window.open(url, 'ImgView', 'scrollbars,resizable,status=no,width=' + w + ',height=' + h + ',left=50,top=75')
	} else {
		popupWin = window.open(url, 'ImgView', 'resizable,status=no,width=' + w + ',height=' + h + ',left=50,top=75')
	}
	popupWin.focus();
}
//Dreamweaver script
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];}}
}