
function common_fileName(val){var startPos=val.lastIndexOf("\\");return val.substring(startPos+1);}
function flashPutHref(url){}
function zoom(w,h,imgsrc){var theLink="http://www.bigdiscountfragrances.com/zoom.php?src="+imgsrc+"&w="+w+"&h="+h;var params="height="+h+",width="+w+",scrollbars=no,toolbars=no,status=no";var win=window.open(theLink,"zoomWin",params);win.focus();}
function info(w,h,url){var theLink="http://www.bigdiscountfragrances.com/"+url;var params="height="+h+",width="+w+",toolbars=no,status=no,scrollbars=yes";var win=window.open(theLink,"zoomWin",params);win.focus();}
function toggleModule(modname){var modLayer=MM_findObj('l'+modname);modLayer.style.display=modLayer.style.display=="none"?"block":"none";for(x=0;x<modules.length;x++){if(modname==modules[x].name){var modImage=MM_findObj('img'+modname);modImage.src=(modImage.src==modules[x].imgOpen.src)?modules[x].imgClosed.src:modules[x].imgOpen.src;}}}
function openModule(modname){var modLayer=MM_findObj('l'+modname);modLayer.style.display="block";for(x=0;x<modules.length;x++){if(modname==modules[x].name){var modImage=MM_findObj('img'+modname);modImage.src=modules[x].imgOpen.src;}}}
function closeModule(modname){var modLayer=MM_findObj('l'+modname);modLayer.style.display="none";for(x=0;x<modules.length;x++){if(modname==modules[x].name){var modImage=MM_findObj('img'+modname);modImage.src=modules[x].imgClosed.src;}}}
function toggleTab(modname,showtab,hidetabs){var showTabLayer=MM_findObj('ltab_'+modname+'_'+showtab);showTabLayer.style.display="block";var target=MM_findObj('imgtab_'+modname);for(x=0;x<tabs.length;x++){if(modname+"_"+showtab==tabs[x].name){target.src=tabs[x].imgsrc;}}
var hideTabsArr=hidetabs.split(',');for(y=0;y<hideTabsArr.length;y++){var hideTabLayer=MM_findObj('ltab_'+modname+'_'+hideTabsArr[y]);hideTabLayer.style.display="none";}
self.focus();}
function checkSearch(val){if(val==""){alert("Please type a Brand, Designer, or Keyword to search for.");return false;}
if(val.length<3){alert("Please type 3 or more letters to search by");return false;}
if(val.indexOf("_")!=-1||val.indexOf("%")!=-1){alert("We're sorry, the underscore and % characters are not allowed\nPlease type your search again");return false;}
return true;}
function MM_preloadImages(){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];}}}
function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}
function MM_showHideLayers(){var i,p,v,obj,args=MM_showHideLayers.arguments;for(i=0;i<(args.length-2);i+=3)if((obj=MM_findObj(args[i]))!=null){v=args[i+2];if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v=='hide')?'hidden':v;}
obj.visibility=v;}}
function P7_autoLayers(){var g,b,k,f,args=P7_autoLayers.arguments;var a=parseInt(args[0]);if(isNaN(a))a=0;if(!document.p7setc){p7c=new Array();document.p7setc=true;for(var u=0;u<10;u++){p7c[u]=new Array();}}
for(k=0;k<p7c[a].length;k++){if((g=MM_findObj(p7c[a][k]))!=null){b=(document.layers)?g:g.style;b.visibility="hidden";}}
for(k=1;k<args.length;k++){if((g=MM_findObj(args[k]))!=null){b=(document.layers)?g:g.style;b.visibility="visible";f=false;for(j=0;j<p7c[a].length;j++){if(args[k]==p7c[a][j]){f=true;}}
if(!f){p7c[a][p7c[a].length++]=args[k];}}}}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}}
function addClass(element,value){if(!element.className){element.className=value;}else{newClassName=element.className;newClassName+=" ";newClassName+=value;element.className=newClassName;}}
function selectRowCheckbox(row){var checkbox=row.getElementsByTagName("input")[0];if(checkbox.checked==true){checkbox.checked=false;}else
if(checkbox.checked==false){checkbox.checked=true;}}
function lockRowUsingCheckbox(){var tables=document.getElementsByTagName("table");for(var m=0;m<tables.length;m++){if(tables[m].className=="highRow"){var tbodies=tables[m].getElementsByTagName("tbody");for(var j=0;j<tbodies.length;j++){var checkboxes=tbodies[j].getElementsByTagName("input");for(var i=0;i<checkboxes.length;i++){checkboxes[i].onclick=function(evt){if(this.parentNode.parentNode.className.indexOf("selected")!=-1){this.parentNode.parentNode.className=this.parentNode.parentNode.oldClassName;}else{addClass(this.parentNode.parentNode,"selected");}
if(window.event&&!window.event.cancelBubble){window.event.cancelBubble="true";}else{evt.stopPropagation();}}}}}}}
addLoadEvent(lockRowUsingCheckbox);function textCounter(field,countfield,maxlimit){if(field.value.length>maxlimit)
{field.value=field.value.substring(0,maxlimit);alert("Please make your text "+maxlimit+" characters or less.");return false;}
else
{countfield.value=maxlimit-field.value.length;}}
function checkForm_wishListShare(){var emails=document.form1.Emails.value;var message=document.form1.Message.value;if(emails==""){alert("Please type at least one email address to send your wish list to");return false;}
if(message==""){alert("Please type a message to send.");return false;}
return true;}
function checkForm_emailThisPage(){var emails=document.form1.Emails.value;var message=document.form1.Message.value;if(emails==""){alert("Please type at least one email address to send the page to");return false;}
if(message==""){alert("Please type a message to send.");return false;}
return true;}
function checkForm_wishList(){for(x=0;x<document.frmWishList.length;x++){var el=document.frmWishList.elements[x];if(el.name.indexOf("cb")!=-1){if(el.checked)return true;}}
alert("Please check the box next to at least one item in your wish list first.");return false;}
function checkForm_review(){if(document.form1.Rating.selectedIndex==0){alert("Please select a rating between 1 and 5 stars.");return false;}
if(document.form1.ReviewTitle.value==""){alert("Please enter a title for your review.");return false;}
if(document.form1.ReviewText.value==""){alert("Please type your review.");return false;}
return true;}
function checkForm_stockAlert(){if(!emailCheck(document.form1.Email.value))return false;return true;}
function checkForm_subscribe(){if(!emailCheck(document.frmSubscribe.Email.value))return false;return true;}
function checkForm_support(){if(!emailCheck(document.form1.Email.value))return false;if(document.form1.Text.value==""){alert("Please enter a description.");return false;}
return true;}
function checkCreateAccount(){var req=new Array(7);req[0]="Login";req[1]="Password";req[2]="PasswordConfirm";req[3]="BillFirstName";req[4]="BillLastName";req[5]="BillEmail";req[6]="BillEmailConfirm";var names=new Array(7);names[0]="Login";names[1]="Password";names[2]="Password again to confirm";names[3]="First Name";names[4]="Last Name";names[5]="Email Address";names[6]="Email address again to confirm";var bValid=true;var message="You need to complete or change the following fields before submitting this form:\n\n";for(x=0;x<req.length;x++){var target=eval("document.form1."+req[x]);if(target.value==""){bValid=false;message+="-- "+names[x]+"\n";}}
var login=eval("document.form1.Login.value");var password=eval("document.form1.Password.value");var passwordConfirm=eval("document.form1.PasswordConfirm.value");var email=eval("document.form1.BillEmail.value");var emailConfirm=eval("document.form1.BillEmailConfirm.value");if(login.length<4||password.length<4){bValid=false;message+="\nYour Login Name and Password must both be 4 or more characters";}
for(x=0;x<login.length;x++){if(login.charAt(x)==' '){bValid=false;message+="\nYour Login name may not contain spaces.";}}
for(x=0;x<password.length;x++){if(password.charAt(x)==' '){bValid=false;message+="\nYour Password may not contain spaces.";}}
if(password!=passwordConfirm){bValid=false;message+="\nThe passwords you entered do not match.";}
if(email!=emailConfirm){bValid=false;message+="\nThe emails you entered do not match.";}
if(!emailCheck(document.form1.BillEmail.value)){return false;}
if(!bValid){alert(message);return false;}
return true;}
function checkCreateAccount2(){var req=new Array(7);req[0]="Login";req[1]="Password";req[2]="PasswordConfirm";req[3]="BillFirstName";req[4]="BillLastName";req[5]="BillEmail";req[6]="BillEmailConfirm";var names=new Array(7);names[0]="Login";names[1]="Password";names[2]="Password again to confirm";names[3]="First Name";names[4]="Last Name";names[5]="Email Address";names[6]="Email address again to confirm";var bValid=true;var message="You need to complete or change the following fields before submitting this form:\n\n";for(x=0;x<req.length;x++){var target=eval("document.form2."+req[x]);if(target.value==""){bValid=false;message+="-- "+names[x]+"\n";}}
var login=eval("document.form2.Login.value");var password=eval("document.form2.Password.value");var passwordConfirm=eval("document.form2.PasswordConfirm.value");var email=eval("document.form2.BillEmail.value");var emailConfirm=eval("document.form2.BillEmailConfirm.value");if(login.length<4||password.length<4){bValid=false;message+="\nYour Login Name and Password must both be 4 or more characters";}
for(x=0;x<login.length;x++){if(login.charAt(x)==' '){bValid=false;message+="\nYour Login name may not contain spaces.";}}
for(x=0;x<password.length;x++){if(password.charAt(x)==' '){bValid=false;message+="\nYour Password may not contain spaces.";}}
if(password!=passwordConfirm){bValid=false;message+="\nThe passwords you entered do not match.";}
if(email!=emailConfirm){bValid=false;message+="\nThe emails you entered do not match.";}
if(!emailCheck(document.form2.BillEmail.value)){return false;}
if(!bValid){alert(message);return false;}
return true;}
function checkForm_shippingAndCredit(){if(!bValidCreditCardNumber(document.form1.CCName.value,document.form1.CCNumber.value)){return false;}
var now=new Date();var fullYear=now.getYear().toString();var thisYear=parseInt(fullYear.substring(2,4));var selYear=document.form1.CCExpYear.options[document.form1.CCExpYear.selectedIndex].value;var selMonth=document.form1.CCExpMonth.options[document.form1.CCExpMonth.selectedIndex].value;if(thisYear>=selYear){if(parseInt(now.getMonth()+1)>selMonth){alert("Please select a valid expiration date for your credit card \nor choose a credit card that has not expired.");return false;}}
if(document.form1.CCCVV2.value==""){alert("Please enter a valid CVV2 Number.");return false;}
return true;}
function checkForm_editAccount(){var req=new Array(4);req[0]="Password";req[1]="PasswordConfirm";req[2]="BillEmail";req[3]="BillEmailConfirm";var names=new Array(7);names[0]="Password";names[1]="Password again to confirm";names[2]="Email Address";names[3]="Email address again to confirm";var bValid=true;var message="You need to complete or change the following fields before submitting this form:\n\n";for(x=0;x<req.length;x++){var target=eval("document.form1."+req[x]);if(target.value==""){bValid=false;message+="-- "+names[x]+"\n";}}
var password=eval("document.form1.Password.value");var passwordConfirm=eval("document.form1.PasswordConfirm.value");var email=eval("document.form1.BillEmail.value");var emailConfirm=eval("document.form1.BillEmailConfirm.value");if(password.length<4){bValid=false;message+="\nYour Password must 4 or more characters";}
for(x=0;x<password.length;x++){if(password.charAt(x)==' '){bValid=false;message+="\nYour Password may not contain spaces.";}}
if(password!=passwordConfirm){bValid=false;message+="\nThe passwords you entered do not match.";}
if(email!=emailConfirm){bValid=false;message+="\nThe emails you entered do not match.";}
if(!emailCheck(document.form1.BillEmail.value)){return false;}
if(!bValid){alert(message);return false;}else{return true;}}
function checkForm_details(){var command=document.frmDetails.command.value;for(x=0;x<document.frmDetails.length;x++){var el=document.frmDetails.elements[x];if(el.name.indexOf("add")!=-1){if(el.checked)return true;}}
alert("Please check the box next to at least one item\nbefore adding to your "+command);return false;}
function checkForm_upsell(){var cbPrefix="PID";for(x=0;x<document.form1.length;x++){var cur=document.form1.elements[x];if(cur.name.substr(0,cbPrefix.length)==cbPrefix&&cur.checked){var productID=cur.name.substr(cbPrefix.length);var target=eval("document.form1.Attr"+productID);if(target&&target.selectedIndex==0){alert("Please make a selection from the drop down box before adding your selection.");return false;}}}
return true;}
function checkForm_billing(){var bValid=true;var error="You need to complete or correct the following required fields before proceeding:\n";var req=new Array();req[0]="BillFirstName";req[1]="BillLastName";req[2]="BillEmail";req[3]="BillAddress1";req[4]="BillCity";req[5]="BillZip";var names=new Array();names[0]="First Name";names[1]="Last Name";names[2]="Email Address";names[3]="Address 1";names[4]="City";names[5]="Zip";for(x=0;x<req.length;x++){var target=eval("document.form1."+req[x]);if(target.value==""){bValid=false;error+="-- "+names[x]+"\n";}}
var billState=document.form1.BillState.options[document.form1.BillState.selectedIndex].value;var billCountry=document.form1.BillCountry.options[document.form1.BillCountry.selectedIndex].value;if(billState=="none"){bValid=false;error+="-- State"+"\n";}
if(billCountry=="none"){bValid=false;error+="-- Country (if non-U.S., please select Other (outside the U.S.))"+"\n";}
if(document.form1.bBillShip.checked){if(billCountry!="US"&&billCountry!="PR"){alert("We cannot ship to the country you selected.\nOn the next step, please create a shipping adress in the United States or Puerto Rico.\nIf you need additional help, please contact support@bigdiscount.com.");document.form1.bBillShip.checked=false;}
var a1=document.form1.BillAddress1.value;var regex=/p\.?o\.?\s*box/gi;if(a1.search(regex)!=-1){alert("We cannot ship to P.O. Boxes.\nPlease enter a physical address on the next step.\nIf you need additional help, please contact support@bigdiscount.com");document.form1.bBillShip.checked=false;}}
if(!bValid){alert(error);return false;}else{if(emailCheck(document.form1.BillEmail.value)){document.form1.submit();}}}
function checkForm_shipping(){var bValid=true;var error="You need to complete or correct the following required fields before proceeding:\n";var req=new Array();req[0]="ShipFirstName";req[1]="ShipLastName";req[2]="ShipEmail";req[3]="ShipAddress1";req[4]="ShipCity";req[5]="ShipZip";var names=new Array();names[0]="First Name";names[1]="Last Name";names[2]="Email Address";names[3]="Address 1";names[4]="City";names[5]="Zip";for(x=0;x<req.length;x++){var target=eval("document.form1."+req[x]);if(target.value==""){bValid=false;error+="-- "+names[x]+"\n";}}
var shipState=document.form1.ShipState.options[document.form1.ShipState.selectedIndex].value;if(shipState=="none"){bValid=false;error+="-- State\n";}
if(shipState=="01"){bValid=false;error+="-- Ship state must be a U.S. State\n";}
var a1=document.form1.ShipAddress1.value;var regex=/p\.?o\.?\s*box/gi;if(a1.search(regex)!=-1){alert("We cannot ship to P.O. Boxes.\nPlease enter a street address or contact support@bigdiscount.com for assistance.");return false;}
if(!bValid){alert(error);return false;}else{if(emailCheck(document.form1.ShipEmail.value)){return true;}}}
function checkForm_wholesale(){var req=new Array();req[0]="BillFirstName";req[1]="BillLastName";req[2]="BillEmail";req[3]="BillEmailConfirm";req[4]="Login";req[5]="Password";req[6]="PasswordConfirm";req[7]="BillCompany";req[8]="BillAddress1";req[9]="BillCity";req[10]="BillZip";req[11]="BillPhone";req[12]="ResellerID";var names=new Array();names[0]="First Name";names[1]="Last Name";names[2]="Email Address";names[3]="Email address again to confirm";names[4]="Login";names[5]="Password";names[6]="Password again to confirm";names[7]="Company Name";names[8]="Address 1";names[9]="City";names[10]="Zip";names[11]="Phone";names[12]="ResellerID";var bValid=true;var message="You need to complete or correct the following required fields before proceeding:\n";for(x=0;x<req.length;x++){var target=eval("document.form1."+req[x]);if(target.value==""){bValid=false;message+="-- "+names[x]+"\n";}}
var login=eval("document.form1.Login.value");var password=eval("document.form1.Password.value");var passwordConfirm=eval("document.form1.PasswordConfirm.value");var email=eval("document.form1.BillEmail.value");var emailConfirm=eval("document.form1.BillEmailConfirm.value");var billState=document.form1.BillState.options[document.form1.BillState.selectedIndex].value;var billCountry=document.form1.BillCountry.options[document.form1.BillCountry.selectedIndex].value;if(login.length<4||password.length<4){bValid=false;message+="\nYour Login Name and Password must both be 4 or more characters";}
for(x=0;x<login.length;x++){if(login.charAt(x)==' '){bValid=false;message+="\nYour Login name may not contain spaces.";}}
for(x=0;x<password.length;x++){if(password.charAt(x)==' '){bValid=false;message+="\nYour Password may not contain spaces.";}}
if(password!=passwordConfirm){bValid=false;message+="\nThe passwords you entered do not match.";}
if(email!=emailConfirm){bValid=false;message+="\nThe emails you entered do not match.";}
if(billState=="none"){bValid=false;message+="-- State (if non-U.S., please select Other (outside the U.S.))"+"\n";}
if(billCountry=="none"){bValid=false;message+="-- Country"+"\n";}
if(!bValid){alert(message);return false;}
return true;}
function checkForm_passwordRecovery(){if(emailCheck(document.form1.BillEmail.value)){return true;}
return false;}
function checkEmailSalesReport(){if(emailCheck(document.form1.Email.value)){document.form1.submit();}}
function checkLoginAndPassword(){var bValid=true;if(document.form1.Login.value.length<4){bValid=false;}
if(document.form1.Password.value.length<4){bValid=false;}
if(!bValid){alert("The Login and Password must each be between 4 and 20 characters long.\nPlease re-enter your Login and Password.");return false;}
return true;}
function checkForm_creditCard(){if(!bValidCreditCardNumber(document.form1.CCName.value,document.form1.CCNumber.value)){return false;}
var now=new Date();var fullYear=now.getYear().toString();var thisYear=parseInt(fullYear.substring(2,4));var selYear=document.form1.CCExpYear.options[document.form1.CCExpYear.selectedIndex].value;var selMonth=document.form1.CCExpMonth.options[document.form1.CCExpMonth.selectedIndex].value;if(thisYear>=selYear){if(parseInt(now.getMonth()+1)>selMonth){alert("Please select a valid expiration date for your credit card \nor choose a credit card that has not expired.");return false;}}
return true;}
function bValidCreditCardNumber(type,num){if(!isOnlyDigits(num)){alert('Please enter only digits (no dashes or spaces) for the credit card number');return false;}
if(!LuhnCheck(num)||!validateNum(type,num)){alert("The credit card number you entered appears to be invalid.  Please try again");return false;}
return true;}
function isOnlyDigits(str)
{var numbers="0123456789";for(var i=0;i<str.length;i++)
if(numbers.indexOf(str.substr(i,1))<0){return false;}
return true;}
function LuhnCheck(str)
{var result=true;var sum=0;var mul=1;var strLen=str.length;for(i=0;i<strLen;i++)
{var digit=str.substring(strLen-i-1,strLen-i);var tproduct=parseInt(digit,10)*mul;if(tproduct>=10)
sum+=(tproduct%10)+1;else
sum+=tproduct;if(mul==1)
mul++;else
mul--;}
if((sum%10)!=0)
result=false;return result;}
function validateNum(type,num)
{var result=false;var cardLen=num.length;var firstdig=num.substring(0,1);var seconddig=num.substring(1,2);var first4digs=num.substring(0,4);var validNums=0;switch(type)
{case"VISA":result=((cardLen==16)||(cardLen==13))&&(firstdig=="4");break;case"AMEX":validNums="47";result=(cardLen==15)&&(firstdig=="3")&&(validNums.indexOf(seconddig)>=0);break;case"MASTERCARD":validNums="12345";result=(cardLen==16)&&(firstdig=="5")&&(validNums.indexOf(seconddig)>=0);break;case"DISCOVER":result=(cardLen==16)&&(first4digs=="6011");break;case"DINERS":validNums="068";result=(cardLen==14)&&(firstdig=="3")&&(validNums.indexOf(seconddig)>=0);break;}
return result;}
function emailCheck(emailStr){var checkTLD=0;var knownDomsPat=/ ^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;var emailPat=/^(.+)@(.+)$/;var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";var validChars="\[^\\s"+specialChars+"\]";var quotedUser="(\"[^\"]*\")";var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;var atom=validChars+'+';var word="("+atom+"|"+quotedUser+")";var userPat=new RegExp("^"+word+"(\\."+word+")*$");var domainPat=new RegExp("^"+atom+"(\\."+atom+")*$");var matchArray=emailStr.match(emailPat);if(matchArray==null){alert("The Email Address appears to be invalid.\nPlease check your typing and try again.");return false;}
var user=matchArray[1];var domain=matchArray[2];for(i=0;i<user.length;i++){if(user.charCodeAt(i)>127){alert("The username portion of the email address you entered \nappears to contain invalid characters.");return false;}}
for(i=0;i<domain.length;i++){if(domain.charCodeAt(i)>127){alert("The domain name portion of the email address you entered \nappears to contain invalid characters.");return false;}}
if(user.match(userPat)==null){alert("The Username Is Invalid.");return false;}
var IPArray=domain.match(ipDomainPat);if(IPArray!=null){for(var i=1;i<=4;i++){if(IPArray>255){alert("The destination IP Address of the email address you entered\n appears invalid.");return false;}}
return true;}
var atomPat=new RegExp("^"+atom+"$");var domArr=domain.split(".");var len=domArr.length;for(i=0;i<len;i++){if(domArr[i].search(atomPat)==-1){alert("The Domain Name Is Invalid.");return false;}}
if(checkTLD&&domArr[domArr.length-1].length!=2&&domArr[domArr.length-1].search(knownDomsPat)==-1){alert("The domain name extension of the email address you entered\nappears invalid.");return false;}
if(len<2){alert("The email address you entered is missing a hostname.");return false;}
return true;}
var counter=0;function isReady(){var ret=false;if(validate_form())ret=true;ret=emailCheck(document.info.email.value)?true:false;if(ret){if(counter++){ret=false;alert('The Form Is Already Being Submitted');}}else{ret=true;alert(ret);return ret;}}
var Prototype={Version:'1.4.0',ScriptFragment:'(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',emptyFunction:function(){},K:function(x){return x}}
var Class={create:function(){return function(){this.initialize.apply(this,arguments);}}}
var Abstract=new Object();Object.extend=function(destination,source){for(property in source){destination[property]=source[property];}
return destination;}
Object.inspect=function(object){try{if(object==undefined)return'undefined';if(object==null)return'null';return object.inspect?object.inspect():object.toString();}catch(e){if(e instanceof RangeError)return'...';throw e;}}
Function.prototype.bind=function(){var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)));}}
Function.prototype.bindAsEventListener=function(object){var __method=this;return function(event){return __method.call(object,event||window.event);}}
Object.extend(Number.prototype,{toColorPart:function(){var digits=this.toString(16);if(this<16)return'0'+digits;return digits;},succ:function(){return this+1;},times:function(iterator){$R(0,this,true).each(iterator);return this;}});var Try={these:function(){var returnValue;for(var i=0;i<arguments.length;i++){var lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}}
return returnValue;}}
var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(callback,frequency){this.callback=callback;this.frequency=frequency;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback();}finally{this.currentlyExecuting=false;}}}}
function $(){var elements=new Array();for(var i=0;i<arguments.length;i++){var element=arguments[i];if(typeof element=='string')
element=document.getElementById(element);if(arguments.length==1)
return element;elements.push(element);}
return elements;}
Object.extend(String.prototype,{stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'');},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,'img'),'');},extractScripts:function(){var matchAll=new RegExp(Prototype.ScriptFragment,'img');var matchOne=new RegExp(Prototype.ScriptFragment,'im');return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||['',''])[1];});},evalScripts:function(){return this.extractScripts().map(eval);},escapeHTML:function(){var div=document.createElement('div');var text=document.createTextNode(this);div.appendChild(text);return div.innerHTML;},unescapeHTML:function(){var div=document.createElement('div');div.innerHTML=this.stripTags();return div.childNodes[0]?div.childNodes[0].nodeValue:'';},toQueryParams:function(){var pairs=this.match(/^\??(.*)$/)[1].split('&');return pairs.inject({},function(params,pairString){var pair=pairString.split('=');params[pair[0]]=pair[1];return params;});},toArray:function(){return this.split('');},camelize:function(){var oStringList=this.split('-');if(oStringList.length==1)return oStringList[0];var camelizedString=this.indexOf('-')==0?oStringList[0].charAt(0).toUpperCase()+oStringList[0].substring(1):oStringList[0];for(var i=1,len=oStringList.length;i<len;i++){var s=oStringList[i];camelizedString+=s.charAt(0).toUpperCase()+s.substring(1);}
return camelizedString;},inspect:function(){return"'"+this.replace('\\','\\\\').replace("'",'\\\'')+"'";}});String.prototype.parseQuery=String.prototype.toQueryParams;var $break=new Object();var $continue=new Object();var Enumerable={each:function(iterator){var index=0;try{this._each(function(value){try{iterator(value,index++);}catch(e){if(e!=$continue)throw e;}});}catch(e){if(e!=$break)throw e;}},all:function(iterator){var result=true;this.each(function(value,index){result=result&&!!(iterator||Prototype.K)(value,index);if(!result)throw $break;});return result;},any:function(iterator){var result=true;this.each(function(value,index){if(result=!!(iterator||Prototype.K)(value,index))
throw $break;});return result;},collect:function(iterator){var results=[];this.each(function(value,index){results.push(iterator(value,index));});return results;},detect:function(iterator){var result;this.each(function(value,index){if(iterator(value,index)){result=value;throw $break;}});return result;},findAll:function(iterator){var results=[];this.each(function(value,index){if(iterator(value,index))
results.push(value);});return results;},grep:function(pattern,iterator){var results=[];this.each(function(value,index){var stringValue=value.toString();if(stringValue.match(pattern))
results.push((iterator||Prototype.K)(value,index));})
return results;},include:function(object){var found=false;this.each(function(value){if(value==object){found=true;throw $break;}});return found;},inject:function(memo,iterator){this.each(function(value,index){memo=iterator(memo,value,index);});return memo;},invoke:function(method){var args=$A(arguments).slice(1);return this.collect(function(value){return value[method].apply(value,args);});},max:function(iterator){var result;this.each(function(value,index){value=(iterator||Prototype.K)(value,index);if(value>=(result||value))
result=value;});return result;},min:function(iterator){var result;this.each(function(value,index){value=(iterator||Prototype.K)(value,index);if(value<=(result||value))
result=value;});return result;},partition:function(iterator){var trues=[],falses=[];this.each(function(value,index){((iterator||Prototype.K)(value,index)?trues:falses).push(value);});return[trues,falses];},pluck:function(property){var results=[];this.each(function(value,index){results.push(value[property]);});return results;},reject:function(iterator){var results=[];this.each(function(value,index){if(!iterator(value,index))
results.push(value);});return results;},sortBy:function(iterator){return this.collect(function(value,index){return{value:value,criteria:iterator(value,index)};}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0;}).pluck('value');},toArray:function(){return this.collect(Prototype.K);},zip:function(){var iterator=Prototype.K,args=$A(arguments);if(typeof args.last()=='function')
iterator=args.pop();var collections=[this].concat(args).map($A);return this.map(function(value,index){iterator(value=collections.pluck(index));return value;});},inspect:function(){return'#<Enumerable:'+this.toArray().inspect()+'>';}}
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(iterable){if(!iterable)return[];if(iterable.toArray){return iterable.toArray();}else{var results=[];for(var i=0;i<iterable.length;i++)
results.push(iterable[i]);return results;}}
Object.extend(Array.prototype,Enumerable);Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(iterator){for(var i=0;i<this.length;i++)
iterator(this[i]);},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(value){return value!=undefined||value!=null;});},flatten:function(){return this.inject([],function(array,value){return array.concat(value.constructor==Array?value.flatten():[value]);});},without:function(){var values=$A(arguments);return this.select(function(value){return!values.include(value);});},indexOf:function(object){for(var i=0;i<this.length;i++)
if(this[i]==object)return i;return-1;},reverse:function(inline){return(inline!==false?this:this.toArray())._reverse();},shift:function(){var result=this[0];for(var i=0;i<this.length-1;i++)
this[i]=this[i+1];this.length--;return result;},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']';}});var Hash={_each:function(iterator){for(key in this){var value=this[key];if(typeof value=='function')continue;var pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}},keys:function(){return this.pluck('key');},values:function(){return this.pluck('value');},merge:function(hash){return $H(hash).inject($H(this),function(mergedHash,pair){mergedHash[pair.key]=pair.value;return mergedHash;});},toQueryString:function(){return this.map(function(pair){return pair.map(encodeURIComponent).join('=');}).join('&');},inspect:function(){return'#<Hash:{'+this.map(function(pair){return pair.map(Object.inspect).join(': ');}).join(', ')+'}>';}}
function $H(object){var hash=Object.extend({},object||{});Object.extend(hash,Enumerable);Object.extend(hash,Hash);return hash;}
ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(start,end,exclusive){this.start=start;this.end=end;this.exclusive=exclusive;},_each:function(iterator){var value=this.start;do{iterator(value);value=value.succ();}while(this.include(value));},include:function(value){if(value<this.start)
return false;if(this.exclusive)
return value<this.end;return value<=this.end;}});var $R=function(start,end,exclusive){return new ObjectRange(start,end,exclusive);}
var Ajax={getTransport:function(){return Try.these(function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')},function(){return new XMLHttpRequest()})||false;},activeRequestCount:0}
Ajax.Responders={responders:[],_each:function(iterator){this.responders._each(iterator);},register:function(responderToAdd){if(!this.include(responderToAdd))
this.responders.push(responderToAdd);},unregister:function(responderToRemove){this.responders=this.responders.without(responderToRemove);},dispatch:function(callback,request,transport,json){this.each(function(responder){if(responder[callback]&&typeof responder[callback]=='function'){try{responder[callback].apply(responder,[request,transport,json]);}catch(e){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++;},onComplete:function(){Ajax.activeRequestCount--;}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(options){this.options={method:'post',asynchronous:true,parameters:''}
Object.extend(this.options,options||{});},responseIsSuccess:function(){return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300);},responseIsFailure:function(){return!this.responseIsSuccess();}}
Ajax.Request=Class.create();Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(url,options){this.transport=Ajax.getTransport();this.setOptions(options);this.request(url);},request:function(url){var parameters=this.options.parameters||'';if(parameters.length>0)parameters+='&_=';try{this.url=url;if(this.options.method=='get'&&parameters.length>0)
this.url+=(this.url.match(/\?/)?'&':'?')+parameters;Ajax.Responders.dispatch('onCreate',this,this.transport);this.transport.open(this.options.method,this.url,this.options.asynchronous);if(this.options.asynchronous){this.transport.onreadystatechange=this.onStateChange.bind(this);setTimeout((function(){this.respondToReadyState(1)}).bind(this),10);}
this.setRequestHeaders();var body=this.options.postBody?this.options.postBody:parameters;this.transport.send(this.options.method=='post'?body:null);}catch(e){this.dispatchException(e);}},setRequestHeaders:function(){var requestHeaders=['X-Requested-With','XMLHttpRequest','X-Prototype-Version',Prototype.Version];if(this.options.method=='post'){requestHeaders.push('Content-type','application/x-www-form-urlencoded');if(this.transport.overrideMimeType)
requestHeaders.push('Connection','close');}
if(this.options.requestHeaders)
requestHeaders.push.apply(requestHeaders,this.options.requestHeaders);for(var i=0;i<requestHeaders.length;i+=2)
this.transport.setRequestHeader(requestHeaders[i],requestHeaders[i+1]);},onStateChange:function(){var readyState=this.transport.readyState;if(readyState!=1)
this.respondToReadyState(this.transport.readyState);},header:function(name){try{return this.transport.getResponseHeader(name);}catch(e){}},evalJSON:function(){try{return eval(this.header('X-JSON'));}catch(e){}},evalResponse:function(){try{return eval(this.transport.responseText);}catch(e){this.dispatchException(e);}},respondToReadyState:function(readyState){var event=Ajax.Request.Events[readyState];var transport=this.transport,json=this.evalJSON();if(event=='Complete'){try{(this.options['on'+this.transport.status]||this.options['on'+(this.responseIsSuccess()?'Success':'Failure')]||Prototype.emptyFunction)(transport,json);}catch(e){this.dispatchException(e);}
if((this.header('Content-type')||'').match(/^text\/javascript/i))
this.evalResponse();}
try{(this.options['on'+event]||Prototype.emptyFunction)(transport,json);Ajax.Responders.dispatch('on'+event,this,transport,json);}catch(e){this.dispatchException(e);}
if(event=='Complete')
this.transport.onreadystatechange=Prototype.emptyFunction;},dispatchException:function(exception){(this.options.onException||Prototype.emptyFunction)(this,exception);Ajax.Responders.dispatch('onException',this,exception);}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(container,url,options){this.containers={success:container.success?$(container.success):$(container),failure:container.failure?$(container.failure):(container.success?null:$(container))}
this.transport=Ajax.getTransport();this.setOptions(options);var onComplete=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(transport,object){this.updateContent();onComplete(transport,object);}).bind(this);this.request(url);},updateContent:function(){var receiver=this.responseIsSuccess()?this.containers.success:this.containers.failure;var response=this.transport.responseText;if(!this.options.evalScripts)
response=response.stripScripts();if(receiver){if(this.options.insertion){new this.options.insertion(receiver,response);}else{Element.update(receiver,response);}}
if(this.responseIsSuccess()){if(this.onComplete)
setTimeout(this.onComplete.bind(this),10);}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(container,url,options){this.setOptions(options);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=container;this.url=url;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(request){if(this.options.decay){this.decay=(request.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=request.responseText;}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});document.getElementsByClassName=function(className,parentElement){var children=($(parentElement)||document.body).getElementsByTagName('*');return $A(children).inject([],function(elements,child){if(child.className.match(new RegExp("(^|\\s)"+className+"(\\s|$)")))
elements.push(child);return elements;});}
if(!window.Element){var Element=new Object();}
Object.extend(Element,{visible:function(element){return $(element).style.display!='none';},toggle:function(){for(var i=0;i<arguments.length;i++){var element=$(arguments[i]);Element[Element.visible(element)?'hide':'show'](element);}},hide:function(){for(var i=0;i<arguments.length;i++){var element=$(arguments[i]);element.style.display='none';}},show:function(){for(var i=0;i<arguments.length;i++){var element=$(arguments[i]);element.style.display='';}},remove:function(element){element=$(element);element.parentNode.removeChild(element);},update:function(element,html){$(element).innerHTML=html.stripScripts();setTimeout(function(){html.evalScripts()},10);},getHeight:function(element){element=$(element);return element.offsetHeight;},classNames:function(element){return new Element.ClassNames(element);},hasClassName:function(element,className){if(!(element=$(element)))return;return Element.classNames(element).include(className);},addClassName:function(element,className){if(!(element=$(element)))return;return Element.classNames(element).add(className);},removeClassName:function(element,className){if(!(element=$(element)))return;return Element.classNames(element).remove(className);},cleanWhitespace:function(element){element=$(element);for(var i=0;i<element.childNodes.length;i++){var node=element.childNodes[i];if(node.nodeType==3&&!/\S/.test(node.nodeValue))
Element.remove(node);}},empty:function(element){return $(element).innerHTML.match(/^\s*$/);},scrollTo:function(element){element=$(element);var x=element.x?element.x:element.offsetLeft,y=element.y?element.y:element.offsetTop;window.scrollTo(x,y);},getStyle:function(element,style){element=$(element);var value=element.style[style.camelize()];if(!value){if(document.defaultView&&document.defaultView.getComputedStyle){var css=document.defaultView.getComputedStyle(element,null);value=css?css.getPropertyValue(style):null;}else if(element.currentStyle){value=element.currentStyle[style.camelize()];}}
if(window.opera&&['left','top','right','bottom'].include(style))
if(Element.getStyle(element,'position')=='static')value='auto';return value=='auto'?null:value;},setStyle:function(element,style){element=$(element);for(name in style)
element.style[name.camelize()]=style[name];},getDimensions:function(element){element=$(element);if(Element.getStyle(element,'display')!='none')
return{width:element.offsetWidth,height:element.offsetHeight};var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;els.visibility='hidden';els.position='absolute';els.display='';var originalWidth=element.clientWidth;var originalHeight=element.clientHeight;els.display='none';els.position=originalPosition;els.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};},makePositioned:function(element){element=$(element);var pos=Element.getStyle(element,'position');if(pos=='static'||!pos){element._madePositioned=true;element.style.position='relative';if(window.opera){element.style.top=0;element.style.left=0;}}},undoPositioned:function(element){element=$(element);if(element._madePositioned){element._madePositioned=undefined;element.style.position=element.style.top=element.style.left=element.style.bottom=element.style.right='';}},makeClipping:function(element){element=$(element);if(element._overflow)return;element._overflow=element.style.overflow;if((Element.getStyle(element,'overflow')||'visible')!='hidden')
element.style.overflow='hidden';},undoClipping:function(element){element=$(element);if(element._overflow)return;element.style.overflow=element._overflow;element._overflow=undefined;}});var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(adjacency){this.adjacency=adjacency;}
Abstract.Insertion.prototype={initialize:function(element,content){this.element=$(element);this.content=content.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content);}catch(e){if(this.element.tagName.toLowerCase()=='tbody'){this.insertContent(this.contentFromAnonymousTable());}else{throw e;}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange)this.initializeRange();this.insertContent([this.range.createContextualFragment(this.content)]);}
setTimeout(function(){content.evalScripts()},10);},contentFromAnonymousTable:function(){var div=document.createElement('div');div.innerHTML='<table><tbody>'+this.content+'</tbody></table>';return $A(div.childNodes[0].childNodes[0].childNodes);}}
var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion('beforeBegin'),{initializeRange:function(){this.range.setStartBefore(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.parentNode.insertBefore(fragment,this.element);}).bind(this));}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion('afterBegin'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true);},insertContent:function(fragments){fragments.reverse(false).each((function(fragment){this.element.insertBefore(fragment,this.element.firstChild);}).bind(this));}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion('beforeEnd'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.appendChild(fragment);}).bind(this));}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion('afterEnd'),{initializeRange:function(){this.range.setStartAfter(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.parentNode.insertBefore(fragment,this.element.nextSibling);}).bind(this));}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(element){this.element=$(element);},_each:function(iterator){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(iterator);},set:function(className){this.element.className=className;},add:function(classNameToAdd){if(this.include(classNameToAdd))return;this.set(this.toArray().concat(classNameToAdd).join(' '));},remove:function(classNameToRemove){if(!this.include(classNameToRemove))return;this.set(this.select(function(className){return className!=classNameToRemove;}).join(' '));},toString:function(){return this.toArray().join(' ');}}
Object.extend(Element.ClassNames.prototype,Enumerable);var Field={clear:function(){for(var i=0;i<arguments.length;i++)
$(arguments[i]).value='';},focus:function(element){$(element).focus();},present:function(){for(var i=0;i<arguments.length;i++)
if($(arguments[i]).value=='')return false;return true;},select:function(element){$(element).select();},activate:function(element){element=$(element);element.focus();if(element.select)
element.select();}}
var Form={serialize:function(form){var elements=Form.getElements($(form));var queryComponents=new Array();for(var i=0;i<elements.length;i++){var queryComponent=Form.Element.serialize(elements[i]);if(queryComponent)
queryComponents.push(queryComponent);}
return queryComponents.join('&');},getElements:function(form){form=$(form);var elements=new Array();for(tagName in Form.Element.Serializers){var tagElements=form.getElementsByTagName(tagName);for(var j=0;j<tagElements.length;j++)
elements.push(tagElements[j]);}
return elements;},getInputs:function(form,typeName,name){form=$(form);var inputs=form.getElementsByTagName('input');if(!typeName&&!name)
return inputs;var matchingInputs=new Array();for(var i=0;i<inputs.length;i++){var input=inputs[i];if((typeName&&input.type!=typeName)||(name&&input.name!=name))
continue;matchingInputs.push(input);}
return matchingInputs;},disable:function(form){var elements=Form.getElements(form);for(var i=0;i<elements.length;i++){var element=elements[i];element.blur();element.disabled='true';}},enable:function(form){var elements=Form.getElements(form);for(var i=0;i<elements.length;i++){var element=elements[i];element.disabled='';}},findFirstElement:function(form){return Form.getElements(form).find(function(element){return element.type!='hidden'&&!element.disabled&&['input','select','textarea'].include(element.tagName.toLowerCase());});},focusFirstElement:function(form){Field.activate(Form.findFirstElement(form));},reset:function(form){$(form).reset();}}
Form.Element={serialize:function(element){element=$(element);var method=element.tagName.toLowerCase();var parameter=Form.Element.Serializers[method](element);if(parameter){var key=encodeURIComponent(parameter[0]);if(key.length==0)return;if(parameter[1].constructor!=Array)
parameter[1]=[parameter[1]];return parameter[1].map(function(value){return key+'='+encodeURIComponent(value);}).join('&');}},getValue:function(element){element=$(element);var method=element.tagName.toLowerCase();var parameter=Form.Element.Serializers[method](element);if(parameter)
return parameter[1];}}
Form.Element.Serializers={input:function(element){switch(element.type.toLowerCase()){case'submit':case'hidden':case'password':case'text':return Form.Element.Serializers.textarea(element);case'checkbox':case'radio':return Form.Element.Serializers.inputSelector(element);}
return false;},inputSelector:function(element){if(element.checked)
return[element.name,element.value];},textarea:function(element){return[element.name,element.value];},select:function(element){return Form.Element.Serializers[element.type=='select-one'?'selectOne':'selectMany'](element);},selectOne:function(element){var value='',opt,index=element.selectedIndex;if(index>=0){opt=element.options[index];value=opt.value;if(!value&&!('value'in opt))
value=opt.text;}
return[element.name,value];},selectMany:function(element){var value=new Array();for(var i=0;i<element.length;i++){var opt=element.options[i];if(opt.selected){var optValue=opt.value;if(!optValue&&!('value'in opt))
optValue=opt.text;value.push(optValue);}}
return[element.name,value];}}
var $F=Form.Element.getValue;Abstract.TimedObserver=function(){}
Abstract.TimedObserver.prototype={initialize:function(element,frequency,callback){this.frequency=frequency;this.element=$(element);this.callback=callback;this.lastValue=this.getValue();this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value;}}}
Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=function(){}
Abstract.EventObserver.prototype={initialize:function(element,callback){this.element=$(element);this.callback=callback;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=='form')
this.registerFormCallbacks();else
this.registerCallback(this.element);},onElementEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value;}},registerFormCallbacks:function(){var elements=Form.getElements(this.element);for(var i=0;i<elements.length;i++)
this.registerCallback(elements[i]);},registerCallback:function(element){if(element.type){switch(element.type.toLowerCase()){case'checkbox':case'radio':Event.observe(element,'click',this.onElementEvent.bind(this));break;case'password':case'text':case'textarea':case'select-one':case'select-multiple':Event.observe(element,'change',this.onElementEvent.bind(this));break;}}}}
Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element);}});if(!window.Event){var Event=new Object();}
Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(event){return event.target||event.srcElement;},isLeftClick:function(event){return(((event.which)&&(event.which==1))||((event.button)&&(event.button==1)));},pointerX:function(event){return event.pageX||(event.clientX+
(document.documentElement.scrollLeft||document.body.scrollLeft));},pointerY:function(event){return event.pageY||(event.clientY+
(document.documentElement.scrollTop||document.body.scrollTop));},stop:function(event){if(event.preventDefault){event.preventDefault();event.stopPropagation();}else{event.returnValue=false;event.cancelBubble=true;}},findElement:function(event,tagName){var element=Event.element(event);while(element.parentNode&&(!element.tagName||(element.tagName.toUpperCase()!=tagName.toUpperCase())))
element=element.parentNode;return element;},observers:false,_observeAndCache:function(element,name,observer,useCapture){if(!this.observers)this.observers=[];if(element.addEventListener){this.observers.push([element,name,observer,useCapture]);element.addEventListener(name,observer,useCapture);}else if(element.attachEvent){this.observers.push([element,name,observer,useCapture]);element.attachEvent('on'+name,observer);}},unloadCache:function(){if(!Event.observers)return;for(var i=0;i<Event.observers.length;i++){Event.stopObserving.apply(this,Event.observers[i]);Event.observers[i][0]=null;}
Event.observers=false;},observe:function(element,name,observer,useCapture){var element=$(element);useCapture=useCapture||false;if(name=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.attachEvent))
name='keydown';this._observeAndCache(element,name,observer,useCapture);},stopObserving:function(element,name,observer,useCapture){var element=$(element);useCapture=useCapture||false;if(name=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.detachEvent))
name='keydown';if(element.removeEventListener){element.removeEventListener(name,observer,useCapture);}else if(element.detachEvent){element.detachEvent('on'+name,observer);}}});Event.observe(window,'unload',Event.unloadCache,false);var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},realOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.scrollTop||0;valueL+=element.scrollLeft||0;element=element.parentNode;}while(element);return[valueL,valueT];},cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return[valueL,valueT];},positionedOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;if(element){p=Element.getStyle(element,'position');if(p=='relative'||p=='absolute')break;}}while(element);return[valueL,valueT];},offsetParent:function(element){if(element.offsetParent)return element.offsetParent;if(element==document.body)return element;while((element=element.parentNode)&&element!=document.body)
if(Element.getStyle(element,'position')!='static')
return element;return document.body;},within:function(element,x,y){if(this.includeScrollOffsets)
return this.withinIncludingScrolloffsets(element,x,y);this.xcomp=x;this.ycomp=y;this.offset=this.cumulativeOffset(element);return(y>=this.offset[1]&&y<this.offset[1]+element.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+element.offsetWidth);},withinIncludingScrolloffsets:function(element,x,y){var offsetcache=this.realOffset(element);this.xcomp=x+offsetcache[0]-this.deltaX;this.ycomp=y+offsetcache[1]-this.deltaY;this.offset=this.cumulativeOffset(element);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+element.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+element.offsetWidth);},overlap:function(mode,element){if(!mode)return 0;if(mode=='vertical')
return((this.offset[1]+element.offsetHeight)-this.ycomp)/element.offsetHeight;if(mode=='horizontal')
return((this.offset[0]+element.offsetWidth)-this.xcomp)/element.offsetWidth;},clone:function(source,target){source=$(source);target=$(target);target.style.position='absolute';var offsets=this.cumulativeOffset(source);target.style.top=offsets[1]+'px';target.style.left=offsets[0]+'px';target.style.width=source.offsetWidth+'px';target.style.height=source.offsetHeight+'px';},page:function(forElement){var valueT=0,valueL=0;var element=forElement;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;}while(element=element.offsetParent);element=forElement;do{valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0;}while(element=element.parentNode);return[valueL,valueT];},clone:function(source,target){var options=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{})
source=$(source);var p=Position.page(source);target=$(target);var delta=[0,0];var parent=null;if(Element.getStyle(target,'position')=='absolute'){parent=Position.offsetParent(target);delta=Position.page(parent);}
if(parent==document.body){delta[0]-=document.body.offsetLeft;delta[1]-=document.body.offsetTop;}
if(options.setLeft)target.style.left=(p[0]-delta[0]+options.offsetLeft)+'px';if(options.setTop)target.style.top=(p[1]-delta[1]+options.offsetTop)+'px';if(options.setWidth)target.style.width=source.offsetWidth+'px';if(options.setHeight)target.style.height=source.offsetHeight+'px';},absolutize:function(element){element=$(element);if(element.style.position=='absolute')return;Position.prepare();var offsets=Position.positionedOffset(element);var top=offsets[1];var left=offsets[0];var width=element.clientWidth;var height=element.clientHeight;element._originalLeft=left-parseFloat(element.style.left||0);element._originalTop=top-parseFloat(element.style.top||0);element._originalWidth=element.style.width;element._originalHeight=element.style.height;element.style.position='absolute';element.style.top=top+'px';;element.style.left=left+'px';;element.style.width=width+'px';;element.style.height=height+'px';;},relativize:function(element){element=$(element);if(element.style.position=='relative')return;Position.prepare();element.style.position='relative';var top=parseFloat(element.style.top||0)-(element._originalTop||0);var left=parseFloat(element.style.left||0)-(element._originalLeft||0);element.style.top=top+'px';element.style.left=left+'px';element.style.height=element._originalHeight;element.style.width=element._originalWidth;}}
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;element=element.offsetParent;}while(element);return[valueL,valueT];}}
var Scriptaculous={Version:'1.5.1',require:function(libraryName){document.write('<script type="text/javascript" src="'+libraryName+'"></script>');},load:function(){if((typeof Prototype=='undefined')||parseFloat(Prototype.Version.split(".")[0]+"."+
Prototype.Version.split(".")[1])<1.4)
throw("script.aculo.us requires the Prototype JavaScript framework >= 1.4.0");$A(document.getElementsByTagName("script")).findAll(function(s){return(s.src&&s.src.match(/scriptaculous\.js(\?.*)?$/))}).each(function(s){var path=s.src.replace(/scriptaculous\.js(\?.*)?$/,'');var includes=s.src.match(/\?.*load=([a-z,]*)/);(includes?includes[1]:'builder,effects,slider').split(',').each(function(include){Scriptaculous.require(path+include+'.js')});});}}
Scriptaculous.load();var fileLoadingImage="https://www.bigdiscountfragrances.com/images/lightbox/loading.gif";var fileBottomNavCloseImage="https://www.bigdiscountfragrances.com/images/lightbox/closelabel.gif";var resizeSpeed=7;var borderSize=10;var imageArray=new Array;var activeImage;if(resizeSpeed>10){resizeSpeed=10;}
if(resizeSpeed<1){resizeSpeed=1;}
resizeDuration=(11-resizeSpeed)*0.15;Object.extend(Element,{getWidth:function(element){element=$(element);return element.offsetWidth;},setWidth:function(element,w){element=$(element);element.style.width=w+"px";},setHeight:function(element,h){element=$(element);element.style.height=h+"px";},setTop:function(element,t){element=$(element);element.style.top=t+"px";},setSrc:function(element,src){element=$(element);element.src=src;},setHref:function(element,href){element=$(element);element.href=href;},setInnerHTML:function(element,content){element=$(element);element.innerHTML=content;}});Array.prototype.removeDuplicates=function(){for(i=1;i<this.length;i++){if(this[i][0]==this[i-1][0]){this.splice(i,1);}}}
Array.prototype.empty=function(){for(i=0;i<=this.length;i++){this.shift();}}
var Lightbox=Class.create();Lightbox.prototype={initialize:function(){if(!document.getElementsByTagName){return;}
var anchors=document.getElementsByTagName('a');for(var i=0;i<anchors.length;i++){var anchor=anchors[i];var relAttribute=String(anchor.getAttribute('rel'));if(anchor.getAttribute('href')&&(relAttribute.toLowerCase().match('lightbox'))){anchor.onclick=function(){myLightbox.start(this);return false;}}}
var objBody=document.getElementsByTagName("body").item(0);var objOverlay=document.createElement("div");objOverlay.setAttribute('id','overlay');objOverlay.style.display='none';objOverlay.onclick=function(){myLightbox.end();return false;}
objBody.appendChild(objOverlay);var objLightbox=document.createElement("div");objLightbox.setAttribute('id','lightbox');objLightbox.style.display='none';objBody.appendChild(objLightbox);var objOuterImageContainer=document.createElement("div");objOuterImageContainer.setAttribute('id','outerImageContainer');objLightbox.appendChild(objOuterImageContainer);var objImageContainer=document.createElement("div");objImageContainer.setAttribute('id','imageContainer');objOuterImageContainer.appendChild(objImageContainer);var objLightboxImage=document.createElement("img");objLightboxImage.setAttribute('id','lightboxImage');objImageContainer.appendChild(objLightboxImage);var objHoverNav=document.createElement("div");objHoverNav.setAttribute('id','hoverNav');objImageContainer.appendChild(objHoverNav);var objPrevLink=document.createElement("a");objPrevLink.setAttribute('id','prevLink');objPrevLink.setAttribute('href','#');objHoverNav.appendChild(objPrevLink);var objNextLink=document.createElement("a");objNextLink.setAttribute('id','nextLink');objNextLink.setAttribute('href','#');objHoverNav.appendChild(objNextLink);var objLoading=document.createElement("div");objLoading.setAttribute('id','loading');objImageContainer.appendChild(objLoading);var objLoadingLink=document.createElement("a");objLoadingLink.setAttribute('id','loadingLink');objLoadingLink.setAttribute('href','#');objLoadingLink.onclick=function(){myLightbox.end();return false;}
objLoading.appendChild(objLoadingLink);var objLoadingImage=document.createElement("img");objLoadingImage.setAttribute('src',fileLoadingImage);objLoadingLink.appendChild(objLoadingImage);var objImageDataContainer=document.createElement("div");objImageDataContainer.setAttribute('id','imageDataContainer');objImageDataContainer.className='clearfix';objLightbox.appendChild(objImageDataContainer);var objImageData=document.createElement("div");objImageData.setAttribute('id','imageData');objImageDataContainer.appendChild(objImageData);var objImageDetails=document.createElement("div");objImageDetails.setAttribute('id','imageDetails');objImageData.appendChild(objImageDetails);var objCaption=document.createElement("span");objCaption.setAttribute('id','caption');objImageDetails.appendChild(objCaption);var objNumberDisplay=document.createElement("span");objNumberDisplay.setAttribute('id','numberDisplay');objImageDetails.appendChild(objNumberDisplay);var objBottomNav=document.createElement("div");objBottomNav.setAttribute('id','bottomNav');objImageData.appendChild(objBottomNav);var objBottomNavCloseLink=document.createElement("a");objBottomNavCloseLink.setAttribute('id','bottomNavClose');objBottomNavCloseLink.setAttribute('href','#');objBottomNavCloseLink.onclick=function(){myLightbox.end();return false;}
objBottomNav.appendChild(objBottomNavCloseLink);var objBottomNavCloseImage=document.createElement("img");objBottomNavCloseImage.setAttribute('src',fileBottomNavCloseImage);objBottomNavCloseLink.appendChild(objBottomNavCloseImage);},start:function(imageLink){hideSelectBoxes();var arrayPageSize=getPageSize();Element.setHeight('overlay',arrayPageSize[1]);new Effect.Appear('overlay',{duration:0.2,from:0.0,to:0.8});imageArray=[];imageNum=0;if(!document.getElementsByTagName){return;}
var anchors=document.getElementsByTagName('a');if((imageLink.getAttribute('rel')=='lightbox')){imageArray.push(new Array(imageLink.getAttribute('href'),imageLink.getAttribute('title')));}else{for(var i=0;i<anchors.length;i++){var anchor=anchors[i];if(anchor.getAttribute('href')&&(anchor.getAttribute('rel')==imageLink.getAttribute('rel'))){imageArray.push(new Array(anchor.getAttribute('href'),anchor.getAttribute('title')));}}
imageArray.removeDuplicates();while(imageArray[imageNum][0]!=imageLink.getAttribute('href')){imageNum++;}}
var arrayPageSize=getPageSize();var arrayPageScroll=getPageScroll();var lightboxTop=arrayPageScroll[1]+(arrayPageSize[3]/15);Element.setTop('lightbox',lightboxTop);Element.show('lightbox');this.changeImage(imageNum);},changeImage:function(imageNum){activeImage=imageNum;Element.show('loading');Element.hide('lightboxImage');Element.hide('hoverNav');Element.hide('prevLink');Element.hide('nextLink');Element.hide('imageDataContainer');Element.hide('numberDisplay');imgPreloader=new Image();imgPreloader.onload=function(){Element.setSrc('lightboxImage',imageArray[activeImage][0]);myLightbox.resizeImageContainer(imgPreloader.width,imgPreloader.height);}
imgPreloader.src=imageArray[activeImage][0];},resizeImageContainer:function(imgWidth,imgHeight){this.wCur=Element.getWidth('outerImageContainer');this.hCur=Element.getHeight('outerImageContainer');this.xScale=((imgWidth+(borderSize*2))/this.wCur)*100;this.yScale=((imgHeight+(borderSize*2))/this.hCur)*100;wDiff=(this.wCur-borderSize*2)-imgWidth;hDiff=(this.hCur-borderSize*2)-imgHeight;if(!(hDiff==0)){new Effect.Scale('outerImageContainer',this.yScale,{scaleX:false,duration:resizeDuration,queue:'front'});}
if(!(wDiff==0)){new Effect.Scale('outerImageContainer',this.xScale,{scaleY:false,delay:resizeDuration,duration:resizeDuration});}
if((hDiff==0)&&(wDiff==0)){if(navigator.appVersion.indexOf("MSIE")!=-1){pause(250);}else{pause(100);}}
Element.setHeight('prevLink',imgHeight);Element.setHeight('nextLink',imgHeight);Element.setWidth('imageDataContainer',imgWidth+(borderSize*2));this.showImage();},showImage:function(){Element.hide('loading');new Effect.Appear('lightboxImage',{duration:0.5,queue:'end',afterFinish:function(){myLightbox.updateDetails();}});this.preloadNeighborImages();},updateDetails:function(){Element.show('caption');Element.setInnerHTML('caption',imageArray[activeImage][1]);if(imageArray.length>1){Element.show('numberDisplay');Element.setInnerHTML('numberDisplay',"Image "+eval(activeImage+1)+" of "+imageArray.length);}
new Effect.Parallel([new Effect.SlideDown('imageDataContainer',{sync:true,duration:resizeDuration+0.25,from:0.0,to:1.0}),new Effect.Appear('imageDataContainer',{sync:true,duration:1.0})],{duration:0.65,afterFinish:function(){myLightbox.updateNav();}});},updateNav:function(){Element.show('hoverNav');if(activeImage!=0){Element.show('prevLink');document.getElementById('prevLink').onclick=function(){myLightbox.changeImage(activeImage-1);return false;}}
if(activeImage!=(imageArray.length-1)){Element.show('nextLink');document.getElementById('nextLink').onclick=function(){myLightbox.changeImage(activeImage+1);return false;}}
this.enableKeyboardNav();},enableKeyboardNav:function(){document.onkeydown=this.keyboardAction;},disableKeyboardNav:function(){document.onkeydown='';},keyboardAction:function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}
key=String.fromCharCode(keycode).toLowerCase();if((key=='x')||(key=='o')||(key=='c')){myLightbox.end();}else if(key=='p'){if(activeImage!=0){myLightbox.disableKeyboardNav();myLightbox.changeImage(activeImage-1);}}else if(key=='n'){if(activeImage!=(imageArray.length-1)){myLightbox.disableKeyboardNav();myLightbox.changeImage(activeImage+1);}}},preloadNeighborImages:function(){if((imageArray.length-1)>activeImage){preloadNextImage=new Image();preloadNextImage.src=imageArray[activeImage+1][0];}
if(activeImage>0){preloadPrevImage=new Image();preloadPrevImage.src=imageArray[activeImage-1][0];}},end:function(){this.disableKeyboardNav();Element.hide('lightbox');new Effect.Fade('overlay',{duration:0.2});showSelectBoxes();}}
function getPageScroll(){var yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;}else if(document.body){yScroll=document.body.scrollTop;}
arrayPageScroll=new Array('',yScroll)
return arrayPageScroll;}
function getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;}
function getKey(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}
key=String.fromCharCode(keycode).toLowerCase();if(key=='x'){}}
function listenKey(){document.onkeypress=getKey;}
function showSelectBoxes(){selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="visible";}}
function hideSelectBoxes(){selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="hidden";}}
function pause(numberMillis){var now=new Date();var exitTime=now.getTime()+numberMillis;while(true){now=new Date();if(now.getTime()>exitTime)
return;}}
/*function initLightbox(){myLightbox=new Lightbox();}
Event.observe(window,'load',initLightbox,false);function ss_fixAllLinks(){var allLinks=document.getElementsByTagName('a');for(var i=0;i<allLinks.length;i++){var lnk=allLinks[i];if((lnk.href&&lnk.href.indexOf('#')!=-1)&&((lnk.pathname==location.pathname)||('/'+lnk.pathname==location.pathname))&&(lnk.search==location.search)){ss_addEvent(lnk,'click',smoothScroll);}}}
function smoothScroll(e){if(window.event){target=window.event.srcElement;}else if(e){target=e.target;}else return;if(target.nodeType==3){target=target.parentNode;}
if(target.nodeName.toLowerCase()!='a')return;anchor=target.hash.substr(1);var allLinks=document.getElementsByTagName('a');var destinationLink=null;for(var i=0;i<allLinks.length;i++){var lnk=allLinks[i];if(lnk.name&&(lnk.name==anchor)){destinationLink=lnk;break;}}
if(!destinationLink)return true;var destx=destinationLink.offsetLeft;var desty=destinationLink.offsetTop;var thisNode=destinationLink;while(thisNode.offsetParent&&(thisNode.offsetParent!=document.body)){thisNode=thisNode.offsetParent;destx+=thisNode.offsetLeft;desty+=thisNode.offsetTop;}
clearInterval(ss_INTERVAL);cypos=ss_getCurrentYPos();ss_stepsize=parseInt((desty-cypos)/ss_STEPS);ss_INTERVAL=setInterval('ss_scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);if(window.event){window.event.cancelBubble=true;window.event.returnValue=false;}
if(e&&e.preventDefault&&e.stopPropagation){e.preventDefault();e.stopPropagation();}}
function ss_scrollWindow(scramount,dest,anchor){wascypos=ss_getCurrentYPos();isAbove=(wascypos<dest);window.scrollTo(0,wascypos+scramount);iscypos=ss_getCurrentYPos();isAboveNow=(iscypos<dest);if((isAbove!=isAboveNow)||(wascypos==iscypos)){window.scrollTo(0,dest);clearInterval(ss_INTERVAL);location.hash=anchor;}}
function ss_getCurrentYPos(){if(document.body&&document.body.scrollTop)
return document.body.scrollTop;if(document.documentElement&&document.documentElement.scrollTop)
return document.documentElement.scrollTop;if(window.pageYOffset)
return window.pageYOffset;return 0;}
function ss_addEvent(elm,evType,fn,useCapture)
{if(elm.addEventListener){elm.addEventListener(evType,fn,useCapture);return true;}else if(elm.attachEvent){var r=elm.attachEvent("on"+evType,fn);return r;}}
var ss_INTERVAL;var ss_STEPS=25;ss_addEvent(window,"load",ss_fixAllLinks);*/
function loadDIV(lyr,data){if(lyr=="giftwrapAdd"){var lyr="giftwrapOptions";var url="/secure2/checkoutGW.php?gwi="+data;}
if(lyr=="giftwrapRemove"){var lyr="giftwrapOptions";var url="/secure2/checkoutGW.php?gwr="+data;}
if(lyr=="giftwrapLoad"){var lyr="giftwrapOptions";var url="/secure2/checkoutGW.php";}
if(lyr=="giftwrapCancelAll"){var lyr="giftwrapOptions";var url="/secure2/checkoutGW.php?gwcancel=1";}
if(lyr=="shippingOptions"){var url="/secure2/checkoutShipping.php?shipvalue="+data+"&st="+document.form1.ShipState.value;}
if(lyr=="shippingOptionsLoad"){var lyr="shippingOptions";var url="/secure2/checkoutShipping.php?st="+document.form1.ShipState.value;}
if(lyr=="cartCoupon"){var ccode=document.getElementById('CouponCode').value;var url="/scripts/php/components/cartCoupon.php?ccode="+ccode+"&apply="+data;}
if(lyr=="cartTotal"){var url="/scripts/php/components/cartTotal.php";}
if(lyr=="cartTotalShipType"){var lyr="cartTotal";var url="/scripts/php/components/cartTotal.php?shipvalue="+data+"&st="+document.form2.ShipState.value;}
if(lyr=="cartTotalState"){var lyr="cartTotal";var url="/scripts/php/components/cartTotal.php?st="+data;}
if(lyr=="orderCalculation"){var url="/secure2/checkoutCalculation.php";}
if(lyr=="stockAlert"){var url="/scripts/php/components/stockalert.php?em="+document.frmDetails.Email.value+"&sapid="+data;}
if(lyr=="regPopUp"){var lyr="reg1";var url="/scripts/php/components/registration_popup.php?em="+document.formSubscribe.BillEmail.value+"&fn="+document.formSubscribe.BillFirstName.value+"&ln="+document.formSubscribe.BillLastName.value+"&submit=true";}
if(document.all){try{var xml=new ActiveXObject("Microsoft.XMLHTTP");xml.onreadystatechange=triggered;xml.Open("GET",url,false);xml.Send(null)
document.getElementById(lyr).innerHTML=xml.responseText;}
catch(e){var xml=new ActiveXObject("MSXML2.XMLHTTP.4.0");xml.onreadystatechange=triggered;xml.Open("GET",url,false);xml.Send(null)
document.getElementById(lyr).innerHTML=xml.responseText;}}else{var xml=new XMLHttpRequest();xml.onreadystatechange=triggered;xml.open("GET",url,false);xml.send(null);document.getElementById(lyr).innerHTML=xml.responseText;}}
function triggered(){if(document.all){try{var xml=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){var xml=new ActiveXObject("MSXML2.XMLHTTP.4.0");}}else{var xml=new XMLHttpRequest();}
if((xml.readyState==4)&&(xml.status==200)){var txt=xml.responseText;var txtNod=document.createTextNode(txt);document.getElementById(lyr).style.display='';document.getElementById(lyr).innerHTML=txt;}}
var uniquepageid=window.location.href.replace("http://"+window.location.hostname,"").replace(/^\//,"")
function animatedcollapse(divId,animatetime,persistexpand,initstate){this.divId=divId
this.divObj=document.getElementById(divId)
this.divObj.style.overflow="hidden"
this.timelength=animatetime
this.initstate=(typeof initstate!="undefined"&&initstate=="block")?"block":"contract"
this.isExpanded=animatedcollapse.getCookie(uniquepageid+"-"+divId)
this.contentheight=parseInt(this.divObj.style.height)
var thisobj=this
if(isNaN(this.contentheight)){animatedcollapse.dotask(window,function(){thisobj._getheight(persistexpand)},"load")
if(!persistexpand&&this.initstate=="contract"||persistexpand&&this.isExpanded!="yes")
this.divObj.style.visibility="hidden"}
else if(!persistexpand&&this.initstate=="contract"||persistexpand&&this.isExpanded!="yes")
this.divObj.style.height=0
if(persistexpand)
animatedcollapse.dotask(window,function(){animatedcollapse.setCookie(uniquepageid+"-"+thisobj.divId,thisobj.isExpanded)},"unload")}
animatedcollapse.prototype._getheight=function(persistexpand){this.contentheight=this.divObj.offsetHeight
if(!persistexpand&&this.initstate=="contract"||persistexpand&&this.isExpanded!="yes"){this.divObj.style.height=0
this.divObj.style.visibility="visible"}
else
this.divObj.style.height=this.contentheight+"px"}
animatedcollapse.prototype._slideengine=function(direction){var elapsed=new Date().getTime()-this.startTime
var thisobj=this
if(elapsed<this.timelength){var distancepercent=(direction=="down")?animatedcollapse.curveincrement(elapsed/this.timelength):1-animatedcollapse.curveincrement(elapsed/this.timelength)
this.divObj.style.height=distancepercent*this.contentheight+"px"
this.runtimer=setTimeout(function(){thisobj._slideengine(direction)},10)}
else{this.divObj.style.height=(direction=="down")?this.contentheight+"px":0
this.isExpanded=(direction=="down")?"yes":"no"
this.runtimer=null}}
animatedcollapse.prototype.slidedown=function(){if(typeof this.runtimer=="undefined"||this.runtimer==null){if(isNaN(this.contentheight))
alert("Please wait until document has fully loaded then click again")
else if(parseInt(this.divObj.style.height)==0){this.startTime=new Date().getTime()
this._slideengine("down")}}}
animatedcollapse.prototype.slideup=function(){if(typeof this.runtimer=="undefined"||this.runtimer==null){if(isNaN(this.contentheight))
alert("Please wait until document has fully loaded then click again")
else if(parseInt(this.divObj.style.height)==this.contentheight){this.startTime=new Date().getTime()
this._slideengine("up")}}}
animatedcollapse.prototype.slideit=function(){if(isNaN(this.contentheight))
alert("Please wait until document has fully loaded then click again")
else if(parseInt(this.divObj.style.height)==0)
this.slidedown()
else if(parseInt(this.divObj.style.height)==this.contentheight)
this.slideup()}
animatedcollapse.curveincrement=function(percent){return(1-Math.cos(percent*Math.PI))/2}
animatedcollapse.dotask=function(target,functionref,tasktype){var tasktype=(window.addEventListener)?tasktype:"on"+tasktype
if(target.addEventListener)
target.addEventListener(tasktype,functionref,false)
else if(target.attachEvent)
target.attachEvent(tasktype,functionref)}
animatedcollapse.getCookie=function(Name){var re=new RegExp(Name+"=[^;]+","i");if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1]
return""}
animatedcollapse.setCookie=function(name,value,days){if(typeof days!="undefined"){var expireDate=new Date()
var expstring=expireDate.setDate(expireDate.getDate()+days)
document.cookie=name+"="+value+"; expires="+expireDate.toGMTString()}
else
document.cookie=name+"="+value}
function bookmark(url,title){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 this page");}}
AJS={BASE_URL:"",drag_obj:null,drag_elm:null,_drop_zones:[],_cur_pos:null,join:function(_1,_2){try{return _2.join(_1);}
catch(e){var r=_2[0]||"";AJS.map(_2,function(_4){r+=_1+_4;},1);return r+"";}},getScrollTop:function(){var t;if(document.documentElement&&document.documentElement.scrollTop){t=document.documentElement.scrollTop;}else{if(document.body){t=document.body.scrollTop;}}
return t;},addClass:function(){var _6=AJS.forceArray(arguments);var _7=_6.pop();var _8=function(o){if(!new RegExp("(^|\\s)"+_7+"(\\s|$)").test(o.className)){o.className+=(o.className?" ":"")+_7;}};AJS.map(_6,function(_a){_8(_a);});},setStyle:function(){var _b=AJS.forceArray(arguments);var _c=_b.pop();var _d=_b.pop();AJS.map(_b,function(_e){_e.style[_d]=AJS.getCssDim(_c);});},_getRealScope:function(fn,_10,_11,_12){var _13=window;_10=AJS.$A(_10);if(fn._cscope){_13=fn._cscope;}
return function(){var _14=[];var i=0;if(_11){i=1;}
AJS.map(arguments,function(arg){_14.push(arg);},i);_14=_14.concat(_10);if(_12){_14=_14.reverse();}
return fn.apply(_13,_14);};},preloadImages:function(){AJS.AEV(window,"load",AJS.$p(function(_17){AJS.map(_17,function(src){var pic=new Image();pic.src=src;});},arguments));},_createDomShortcuts:function(){var _1a=["ul","li","td","tr","th","tbody","table","input","span","b","a","div","img","button","h1","h2","h3","br","textarea","form","p","select","option","iframe","script","center","dl","dt","dd","small","pre"];var _1b=function(elm){var _1d="return AJS.createDOM.apply(null, ['"+elm+"', arguments]);";var _1e="function() { "+_1d+"    }";eval("AJS."+elm.toUpperCase()+"="+_1e);};AJS.map(_1a,_1b);AJS.TN=function(_1f){return document.createTextNode(_1f);};},documentInsert:function(elm){if(typeof(elm)=="string"){elm=AJS.HTML2DOM(elm);}
document.write("<span id=\"dummy_holder\"></span>");AJS.swapDOM(AJS.$("dummy_holder"),elm);},getWindowSize:function(doc){doc=doc||document;var _22,_23;if(self.innerHeight){_22=self.innerWidth;_23=self.innerHeight;}else{if(doc.documentElement&&doc.documentElement.clientHeight){_22=doc.documentElement.clientWidth;_23=doc.documentElement.clientHeight;}else{if(doc.body){_22=doc.body.clientWidth;_23=doc.body.clientHeight;}}}
return{"w":_22,"h":_23};},flattenList:function(_24){var r=[];var _26=function(r,l){AJS.map(l,function(o){if(o==null){}else{if(AJS.isArray(o)){_26(r,o);}else{r.push(o);}}});};_26(r,_24);return r;},setEventKey:function(e){e.key=e.keyCode?e.keyCode:e.charCode;if(window.event){e.ctrl=window.event.ctrlKey;e.shift=window.event.shiftKey;}else{e.ctrl=e.ctrlKey;e.shift=e.shiftKey;}
switch(e.key){case 63232:e.key=38;break;case 63233:e.key=40;break;case 63235:e.key=39;break;case 63234:e.key=37;break;}},removeElement:function(){var _2b=AJS.forceArray(arguments);AJS.map(_2b,function(elm){AJS.swapDOM(elm,null);});},_unloadListeners:function(){if(AJS.listeners){AJS.map(AJS.listeners,function(elm,_2e,fn){AJS.REV(elm,_2e,fn);});}
AJS.listeners=[];},partial:function(fn){var _31=AJS.forceArray(arguments);return AJS.$b(fn,null,_31.slice(1,_31.length).reverse(),false,true);},getIndex:function(elm,_33,_34){for(var i=0;i<_33.length;i++){if(_34&&_34(_33[i])||elm==_33[i]){return i;}}
return-1;},isDefined:function(o){return(o!="undefined"&&o!=null);},isArray:function(obj){return obj instanceof Array;},setLeft:function(){var _38=AJS.forceArray(arguments);_38.splice(_38.length-1,0,"left");AJS.setStyle.apply(null,_38);},appendChildNodes:function(elm){if(arguments.length>=2){AJS.map(arguments,function(n){if(AJS.isString(n)){n=AJS.TN(n);}
if(AJS.isDefined(n)){elm.appendChild(n);}},1);}
return elm;},isOpera:function(){return(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);},isString:function(obj){return(typeof obj=="string");},hideElement:function(elm){var _3d=AJS.forceArray(arguments);AJS.map(_3d,function(elm){elm.style.display="none";});},setOpacity:function(elm,p){elm.style.opacity=p;elm.style.filter="alpha(opacity="+p*100+")";},setHeight:function(){var _41=AJS.forceArray(arguments);_41.splice(_41.length-1,0,"height");AJS.setStyle.apply(null,_41);},setWidth:function(){var _42=AJS.forceArray(arguments);_42.splice(_42.length-1,0,"width");AJS.setStyle.apply(null,_42);},createArray:function(v){if(AJS.isArray(v)&&!AJS.isString(v)){return v;}else{if(!v){return[];}else{return[v];}}},isDict:function(o){var _45=String(o);return _45.indexOf(" Object")!=-1;},isMozilla:function(){return(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1&&navigator.productSub>=20030210);},_listenOnce:function(elm,_47,fn){var _49=function(){AJS.removeEventListener(elm,_47,_49);fn(arguments);};return _49;},addEventListener:function(elm,_4b,fn,_4d,_4e){if(!_4e){_4e=false;}
var _4f=AJS.$A(elm);AJS.map(_4f,function(_50){if(_4d){fn=AJS._listenOnce(_50,_4b,fn);}
if(AJS.isIn(_4b,["submit","load","scroll","resize"])){var old=elm["on"+_4b];elm["on"+_4b]=function(){if(old){fn(arguments);return old(arguments);}else{return fn(arguments);}};return;}
if(AJS.isIn(_4b,["keypress","keydown","keyup","click"])){var _52=fn;fn=function(e){AJS.setEventKey(e);return _52.apply(null,arguments);};}
if(_50.attachEvent){_50.attachEvent("on"+_4b,fn);}else{if(_50.addEventListener){_50.addEventListener(_4b,fn,_4e);}}
AJS.listeners=AJS.$A(AJS.listeners);AJS.listeners.push([_50,_4b,fn]);});},createDOM:function(_54,_55){var i=0,_57;elm=document.createElement(_54);if(AJS.isDict(_55[i])){for(k in _55[0]){_57=_55[0][k];if(k=="style"){elm.style.cssText=_57;}else{if(k=="class"||k=="className"){elm.className=_57;}else{elm.setAttribute(k,_57);}}}
i++;}
if(_55[0]==null){i=1;}
AJS.map(_55,function(n){if(n){if(AJS.isString(n)||AJS.isNumber(n)){n=AJS.TN(n);}
elm.appendChild(n);}},i);return elm;},setTop:function(){var _59=AJS.forceArray(arguments);_59.splice(_59.length-1,0,"top");AJS.setStyle.apply(null,_59);},getElementsByTagAndClassName:function(_5a,_5b,_5c){var _5d=[];if(!AJS.isDefined(_5c)){_5c=document;}
if(!AJS.isDefined(_5a)){_5a="*";}
var els=_5c.getElementsByTagName(_5a);var _5f=els.length;var _60=new RegExp("(^|\\s)"+_5b+"(\\s|$)");for(i=0,j=0;i<_5f;i++){if(_60.test(els[i].className)||_5b==null){_5d[j]=els[i];j++;}}
return _5d;},removeClass:function(){var _61=AJS.forceArray(arguments);var cls=_61.pop();var _63=function(o){o.className=o.className.replace(new RegExp("\\s?"+cls,"g"),"");};AJS.map(_61,function(elm){_63(elm);});},bindMethods:function(_66){for(var k in _66){var _68=_66[k];if(typeof(_68)=="function"){_66[k]=AJS.$b(_68,_66);}}},log:function(o){if(AJS.isMozilla()){console.log(o);}else{var div=AJS.DIV({"style":"color: green"});AJS.ACN(AJS.getBody(),AJS.setHTML(div,""+o));}},isNumber:function(obj){return(typeof obj=="number");},map:function(_6c,fn,_6e,_6f){var i=0,l=_6c.length;if(_6e){i=_6e;}
if(_6f){l=_6f;}
for(i;i<l;i++){fn.apply(null,[_6c[i],i]);}},removeEventListener:function(elm,_73,fn,_75){if(!_75){_75=false;}
if(elm.removeEventListener){elm.removeEventListener(_73,fn,_75);if(AJS.isOpera()){elm.removeEventListener(_73,fn,!_75);}}else{if(elm.detachEvent){elm.detachEvent("on"+_73,fn);}}},getCssDim:function(dim){if(AJS.isString(dim)){return dim;}else{return dim+"px";}},setHTML:function(elm,_78){elm.innerHTML=_78;return elm;},bind:function(fn,_7a,_7b,_7c,_7d){fn._cscope=_7a;return AJS._getRealScope(fn,_7b,_7c,_7d);},forceArray:function(_7e){var r=[];AJS.map(_7e,function(elm){r.push(elm);});return r;},update:function(l1,l2){for(var i in l2){l1[i]=l2[i];}
return l1;},getBody:function(){return AJS.$bytc("body")[0];},HTML2DOM:function(_84,_85){var d=AJS.DIV();d.innerHTML=_84;if(_85){return d.childNodes[0];}else{return d;}},getElement:function(id){if(AJS.isString(id)||AJS.isNumber(id)){return document.getElementById(id);}else{return id;}},showElement:function(){var _88=AJS.forceArray(arguments);AJS.map(_88,function(elm){elm.style.display="";});},swapDOM:function(_8a,src){_8a=AJS.getElement(_8a);var _8c=_8a.parentNode;if(src){src=AJS.getElement(src);_8c.replaceChild(src,_8a);}else{_8c.removeChild(_8a);}
return src;},isIn:function(elm,_8e){var i=AJS.getIndex(elm,_8e);if(i!=-1){return true;}else{return false;}}};AJS.$=AJS.getElement;AJS.$$=AJS.getElements;AJS.$f=AJS.getFormElement;AJS.$p=AJS.partial;AJS.$b=AJS.bind;AJS.$A=AJS.createArray;AJS.DI=AJS.documentInsert;AJS.ACN=AJS.appendChildNodes;AJS.RCN=AJS.replaceChildNodes;AJS.AEV=AJS.addEventListener;AJS.REV=AJS.removeEventListener;AJS.$bytc=AJS.getElementsByTagAndClassName;AJS.addEventListener(window,"unload",AJS._unloadListeners);AJS._createDomShortcuts();AJS.Class=function(_90){var fn=function(){if(arguments[0]!="no_init"){return this.init.apply(this,arguments);}};fn.prototype=_90;AJS.update(fn,AJS.Class.prototype);return fn;};AJS.Class.prototype={extend:function(_92){var _93=new this("no_init");for(k in _92){var _94=_93[k];var cur=_92[k];if(_94&&_94!=cur&&typeof cur=="function"){cur=this._parentize(cur,_94);}
_93[k]=cur;}
return new AJS.Class(_93);},implement:function(_96){AJS.update(this.prototype,_96);},_parentize:function(cur,_98){return function(){this.parent=_98;return cur.apply(this,arguments);};}};AJS.$=AJS.getElement;AJS.$$=AJS.getElements;AJS.$f=AJS.getFormElement;AJS.$b=AJS.bind;AJS.$p=AJS.partial;AJS.$FA=AJS.forceArray;AJS.$A=AJS.createArray;AJS.DI=AJS.documentInsert;AJS.ACN=AJS.appendChildNodes;AJS.RCN=AJS.replaceChildNodes;AJS.AEV=AJS.addEventListener;AJS.REV=AJS.removeEventListener;AJS.$bytc=AJS.getElementsByTagAndClassName;AJSDeferred=function(req){this.callbacks=[];this.errbacks=[];this.req=req;};AJSDeferred.prototype={excCallbackSeq:function(req,_9b){var _9c=req.responseText;while(_9b.length>0){var fn=_9b.pop();var _9e=fn(_9c,req);if(_9e){_9c=_9e;}}},callback:function(){this.excCallbackSeq(this.req,this.callbacks);},errback:function(){if(this.errbacks.length==0){alert("Error encountered:\n"+this.req.responseText);}
this.excCallbackSeq(this.req,this.errbacks);},addErrback:function(fn){this.errbacks.unshift(fn);},addCallback:function(fn){this.callbacks.unshift(fn);},addCallbacks:function(fn1,fn2){this.addCallback(fn1);this.addErrback(fn2);},sendReq:function(_a3){if(AJS.isObject(_a3)){this.req.send(AJS.queryArguments(_a3));}else{if(AJS.isDefined(_a3)){this.req.send(_a3);}else{this.req.send("");}}}};script_loaded=true;script_loaded=true;AJS.fx={_shades:{0:"ffffff",1:"ffffee",2:"ffffdd",3:"ffffcc",4:"ffffbb",5:"ffffaa",6:"ffff99"},highlight:function(_1,_2){var _3=new AJS.fx.Base();_3.elm=AJS.$(_1);_3.setOptions(_2);_3.options.duration=600;AJS.update(_3,{increase:function(){if(this.now==7){_1.style.backgroundColor="transparent";}else{_1.style.backgroundColor="#"+AJS.fx._shades[Math.floor(this.now)];}}});return _3.custom(6,0);},fadeIn:function(_4,_5){_5=_5||{};if(!_5.from){_5.from=0;AJS.setOpacity(_4,0);}
if(!_5.to){_5.to=1;}
var s=new AJS.fx.Style(_4,"opacity",_5);return s.custom(_5.from,_5.to);},fadeOut:function(_7,_8){_8=_8||{};if(!_8.from){_8.from=1;}
if(!_8.to){_8.to=0;}
_8.duration=300;var s=new AJS.fx.Style(_7,"opacity",_8);return s.custom(_8.from,_8.to);},setWidth:function(_a,_b){var s=new AJS.fx.Style(_a,"width",_b);return s.custom(_b.from,_b.to);},setHeight:function(_d,_e){var s=new AJS.fx.Style(_d,"height",_e);return s.custom(_e.from,_e.to);}};AJS.fx.Base=new AJS.Class({init:function(){AJS.bindMethods(this);},setOptions:function(_10){this.options=AJS.update({onStart:function(){},onComplete:function(){},transition:AJS.fx.Transitions.sineInOut,duration:500,wait:true,fps:50},_10||{});},step:function(){var _11=new Date().getTime();if(_11<this.time+this.options.duration){this.cTime=_11-this.time;this.setNow();}else{setTimeout(AJS.$b(this.options.onComplete,this,[this.elm]),10);this.clearTimer();this.now=this.to;}
this.increase();},setNow:function(){this.now=this.compute(this.from,this.to);},compute:function(_12,to){var _14=to-_12;return this.options.transition(this.cTime,_12,_14,this.options.duration);},clearTimer:function(){clearInterval(this.timer);this.timer=null;return this;},_start:function(_15,to){if(!this.options.wait){this.clearTimer();}
if(this.timer){return;}
setTimeout(AJS.$p(this.options.onStart,this.elm),10);this.from=_15;this.to=to;this.time=new Date().getTime();this.timer=setInterval(this.step,Math.round(1000/this.options.fps));return this;},custom:function(_17,to){return this._start(_17,to);},set:function(to){this.now=to;this.increase();return this;},setStyle:function(elm,_1b,val){if(this.property=="opacity"){AJS.setOpacity(elm,val);}else{AJS.setStyle(elm,_1b,val);}}});AJS.fx.Style=AJS.fx.Base.extend({init:function(elm,_1e,_1f){this.parent();this.elm=elm;this.setOptions(_1f);this.property=_1e;},increase:function(){this.setStyle(this.elm,this.property,this.now);}});AJS.fx.Styles=AJS.fx.Base.extend({init:function(elm,_21){this.parent();this.elm=AJS.$(elm);this.setOptions(_21);this.now={};},setNow:function(){for(p in this.from){this.now[p]=this.compute(this.from[p],this.to[p]);}},custom:function(obj){if(this.timer&&this.options.wait){return;}
var _23={};var to={};for(p in obj){_23[p]=obj[p][0];to[p]=obj[p][1];}
return this._start(_23,to);},increase:function(){for(var p in this.now){this.setStyle(this.elm,p,this.now[p]);}}});AJS.fx.Transitions={linear:function(t,b,c,d){return c*t/d+b;},sineInOut:function(t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;}};script_loaded=true;script_loaded=true;var GB_CURRENT=null;GB_hide=function(){GB_CURRENT.hide();};GreyBox=new AJS.Class({init:function(_1){this.use_fx=AJS.fx;this.type="page";this.overlay_click_close=false;this.salt=0;this.root_dir=GB_ROOT_DIR;this.callback_fns=[];this.reload_on_close=false;this.src_loader=this.root_dir+"loader_frame.html";var _2=window.location.hostname.indexOf("www");var _3=this.src_loader.indexOf("www");if(_2!=-1&&_3==-1){this.src_loader=this.src_loader.replace("://","://www.");}
if(_2==-1&&_3!=-1){this.src_loader=this.src_loader.replace("://www.","://");}
this.show_loading=true;AJS.update(this,_1);},addCallback:function(fn){if(fn){this.callback_fns.push(fn);}},show:function(_5){GB_CURRENT=this;this.url=_5;var _6=[AJS.$bytc("object"),AJS.$bytc("select")];AJS.map(AJS.flattenList(_6),function(_7){_7.style.visibility="hidden";});this.createElements();return false;},hide:function(){var _8=this.callback_fns;if(_8!=[]){AJS.map(_8,function(fn){fn();});}
this.onHide();if(this.use_fx){var _a=this.overlay;AJS.fx.fadeOut(this.overlay,{onComplete:function(){AJS.removeElement(_a);_a=null;},duration:300});AJS.removeElement(this.g_window);}else{AJS.removeElement(this.g_window,this.overlay);}
this.removeFrame();AJS.REV(window,"scroll",_GB_setOverlayDimension);AJS.REV(window,"resize",_GB_update);var _b=[AJS.$bytc("object"),AJS.$bytc("select")];AJS.map(AJS.flattenList(_b),function(_c){_c.style.visibility="visible";});GB_CURRENT=null;if(this.reload_on_close){window.location.reload();}},update:function(){this.setOverlayDimension();this.setFrameSize();this.setWindowPosition();},createElements:function(){this.initOverlay();this.g_window=AJS.DIV({"id":"GB_window"});AJS.hideElement(this.g_window);AJS.getBody().insertBefore(this.g_window,this.overlay.nextSibling);this.initFrame();this.initHook();this.update();var me=this;if(this.use_fx){AJS.fx.fadeIn(this.overlay,{duration:300,to:0.7,onComplete:function(){me.onShow();AJS.showElement(me.g_window);me.startLoading();}});}else{AJS.setOpacity(this.overlay,0.7);AJS.showElement(this.g_window);this.onShow();this.startLoading();}
AJS.AEV(window,"scroll",_GB_setOverlayDimension);AJS.AEV(window,"resize",_GB_update);},removeFrame:function(){try{AJS.removeElement(this.iframe);}
catch(e){}
this.iframe=null;},startLoading:function(){this.iframe.src=this.src_loader+"?s="+this.salt++;AJS.showElement(this.iframe);},setOverlayDimension:function(){var _e=AJS.getWindowSize();if(AJS.isMozilla()||AJS.isOpera()){AJS.setWidth(this.overlay,"100%");}else{AJS.setWidth(this.overlay,_e.w);}
var _f=Math.max(AJS.getScrollTop()+_e.h,AJS.getScrollTop()+this.height);if(_f<AJS.getScrollTop()){AJS.setHeight(this.overlay,_f);}else{AJS.setHeight(this.overlay,AJS.getScrollTop()+_e.h);}},initOverlay:function(){this.overlay=AJS.DIV({"id":"GB_overlay"});if(this.overlay_click_close){AJS.AEV(this.overlay,"click",GB_hide);}
AJS.setOpacity(this.overlay,0);AJS.getBody().insertBefore(this.overlay,AJS.getBody().firstChild);},initFrame:function(){if(!this.iframe){var d={"name":"GB_frame","class":"GB_frame","frameBorder":0};this.iframe=AJS.IFRAME(d);this.middle_cnt=AJS.DIV({"class":"content"},this.iframe);this.top_cnt=AJS.DIV();this.bottom_cnt=AJS.DIV();AJS.ACN(this.g_window,this.top_cnt,this.middle_cnt,this.bottom_cnt);}},onHide:function(){},onShow:function(){},setFrameSize:function(){},setWindowPosition:function(){},initHook:function(){}});_GB_update=function(){if(GB_CURRENT){GB_CURRENT.update();}};_GB_setOverlayDimension=function(){if(GB_CURRENT){GB_CURRENT.setOverlayDimension();}};AJS.preloadImages(GB_ROOT_DIR+"indicator.gif");script_loaded=true;var GB_SETS={};function decoGreyboxLinks(){var as=AJS.$bytc("a");AJS.map(as,function(a){if(a.getAttribute("href")&&a.getAttribute("rel")){var rel=a.getAttribute("rel");if(rel.indexOf("gb_")==0){var _14=rel.match(/\w+/)[0];var _15=rel.match(/\[(.*)\]/)[1];var _16=0;var _17={"caption":a.title||"","url":a.href};if(_14=="gb_pageset"||_14=="gb_imageset"){if(!GB_SETS[_15]){GB_SETS[_15]=[];}
GB_SETS[_15].push(_17);_16=GB_SETS[_15].length;}
if(_14=="gb_pageset"){a.onclick=function(){GB_showFullScreenSet(GB_SETS[_15],_16);return false;};}
if(_14=="gb_imageset"){a.onclick=function(){GB_showImageSet(GB_SETS[_15],_16);return false;};}
if(_14=="gb_image"){a.onclick=function(){GB_showImage(_17.caption,_17.url);return false;};}
if(_14=="gb_page"){a.onclick=function(){var sp=_15.split(/, ?/);GB_show(_17.caption,_17.url,parseInt(sp[1]),parseInt(sp[0]));return false;};}
if(_14=="gb_page_fs"){a.onclick=function(){GB_showFullScreen(_17.caption,_17.url);return false;};}
if(_14=="gb_page_center"){a.onclick=function(){var sp=_15.split(/, ?/);GB_showCenter(_17.caption,_17.url,parseInt(sp[1]),parseInt(sp[0]));return false;};}}}});}
AJS.AEV(window,"load",decoGreyboxLinks);GB_showImage=function(_1a,url,_1c){var _1d={width:300,height:300,type:"image",fullscreen:false,center_win:true,caption:_1a,callback_fn:_1c};var win=new GB_Gallery(_1d);return win.show(url);};GB_showPage=function(_1f,url,_21){var _22={type:"page",caption:_1f,callback_fn:_21,fullscreen:true,center_win:false};var win=new GB_Gallery(_22);return win.show(url);};GB_Gallery=GreyBox.extend({init:function(_24){this.parent({});this.img_close=this.root_dir+"g_close.gif";AJS.update(this,_24);this.addCallback(this.callback_fn);},initHook:function(){AJS.addClass(this.g_window,"GB_Gallery");var _25=AJS.DIV({"class":"inner"});this.header=AJS.DIV({"class":"GB_header"},_25);AJS.setOpacity(this.header,0);AJS.getBody().insertBefore(this.header,this.overlay.nextSibling);var _26=AJS.TD({"id":"GB_caption","class":"caption","width":"40%"},this.caption);var _27=AJS.TD({"id":"GB_middle","class":"middle","width":"20%"});var _28=AJS.IMG({"src":this.img_close});AJS.AEV(_28,"click",GB_hide);var _29=AJS.TD({"class":"close","width":"40%"},_28);var _2a=AJS.TBODY(AJS.TR(_26,_27,_29));var _2b=AJS.TABLE({"cellspacing":"0","cellpadding":0,"border":0},_2a);AJS.ACN(_25,_2b);if(this.fullscreen){AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this));}else{AJS.AEV(window,"scroll",AJS.$b(this._setHeaderPos,this));}},setFrameSize:function(){var _2c=this.overlay.offsetWidth;var _2d=AJS.getWindowSize();if(this.fullscreen){this.width=_2c-40;this.height=_2d.h-80;}
AJS.setWidth(this.iframe,this.width);AJS.setHeight(this.iframe,this.height);AJS.setWidth(this.header,_2c);},_setHeaderPos:function(){AJS.setTop(this.header,AJS.getScrollTop()+10);},setWindowPosition:function(){var _2e=this.overlay.offsetWidth;var _2f=AJS.getWindowSize();AJS.setLeft(this.g_window,((_2e-50-this.width)/2));var _30=AJS.getScrollTop()+55;if(!this.center_win){AJS.setTop(this.g_window,_30);}else{var fl=((_2f.h-this.height)/2)+20+AJS.getScrollTop();if(fl<0){fl=0;}
if(_30>fl){fl=_30;}
AJS.setTop(this.g_window,fl);}
this._setHeaderPos();},onHide:function(){AJS.removeElement(this.header);AJS.removeClass(this.g_window,"GB_Gallery");},onShow:function(){if(this.use_fx){AJS.fx.fadeIn(this.header,{to:1});}else{AJS.setOpacity(this.header,1);}}});AJS.preloadImages(GB_ROOT_DIR+"g_close.gif");GB_showFullScreenSet=function(set,_33,_34){var _35={type:"page",fullscreen:true,center_win:false};var _36=new GB_Sets(_35,set);_36.addCallback(_34);_36.showSet(_33-1);return false;};GB_showImageSet=function(set,_38,_39){var _3a={type:"image",fullscreen:false,center_win:true,width:300,height:300};var _3b=new GB_Sets(_3a,set);_3b.addCallback(_39);_3b.showSet(_38-1);return false;};GB_Sets=GB_Gallery.extend({init:function(_3c,set){this.parent(_3c);if(!this.img_next){this.img_next=this.root_dir+"next.gif";}
if(!this.img_prev){this.img_prev=this.root_dir+"prev.gif";}
this.current_set=set;},showSet:function(_3e){this.current_index=_3e;var _3f=this.current_set[this.current_index];this.show(_3f.url);this._setCaption(_3f.caption);this.btn_prev=AJS.IMG({"class":"left",src:this.img_prev});this.btn_next=AJS.IMG({"class":"right",src:this.img_next});AJS.AEV(this.btn_prev,"click",AJS.$b(this.switchPrev,this));AJS.AEV(this.btn_next,"click",AJS.$b(this.switchNext,this));GB_STATUS=AJS.SPAN({"class":"GB_navStatus"});AJS.ACN(AJS.$("GB_middle"),this.btn_prev,GB_STATUS,this.btn_next);this.updateStatus();},updateStatus:function(){AJS.setHTML(GB_STATUS,(this.current_index+1)+" / "+this.current_set.length);if(this.current_index==0){AJS.addClass(this.btn_prev,"disabled");}else{AJS.removeClass(this.btn_prev,"disabled");}
if(this.current_index==this.current_set.length-1){AJS.addClass(this.btn_next,"disabled");}else{AJS.removeClass(this.btn_next,"disabled");}},_setCaption:function(_40){AJS.setHTML(AJS.$("GB_caption"),_40);},updateFrame:function(){var _41=this.current_set[this.current_index];this._setCaption(_41.caption);this.url=_41.url;this.startLoading();},switchPrev:function(){if(this.current_index!=0){this.current_index--;this.updateFrame();this.updateStatus();}},switchNext:function(){if(this.current_index!=this.current_set.length-1){this.current_index++;this.updateFrame();this.updateStatus();}}});AJS.AEV(window,"load",function(){AJS.preloadImages(GB_ROOT_DIR+"next.gif",GB_ROOT_DIR+"prev.gif");});GB_show=function(_42,url,_44,_45,_46){var _47={caption:_42,height:_44||500,width:_45||500,fullscreen:false,callback_fn:_46};var win=new GB_Window(_47);return win.show(url);};GB_showCenter=function(_49,url,_4b,_4c,_4d){var _4e={caption:_49,center_win:true,height:_4b||500,width:_4c||500,fullscreen:false,callback_fn:_4d};var win=new GB_Window(_4e);return win.show(url);};GB_showFullScreen=function(_50,url,_52){var _53={caption:_50,fullscreen:true,callback_fn:_52};var win=new GB_Window(_53);return win.show(url);};GB_Window=GreyBox.extend({init:function(_55){this.parent({});this.img_header=this.root_dir+"header_bg.gif";this.img_close=this.root_dir+"w_close.gif";this.show_close_img=true;AJS.update(this,_55);this.addCallback(this.callback_fn);},initHook:function(){AJS.addClass(this.g_window,"GB_Window");this.header=AJS.TABLE({"class":"header"});this.header.style.backgroundImage="url("+this.img_header+")";var _56=AJS.TD({"class":"caption"},this.caption);var _57=AJS.TD({"class":"close"});if(this.show_close_img){var _58=AJS.IMG({"src":this.img_close});var _59=AJS.SPAN("Close");var btn=AJS.DIV(_58,_59);AJS.AEV([_58,_59],"mouseover",function(){AJS.addClass(_59,"on");});AJS.AEV([_58,_59],"mouseout",function(){AJS.removeClass(_59,"on");});AJS.AEV([_58,_59],"mousedown",function(){AJS.addClass(_59,"click");});AJS.AEV([_58,_59],"mouseup",function(){AJS.removeClass(_59,"click");});AJS.AEV([_58,_59],"click",GB_hide);AJS.ACN(_57,btn);}
tbody_header=AJS.TBODY();AJS.ACN(tbody_header,AJS.TR(_56,_57));AJS.ACN(this.header,tbody_header);AJS.ACN(this.top_cnt,this.header);if(this.fullscreen){AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this));}},setFrameSize:function(){if(this.fullscreen){var _5b=AJS.getWindowSize();overlay_h=_5b.h;this.width=Math.round(this.overlay.offsetWidth-(this.overlay.offsetWidth/100)*10);this.height=Math.round(overlay_h-(overlay_h/100)*10);}
AJS.setWidth(this.header,this.width+6);AJS.setWidth(this.iframe,this.width);AJS.setHeight(this.iframe,this.height);},setWindowPosition:function(){var _5c=AJS.getWindowSize();AJS.setLeft(this.g_window,((_5c.w-this.width)/2)-13);if(!this.center_win){AJS.setTop(this.g_window,AJS.getScrollTop());}else{var fl=((_5c.h-this.height)/2)-20+AJS.getScrollTop();if(fl<0){fl=0;}
AJS.setTop(this.g_window,fl);}}});AJS.preloadImages(GB_ROOT_DIR+"w_close.gif",GB_ROOT_DIR+"header_bg.gif");script_loaded=true;
