/*
************************************************************
This Script is Copyright ©2003 Xpression Technology, Inc. All rights reserved.
Christopher James 
Web Developer, Xpression Technology
http://www.x-technology.us
Created August 22, 2004
************************************************************
*/
function TheBiggerPicture(y){
	settings = 'scrollbars=yes,noresize,toolbar=0,location=no,directories=no,status=0,menubar=0';
	t = window.open("/item.pics/show.php?path="+y,"_blank",settings);
}
function myWindow(x) {
	LeftPosition = (screen.width) ? (screen.width-315)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-400)/2 : 0;
	settings = 'height=410,width=315,top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,noresize,toolbar=0,location=no,directories=no,status=0,menubar=0';
if (x == 'cservice'){
	t = window.open("/support/cust_service.php","_blank",settings);
} 
if (x == 'login'){
	self.location = "/?cmd=login";
}
if (x == 'showCart'){
	t = window.open("/support/future.php?t=5","_blank",settings);
}
if (x == 'ContactUs'){
	var brow_name = navigator.appName;
	var brow_version = navigator.appVersion;
	var codeName = navigator.appCodeName;
	var Lang = navigator.userLanguage;
	var Pro = navigator.product;
	var CAllow = navigator.cookieEnabled;
	var brow_type = brow_name + "/" + brow_version;
	var os = navigator.platform;
	while ( brow_type.indexOf(" ")!= -1){
		var i = brow_type.indexOf(" ");
		var temp = brow_type.substr(0,i) + brow_type.substr(i+1);;
		brow_type = temp;
	}
	t = window.open("/support/contactus.php?cmd=zcontact&app=" + brow_type + "&platform=" + os + "&code=" + codeName + "&language=" + Lang + "&product=" + Pro + "&cookies=" + CAllow,"_blank",settings);
}
}

function validate(x) { //1.3
	if (x == "list") {
		var c = 0;
		var emailString =  /^([_0-9a-z\.-])+@([_0-9a-z\.-])+[a-z]{2,3}$/i;
		var handleString =  /^[_0-9a-z-]*[_0-9a-z-]$/i;
		var passString = /^[_0-9a-z]*[_0-9a-z]$/i;
		var qahome = "@qualityautographs.com";
			if ((document.list.uEmail.value.length == 0)){
 		    	c=1;
	    		window.alert("Please fill in your email address.");
	   			document.list.uEmail.focus();
   				return;
			}
 			if ((document.list.uEmail.value.search(emailString) == -1)){
				c=1;
				window.alert("Please enter a valid email address.");
				document.list.uEmail.focus();
				return;
			}
			if ((document.list.uEmail.value.indexOf(qahome) != -1)){
				c=1;
				window.alert("Please enter a valid external email address.");
				document.list.uEmail.focus();
				return;
			 }
	}
	if (c==0){
		document.list.submit();
	}
	  // this if is a new test for 'x'
	if (x == "searchdb") {
		document.searchdb.submit();
	}
  return;
}
// the Catalog Function Copyright 2004 Christopher James
	var catalogMessage;
	function confirmCatalog()
	{
		catalogMessage = "This may take a while to load.\nDo you want to continue?";
		return confirm( catalogMessage );
		
	}
// the Confirm Function Copyright 2004 Christopher James
	var confirmMessage;
	function confirmDelete(x)
	{
		if (x == "dac") {
			confirmMessage = "Delete a Catagory\nThis May Affect the Database and the way users view and use the site.\n Do you still wish to continue?";
		} else if (x == "das") {
			confirmMessage = "Delete a Sport\nThis May Affect the Database and the way users view and use the site.\n Do you still wish to continue?";
		}
		return confirm( confirmMessage );
		
	}