// this is for the special order and price pick.
function updatePrice(dropdown)
{
//	var my_price = new Array("12.15", "20.00", "30.00");  //please change the price 
	var my_pr = document.form_1.myjia.value;
	var my_price = my_pr.split(":");
	var myindex = dropdown.selectedIndex;
	var itemName = document.form_1.item_name.value;
	if ((dropdown[myindex].value) == "Special Order") {
//	window.location = "http://localhost/webdev/new_brianmcmorrow/contact.php?num="+itemName;
	window.location = "http://www.brianmcmorrow.com/contact.php?num="+itemName;
	} else {
	var xxx = document.form_1.amount;
	xxx.value = my_price[myindex];
	} 
	return true;
}

var slideshow_onload = null; //should be implemented as a function later in this document if it must be called onload
var slideshow = null; //should be implemented as a function later in this document when this function is needle

function go_link(link_object) {
	location.href = link_object.href;
}
function ev(e) { //process window events
	if (!e) var e = window.event;
	var key = (e.keyCode)? e.keyCode : ((e.which)?e.which:0);
	link_id = false;
	link_obj = null;
	if ((35 == key) && (true == e.ctrlKey)) { //ctrl + end
		link_id = 'page_last';
	}
	else if ((36 == key) && (true == e.ctrlKey)) { //ctrl + home
		link_id = 'page_first';
	}
	else if ((37 == key) && (true == e.ctrlKey)) { //ctrl + arrow left
		link_id = 'page_previous';
	}
	else if ((38 == key) && (true == e.ctrlKey)) { //ctrl + arrow up
		link_id = 'page_up';
	}
	else if ((39 == key) && (true == e.ctrlKey)) { //ctrl + arrow right
		link_id = 'page_next';
	}
	else if ((40 == key) && (true == e.ctrlKey)) { //ctrl + arrow down
		if (slideshow) {
			slideshow();
		}
	}
	if (link_id) link_obj = document.getElementById(link_id);
	if (link_obj) go_link(link_obj);
}
document.onkeydown = ev;

function onload_init() {
	if (slideshow_onload) {
		slideshow_onload();
	}
}

/**************************************************************************************
FUNCTION:	getHelpWin 
INPUT:		url for the content
RETURN:  	helpWindow, alway bring on top
USAGE: 		<a href="#" onClick="goHelp('http://resweb1.amgen.com:8080/ma/form/probe_sop.html')";>hyper link</a>
***************************************************************************************/
function getHelpWin(url) {
	var newWindow = window.open(url,"helpWindow","toolbar=0,menubar=0,scrollbars=1,resizable=0,height=650,width=800");
	newWindow.focus();
	newWindow.document.close();  
}

/**************************************************************************************
Constants:
***************************************************************************************/
var WIN_SIZE = ",height=550,width=800,left=0,top=0";
var WIN_ALL_ON = "location=1,toolbar=1,menubar=1,scrollbars=1,status=1,resizable=1,left=0,top=0";
var DEFAULT_SPECS = WIN_ALL_ON + WIN_SIZE;
var HELP_WIN_SPECS = "toolbar=0,menubar=0,scrollbars=1,status=0,resizable=0,height=350,width=350,left=0,top=0";
var SEARCH_WIN_SPECS = "toolbar=0,menubar=0,scrollbars=1,status=0,resizable=1,height=550,width=800,left=0,top=0";
var LOCAL_WIN_SPECS = "toolbar=0,menubar=0,scrollbars=0,status=0,resizable=0,height=585,width=778,left=0,top=0";

function openWin(URL,name,specs) {
	if (specs == null) {
    	specs = DEFAULT_SPECS;
	}
	var aWindow = window.open(URL,name,specs);
	aWindow.focus();
	window[name].moveTo(0,0);
}

function doSearch(f) {
	var ggURL = "http://www.google.com/custom?cof=AWFID:68626dd4f3607196;L:http://www.prite.com/images/pritesearch.gif;BIMG:http://www.prite.com/images/pritesearchbg.gif;AH:left;S:http://www.prite.com;&q=";
	var sURL = ggURL + f.elements[0].value;
	openWin(sURL,'SearchWin',SEARCH_WIN_SPECS);
	return false;
}
