// Created & developed for Hop-up Heli Hobbies
// Copyright @2008 Keith Barklem
// Version 1.0.0 - Last modify date: 2008-Mar-18

var canopy;
var win = null;

function newWindow(pagelink,pagetitle,w,h,features) {
	//setup window position for centre of screen
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? ((screen.height-h)/2) -20 : 0;
	// set window properties
	settings = 'width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition + ',' + features;
	// show window
	win = window.open(pagelink,pagetitle,settings);
	return;
}


function showCatalogItem(id) {
	var linkstr = 'catalog_item.php?itm=' + id;
	newWindow(linkstr, '', 560, 560, '');
	return;
}


function confirmOrder() {
	return confirm('The shipping date is currently extended as the Staff is away on vacation. You may still place your order now and regular shipping will resume on May 18, 2009. Do you wish to proceed?');
}

function confirmAction (msg) {
	var result = "";
	return result;
}


function toggleCanopy() {
	var imgCanopy = document.getElementById('hopupcanopy').style;

	if (canopy) {
		canopy = 0;
		imgCanopy.visibility = 'hidden';
		document.getElementById('canopy').innerHTML = 'Show Canopy';
	} else {
		canopy = 1;
		imgCanopy.visibility = 'visible';
		document.getElementById('canopy').innerHTML = 'Remove Canopy';
	}
}


function qtyOk(partno,instock) {
	alert('Part: '+ partno.valueOf());
	var ordered = document.getElementById(partno.valueOf()).value;
	var placeorder = document.getElementById('add');
	alert('There are: '+ instock);
	placeorder.value = ordered;
	return 0;
}


function bookmarkUs(){
	title = 'Hop-up Heli Hobbies';
	url = 'http://www.hopuphelihobbies.com';
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}