function openMembershipPopup(filename,windowname,properties){var x=document.membership.email1.value;var filter=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;if(filter.test(x)){filename=filename+"&email1="+document.membership.email1.value;mywindow=window.open(filename,windowname,properties);}else{alert('We\'re sorry, but we cannot recognize the format of your email address');}}
function checkPorV(thePathURL,destType)
{var pid_rb;var vid_rb;var user_data;var thingSelected=1;if(destType=="1"){thePathURL="/servlet/Guild/GiftRegistryOwnerViewPage?reqType=add&item_id="+thePathURL+"&item_type=1";}else{thePathURL="/servlet/Guild/ChooseWishGroupPage?add_item=true&item_id="+thePathURL+"&table=1";}
if(document.add_to_list.pid_rb!=null){thingSelected=0;if(document.add_to_list.pid_rb.checked){thingSelected=1;pid_rb=document.add_to_list.pid_rb.value;thePathURL+="&pid_rb="+pid_rb;}else{for(var i=0;i<document.add_to_list.pid_rb.length;i++){if(document.add_to_list.pid_rb[i].checked){thingSelected=1;pid_rb=document.add_to_list.pid_rb[i].value;thePathURL+="&pid_rb="+pid_rb;}}}}
if(document.add_to_list.user_data!=null){thePathURL+="&user_data="+document.add_to_list.user_data.value;}
if(thingSelected==1){location.href=thePathURL;}
else{if(destType=="1"){alert("To add an item to your Gift Registry, please select from the product options presented on the page.");}else{alert("To add an item to your Wish List, please select from the product options presented on the page.");}}}
function buyItem(lineId,itemId,typeId,pageId,userData){var wants=document.add_form['qty_'+lineId].value
location.href="/servlet/Guild/ShowBasketPage?item_id="+itemId+"&table="+typeId+"&pageId="+pageId+"&user_data="+userData+"&qty="+wants;}
function buyItem2(lineId,itemId,typeId,pageId,userData){var wants=document.update_form['qty_'+lineId].value
location.href="/servlet/Guild/ShowBasketPage?item_id="+itemId+"&table="+typeId+"&pageId="+pageId+"&user_data="+userData+"&qty="+wants;}
function updateItem(lineId){var wants=document.update_form['qty_'+lineId].value
location.href="/servlet/Guild/GiftRegistryOwnerViewPage?reqType=update&qty="+wants+"&u_id="+lineId;}
function goThere(form){var linkList=form.selectThis.selectedIndex
if(!linkList==""){window.location.href=form.selectThis.options[linkList].value;}}
function updateItem(lineId){var wants=eval('document.update_form.qty_'+lineId+'.value');alert(wants);location.href="/servlet/Guild/GiftRegistryOwnerViewPage?reqType=update&qty="+wants+"&u_id="+lineId;}
function checkDate(){var mStr=/\d{2}\/\d{2}\/\d{4}/;var pStr=/(\d{2})(\/)(\d{2})(\/)(\d{4})/;var date=document.reg_info.eventDate.value;if(mStr.test(date)){var parseDate=pStr.exec(date);var inDate=new Date(parseDate[5],parseDate[1]-1,parseDate[3]);var curDate=new Date();if(inDate<curDate){alert('Please enter a future date');}else{document.reg_info.submit();}}else{alert('Please enter the event date in mm/dd/yyyy format')}}
function checkCCC(){if(document.bill.cost_center_code.options[document.bill.cost_center_code.selectedIndex].value=="default")
{alert('You must select a cost center code to continue');}
else
{document.bill.submit();}}
function autoSelectNewCC(adminUser){if(adminUser){if(document.bill.paymentType[0].value=="storedCredit"){document.bill.paymentType[1].checked=true;}}else{document.bill.paymentType.checked=true;}}
function openOne(filename,windowname,properties){mywindow=window.open(filename,windowname,properties);}
function openEdition(filename,windowname,properties){mywindow=window.open(filename,windowname,properties);}
function openProduction(filename,windowname,properties){mywindow=window.open(filename,windowname,properties);}
var msgWindow=null;function WindowOpen(gid){var url="/servlet/Guild/GlossaryPage?gid="+gid;msgWindow=open(url,"glossary_mini",'location=no,status=no,scrollbars=no,toolbar=no,menubar=no,resizable=yes,width=275,height=225');if(msgWindow.opener==null)msgWindow.opener=self;msgWindow.focus();}
function close_mini()
{if(!(msgWindow==null)&&!(msgWindow.closed)){msgWindow.close()}}
function at_display(x)
{win=window.open();for(var i in x)win.document.write(i+' = '+x[i]+'<br>');}
function at_show_aux(parent,child)
{var p=document.getElementById(parent);var c=document.getElementById(child);var i=document.getElementById(child+"_if");var top=(c["at_position"]=="y")?p.offsetHeight+2:0;var left=(c["at_position"]=="x")?p.offsetWidth+0:-11;for(;p;p=p.offsetParent)
{top+=p.offsetTop;left+=p.offsetLeft;}
c.style.position="absolute";c.style.top=top+'px';c.style.left=left+'px';c.style.visibility="visible";if(i!=null)
{i.style.visibility="visible";}}
function at_show()
{p=document.getElementById(this["at_parent"]);c=document.getElementById(this["at_child"]);at_show_aux(p.id,c.id);clearTimeout(c["at_timeout"]);}
function at_hide()
{c=document.getElementById(this["at_child"]);i=document.getElementById(this["at_child"]+"_if");if(i!=null)
{c["at_timeout"]=setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'; document.getElementById('"+c.id+"_if').style.visibility = 'hidden'",200);}
else
{c["at_timeout"]=setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'",200);}}
function subNavShow(terID,main){var secID=terID.charAt(0)+terID.charAt(1);showlayer(secID);showlayer(terID);return(bgActive);}
function subOver(menuLink){killtimer();if(is.ns){}
return(bgActive);}
function subOut(snl){hideslowly(snl);if(is.ns){}
return(bgNormal);}
function at_click()
{p=document.getElementById(this["at_parent"]);c=document.getElementById(this["at_child"]);if(c.style.visibility!="visible")at_show_aux(p.id,c.id);else c.style.visibility="hidden";return false;}
function at_attach(parent,child,showtype,position,cursor)
{p=document.getElementById(parent);c=document.getElementById(child);i=document.getElementById(child+"_if");p["at_parent"]=p.id;c["at_parent"]=p.id;p["at_child"]=c.id;c["at_child"]=c.id;p["at_position"]=position;c["at_position"]=position;c.style.position="absolute";c.style.visibility="hidden";if(i!=null)
{i.style.position="absolute";i.style.visibility="hidden";i.style.top=c.style.top;i.style.zIndex=99;}
if(cursor!=undefined)p.style.cursor=cursor;switch(showtype)
{case"click":p.onclick=at_click;p.onmouseout=at_hide;c.onmouseover=at_show;c.onmouseout=at_hide;break;case"hover":p.onmouseover=at_show;p.onmouseout=at_hide;c.onmouseover=at_show;c.onmouseout=at_hide;break;}}
function attachIt(){at_attach("glass_parent","glass_child","hover","y","pointer");at_attach("objects_parent","objects_child","hover","y","pointer");at_attach("wall_parent","wall_child","hover","y","pointer");at_attach("furniture_parent","furniture_child","hover","y","pointer");at_attach("ceramics_parent","ceramics_child","hover","y","pointer");at_attach("jewelry_parent","jewelry_child","hover","y","pointer");at_attach("gifts_parent","gifts_child","hover","y","pointer");at_attach("new_parent","new_child","hover","y","pointer");at_attach("studio_parent", "studio_child", "hover", "y", "pointer");}
