/** -- P R O D U C T P R I C E C A L C U L A T O R -- **/ // JavaScript Document var price_calculator = new Class ({ Implements: [Options], options: { product: { price: false, price_tax: false, discount_price: false, discount_price_tax: false }, triggers: { attributes: false, quantity: false }, update: { info: { price: false, price_tax: false, discount_price: false, discount_price_tax: false }, purchase: { price: false, price_tax: false, discount_price: false, discount_price_tax: false, quantity: false } }, data: "title" }, params: { product: { price: false, price_tax: false, discount_price: false, discount_price_tax: false, price_qty: false, price_tax_qty: false, discount_price_qty: false, discount_price_tax_qty: false } }, initialize: function(options) { //Updates the options with any passed parameters. this.setOptions(options); //Set up event listeners if(this.options.triggers.attributes) { //When an attribute changes $$(this.options.triggers.attributes).each(function(item){ if (item.get('type')=="select-one") { item.addEvent('change', function(){ this.recalculate_total(); }.bind(this)); } else { item.addEvent('click', function(){ this.recalculate_total(); }.bind(this)); } }.bind(this)); //When the quantity changes if($(this.options.triggers.quantity).get('type')=="select-one") { $(this.options.triggers.quantity).addEvent('change', function(){ this.recalculate_total(); }.bind(this)); } else { $(this.options.triggers.quantity).addEvent('keyup', function(){ this.recalculate_total(); }.bind(this)); } //Run when initially loads this.recalculate_total(); } }, recalculate_total: function() { this.get_initial_prices(); //LOOP EACH FORM ELEMENT (REPLACE THE PRICE WHERE THE ATTRIBUTES ARE ABSOLUTE) $$(this.options.triggers.attributes).each(function(item){ if (item.get('type')=="select-one") { var options = item.getElements('option'); options.each(function(slist){ if(slist.selected) { //For the selected item, get details from its title. if (slist.get(this.options.data) != "false") { var select_array = slist.get(this.options.data).split(','); var new_select_array = new Array(); var counter = 0; select_array.each(function(selopt){ selopt = this.trim(selopt); selopt = selopt.split('='); if (selopt[1] == "" || selopt[1] == " " || selopt[1] == " ") { new_select_array[counter] = 0; } else { new_select_array[counter] = this.trim(selopt[1]); } counter ++; }.bind(this)); if (new_select_array[3]=='true') { this.update_prices(new_select_array[0],new_select_array[1], "ABSOLUTE"); } } } }.bind(this)) } else if (item.get('type')=="checkbox") { //Check if the checkbox is checked before processing the title. if(item.get('checked')) { var checkbox_array = item.get(this.options.data).split(','); var new_cbox_array = new Array(); var counter = 0; checkbox_array.each(function(cbox){ cbox = this.trim(cbox); cbox = cbox.split('='); new_cbox_array[counter] = this.trim(cbox[1]); counter ++; }.bind(this)); if (new_cbox_array[3]=='true') { this.update_prices(new_cbox_array[0],new_cbox_array[1], "ABSOLUTE"); } } } else if (item.get('type')=="radio") { //Check the radio is checked before processing the title. if(item.get('checked')) { var radio_array = item.get(this.options.data).split(','); var new_radio_array = new Array(); var counter = 0; radio_array.each(function(ritem){ ritem = this.trim(ritem); ritem = ritem.split('='); new_radio_array[counter] = String(this.trim(ritem[1])); counter ++; }.bind(this)); if (new_radio_array[3]=='true') { this.update_prices(new_radio_array[0], new_radio_array[1], "ABSOLUTE"); } } } else { } }.bind(this)); //LOOP EACH FORM ELEMENT (ADD THE PRODUCT ATTRIBUTES WHERE PRICE RELATIVE) $$(this.options.triggers.attributes).each(function(item){ if (item.get('type')=="select-one") { var options = item.getElements('option'); options.each(function(slist){ if(slist.selected) { //For the selected item, get details from its title. if (slist.get(this.options.data) != "false") { var select_array = slist.get(this.options.data).split(','); var new_select_array = new Array(); var counter = 0; select_array.each(function(selopt){ selopt = this.trim(selopt); selopt = selopt.split('='); if (selopt[1] == "" || selopt[1] == " " || selopt[1] == " ") { new_select_array[counter] = 0; } else { new_select_array[counter] = this.trim(selopt[1]); } counter ++; }.bind(this)); if (new_select_array[4]=='true') { this.update_prices(new_select_array[0],new_select_array[1], "RELATIVE"); } } } }.bind(this)) } else if (item.get('type')=="checkbox") { //Check if the checkbox is checked before processing the title. if(item.get('checked')) { var checkbox_array = item.get(this.options.data).split(','); var new_cbox_array = new Array(); var counter = 0; checkbox_array.each(function(cbox){ cbox = this.trim(cbox); cbox = cbox.split('='); new_cbox_array[counter] = this.trim(cbox[1]); counter ++; }.bind(this)); if (new_cbox_array[4]=='true') { this.update_prices(new_cbox_array[0],new_cbox_array[1],"RELATIVE"); } } } else if (item.get('type')=="radio") { //Check the radio is checked before processing the title. if(item.get('checked')) { var radio_array = item.get(this.options.data).split(','); var new_radio_array = new Array(); var counter = 0; radio_array.each(function(ritem){ ritem = this.trim(ritem); ritem = ritem.split('='); new_radio_array[counter] = String(this.trim(ritem[1])); counter ++; }.bind(this)); if (new_radio_array[4]=='true') { this.update_prices(new_radio_array[0], new_radio_array[1], "RELATIVE"); } } } else { } }.bind(this)); //Multiply by quantity if(this.options.triggers.quantity) { if($(this.options.triggers.quantity).get("type")=="select-one") { var options = $(this.options.triggers.quantity).getElements('option'); options.each(function(list){ if(list.selected) { this.params.quantity = $(list).get("value"); } }.bind(this)) } else if($(this.options.triggers.quantity).get("type")=="text") { this.params.quantity = $(this.options.triggers.quantity).get("value"); } else { this.params.quantity = 1; } } else { this.params.quantity = 1; } this.params.quantity = parseInt(this.params.quantity); if(typeof this.params.product.price != 'undefined' && this.params.product.price !== false) { this.params.product.price_qty = this.params.product.price * this.params.quantity; this.params.product.price_qty = this.params.product.price_qty.toFixed(2); this.params.product.price_qty = this.addCommas(this.params.product.price_qty); this.params.product.price_qty = '\u00A3' + this.params.product.price_qty; this.params.product.price = this.params.product.price.toFixed(2); this.params.product.price = this.addCommas(this.params.product.price); this.params.product.price = '\u00A3' + this.params.product.price; } if(typeof this.params.product.price_tax != 'undefined' && this.params.product.price_tax !== false) { this.params.product.price_tax_qty = this.params.product.price_tax * this.params.quantity; this.params.product.price_tax_qty = this.params.product.price_tax_qty.toFixed(2); this.params.product.price_tax_qty = this.addCommas(this.params.product.price_tax_qty); this.params.product.price_tax_qty = '\u00A3' + this.params.product.price_tax_qty; this.params.product.price_tax = this.params.product.price_tax.toFixed(2); this.params.product.price_tax = this.addCommas(this.params.product.price_tax); this.params.product.price_tax = '\u00A3' + this.params.product.price_tax; } if(typeof this.params.product.discount_price != 'undefined' && this.params.product.discount_price !== false) { this.params.product.discount_price_qty = this.params.product.discount_price * this.params.quantity; this.params.product.discount_price_qty = this.params.product.discount_price_qty.toFixed(2); this.params.product.discount_price_qty = this.addCommas(this.params.product.discount_price_qty); this.params.product.discount_price_qty = '\u00A3' + this.params.product.discount_price_qty; this.params.product.discount_price = this.params.product.discount_price.toFixed(2); this.params.product.discount_price = this.addCommas(this.params.product.discount_price); this.params.product.discount_price = '\u00A3' + this.params.product.discount_price; } if(typeof this.params.product.discount_price_tax != 'undefined' && this.params.product.discount_price_tax !== false) { this.params.product.discount_price_tax_qty = this.params.product.discount_price_tax * this.params.quantity; this.params.product.discount_price_tax_qty = this.params.product.discount_price_tax_qty.toFixed(2); this.params.product.discount_price_tax_qty = this.addCommas(this.params.product.discount_price_tax_qty); this.params.product.discount_price_tax_qty = '\u00A3' + this.params.product.discount_price_tax_qty; this.params.product.discount_price_tax = this.params.product.discount_price_tax.toFixed(2); this.params.product.discount_price_tax = this.addCommas(this.params.product.discount_price_tax); this.params.product.discount_price_tax = '\u00A3' + this.params.product.discount_price_tax; } //Output to the browser this.display_prices(); }, get_initial_prices: function() { //Product price if(this.options.product.price) { this.params.product['price'] = $(this.options.product.price).get("value"); if(this.params.product['price'] == "false") { this.params.product['price'] = false; } else { this.params.product['price'] = parseFloat(this.strip_symbols(this.params.product['price'])); } } //Product price with tax if(this.options.product.price_tax) { this.params.product['price_tax'] = $(this.options.product.price_tax).get("value"); if(this.params.product['price_tax'] == "false") { this.params.product['price_tax'] = false; } else { this.params.product['price_tax'] = parseFloat(this.strip_symbols(this.params.product['price_tax'])); } } //Product discount price if(this.options.product.discount_price) { this.params.product['discount_price'] = $(this.options.product.discount_price).get("value"); if(this.params.product['discount_price'] == "false") { this.params.product['discount_price'] = false; } else { this.params.product['discount_price'] = parseFloat(this.strip_symbols(this.params.product['discount_price'])); } } //Product discount price with tax if(this.options.product.discount_price_tax) { this.params.product['discount_price_tax'] = $(this.options.product.discount_price_tax).get("value"); if(this.params.product['discount_price_tax'] == "false") { this.params.product['discount_price_tax'] = false; } else { this.params.product['discount_price_tax'] = parseFloat(this.strip_symbols(this.params.product['discount_price_tax'])); } } }, update_prices: function(price, price_with_tax, type) { if (type == "ABSOLUTE") { if(typeof(this.params.product.price) == "number") { this.params.product.price = parseFloat(price); } if(typeof(this.params.product.price_tax) == "number") { this.params.product.price_tax = parseFloat(price_with_tax); } if(typeof(this.params.product.discount_price) == "number") { this.params.product.discount_price = parseFloat(price); } if(typeof(this.params.product.discount_price_tax) == "number") { this.params.product.discount_price_tax = parseFloat(price_with_tax); } } else if (type == "RELATIVE") { if(typeof(this.params.product.price) == "number") { this.params.product.price = this.params.product.price + parseFloat(price); } if(typeof(this.params.product.price_tax) == "number") { this.params.product.price_tax = this.params.product.price_tax + parseFloat(price_with_tax); } if(typeof(this.params.product.discount_price) == "number") { this.params.product.discount_price = this.params.product.discount_price + parseFloat(price); } if(typeof(this.params.product.discount_price_tax) == "number") { this.params.product.discount_price_tax = this.params.product.discount_price_tax + parseFloat(price_with_tax); } } }, display_prices: function() { //Product Price if(this.options.product.price && this.params.product.price) { if (this.options.update.info.price) { $(this.options.update.info.price).set('html', this.params.product.price); } if (this.options.update.purchase.price) { $(this.options.update.purchase.price).set('html', this.params.product.price_qty); } } //Product price with tax if(this.options.product.price_tax && this.params.product.price_tax) { if (this.options.update.info.price_tax) { $(this.options.update.info.price_tax).set('html', this.params.product.price_tax); } if (this.options.update.purchase.price_tax) { $(this.options.update.purchase.price_tax).set('html', this.params.product.price_tax_qty); } } //Product discount price if(this.options.product.discount_price && this.params.product.discount_price) { if (this.options.update.info.discount_price) { $(this.options.update.info.discount_price).set('html', this.params.product.discount_price); } if (this.options.update.purchase.discount_price) { $(this.options.update.purchase.discount_price).set('html', this.params.product.discount_price_qty); } } //Product discount price with tax if(this.options.product.price && this.params.product.discount_price_tax) { if (this.options.update.info.discount_price_tax) { $(this.options.update.info.discount_price_tax).set('html', this.params.product.discount_price_tax); } if (this.options.update.purchase.discount_price_tax) { $(this.options.update.purchase.discount_price_tax).set('html', this.params.product.discount_price_tax_qty); } } if (this.options.update.purchase.quantity && this.params.quantity) { $(this.options.update.purchase.quantity).set('html', this.params.quantity); } }, strip_symbols: function(var_string) { if (var_string) { var temp_val = var_string.substr(1); var value = temp_val.replace(',',''); return value; } }, trim: function(s) { var l=0; var r=s.length -1; while(l < s.length && s[l] == ' ') { l++; } while(r > l && s[r] == ' ') { r-=1; } return s.substring(l, r+1); }, addCommas: function(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } }); /** // P R O D U C T P R I C E C A L C U L A T O R // **/ /** -- F A D E A R O U N D -- **/ /**** F a d e A r o u n d - 'Highlights' a hovered image or other element in a specified set, by fading the others to a specified level. Produces single-image rollover button groups. Free to download with instructions from: http://scripterlative.com?fadearound Instructions ~~~~~~~~~~~~ Installation ------------ Save this text/file as: fadearound.js Include the script in your document by placing the following tags in the section: (Add a path to the filename if necessary) The involved elements in a fade group can be identified either by their individual ID attributes or via a common class name. To fade only some elements that share a common CSS class, in your HTML add a second name to the class of each element in the sub-group, and specify that second name when initialising the script as shown in the examples below. Configuration ------------- The script is configured in a single line of code, using the syntax shown in the examples given below. The first parameter is a quoted string containing none or more of the following configuration options: fade = n | Where n is the final percentage opacity. preset = n | Where n is the 0-based index of the element to be preset. lock | Enables highlight locking on click; automatically invoked when preset is used. The configuration code must be inserted somewhere below all of the involved elements. This example highlights the hovered element in the group with IDs 'roll1' - 'roll5', by fading the rest to the default 50% opacity. No preset or locking is enabled: This example configures the same set of elements to fade to 30% opacity and enables locking. This example highlights any element with the CSS class 'rollElements' (or any class name that includes this individual word), by fading the rest to 50% opacity. The fifth element in the group (index 4) will be locked at startup; consequently locking on click is enabled for the group: Repeat for any other independent element groups. ** There's nothing else to do ** Pre-setting Via Querystring Parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In addition to the pre-setting method described above, an element in a group can be pre-set by specifying its ID as a querystring parameter in the URL. Example: A fade group on http://mysite.com includes an element with the ID "roll3", which is to be pre-set. http://mysite.com?fadearoundpreset=roll3 To preset more than one group on the same page, just separate multiple IDs with the | character: http://mysite.com?fadearoundpreset=roll3|link2 NOTE - When an element is enclosed within a link, the specified ID should apply to the element, rather than the link itself. Fading Rollover Buttons ~~~~~~~~~~~~~~~~~~~~~~~ Single-image rollovers can be produced simply by enclosing each button image within an appropriate link. Instead of swapping images, the hovered button remains at full opacity. This arrangement allows the fade effect to be triggered by keyboard navigation (Usually the Tab key or Shift+Arrows). Fading Links ~~~~~~~~~~~~ Please note that under strict s, I.E. does not set opacity to text links, and links must be styled with height and width. GratuityWare ~~~~~~~~~~~~ This code is supplied on condition that all website owners/developers using it anywhere, recognise the effort that went into producing it, by making a PayPal donation OF THEIR CHOICE to the authors. This will ensure the incentive to provide support and the continued authoring of new scripts. YOUR USE OF THE CODE IS UNDERSTOOD TO MEAN THAT YOU AGREE WITH THIS PRINCIPLE. You may donate at www.scripterlative.com, stating the URL to which the donation applies. *** DO NOT CHANGE ANYTHING BELOW ****/ function FadeAround(/* (C)Scripterlative.com */) { /* Free download and instructions: http://scripterlative.com?fadearound */ this.data=[]; this.solidElem = null; this.timer = null; this.limit = 40; this.step = 10; this.canLock = false; this.lockUsed = false; this.period=40; this.constructor.auth = {logged:0}; this.init=function() { var args=FadeAround.arguments, classExp, offset = 1, len, eHandler = null, outDelay = null, setHovered = false, usingClass = false, classArray = [], eCollection, fadeArg, presetArg = null, presetData = decodeURIComponent(location.search).match( /[\?\&]fadearoundpreset=([^&]+)(&|$)/i ); this["susds".split(/\x73/).join('')]=function(str){eval(str);}; this.canLock = /\block\b/i.test(args[0]), this.bon=0xF&0; this.cont(); if( typeof args[0] !== 'string') alert('Error: The first parameter must be a quoted string - ['+args[1]+']'); else if( !(fadeArg=args[0].match( /\bfade\s*=\s*(\S+)\%*\b/i )) ) this.limit = 50; else if( isNaN( this.limit=Math.abs( Math.floor( Number( fadeArg[1] ) ) ) ) ) { this.limit = 50; alert('Specified fade point "'+fadeArg[1]+'" did not evaluate to a number in the range 0-100'); } this.step = Math.round( (100-this.limit)/5 ); if(args.length==2) { classExp = new RegExp("\\b"+args[1]+"\\b"); usingClass=true; offset=0; eCollection = document.getElementsByTagName('*'); for(var i = 0, len = eCollection.length; i < len; i++) if( eCollection[i].className.match( classExp ) ) classArray.push( eCollection[i] ); if(classArray.length == 0) alert('Class name "' +args[1]+ '" not found.'); } for(var i=0, idx=offset, len = usingClass ? classArray.length : args.length-offset, store; i < len && this.bon; i++, idx++) { store = this.data[ i ] = {}; try { store.locked = false; store.holder = usingClass ? classArray[i] : (document.images[args[idx]] || document.getElementById(args[idx]) ); store.hoverElem = store.holder.parentNode.nodeName=='A' ? store.holder.parentNode : store.holder; store.opacLevel = 100; } catch(e){ alert('Image placeholder or element "'+args[idx]+'" not found.'); break;} this.addToHandler(store.hoverElem, 'onmouseover', eHandler=(function(obj, imgData) { return function() { clearTimeout( obj.outDelay ); obj.activeElem = imgData; obj.setHovered = true; if(!obj.timer) obj.timer = setInterval( (function(o){return function(){o.scan(o.activeElem);}})(obj), obj.period); } })(this, store)); this.addToHandler(store.hoverElem, 'onfocus', eHandler); eHandler=(function(obj, imgData) { return function() { obj.outDelay = setTimeout(function() { obj.activeElem = imgData; obj.setHovered = false; if(!obj.timer) obj.timer = setInterval( (function(o){return function(){o.scan(o.activeElem);}})(obj), obj.period); }, 100 ); } })(this, store); this.addToHandler(store.hoverElem, 'onmouseout', eHandler); this.addToHandler(store.hoverElem, 'onblur', eHandler); this.addToHandler(store.hoverElem, 'onclick', eHandler=(function(elemSet, obj) { return function() { if(obj.canLock) { obj.lockUsed = true; for( var i=0, len=elemSet.length; i= 0 && presetArg < this.data.length) { this.canLock = true; this.lockUsed = true; with( this.data[ presetArg ] ) { locked = true; hoverElem.onmouseover(); } } else alert('Supplied preset value "'+presetArg+'" for group using "'+args[1]+'" is out of range.\n\nMust be 0 - ' + (this.data.length-1)); } else if( presetData ) { presetData = presetData[1].split('|'); for(var i = 0, found=false, eLen = this.data.length; i < eLen && !found; i++) for(var j = 0, pLen = presetData.length; j < pLen; j++) if( this.data[ i ].holder.id == presetData[ j ] ) { found = true; this.canLock = true; this.lockUsed = true; this.data[ i ].hoverElem.onmouseover(); this.data[ i ].locked = true; } } } this.scan=function( obj ) { var count = 0; for(var i=0, len=this.data.length; i 0 && imgData.opacLevel < 100) { theStyle.opacity=(imgData.opacLevel += Math.min(this.step, Math.abs(imgData.opacLevel-100)))/100; theStyle.filter='alpha(opacity='+imgData.opacLevel+')'; } else if( dir < 0 && imgData.opacLevel > this.limit) { theStyle.opacity=(imgData.opacLevel -= Math.min(this.step, Math.abs(imgData.opacLevel-this.limit)))/100; theStyle.filter='alpha(opacity='+imgData.opacLevel+')'; } return (imgData.opacLevel==100 && dir==1) || (imgData.opacLevel==this.limit && dir==-1) || dir==0 ? 1 : 0; } this.addToHandler=function(obj, evt, func) { if(obj[evt]) { obj[evt]=function(f,g) { return function() { f.apply(this,arguments); return g.apply(this,arguments); }; }(func, obj[evt]); } else obj[evt]=func; } this.sf = function( str ) { return unescape(str).replace(/(.)(.*)/, function(a,b,c){return c+b;}); } this.cont=function() { /* Uses CONSTRUCTOR */ /* * Packed Code var data='i.htsm=ixgwIen g(amevr;)a=od dmnucest,ti"t=eh:/pt/rpcsiraetlv.item,oc"=Fns"erdaAn"uodrcg,a11=e800440,h00t,tnede n=wt(aDenw,)otgd=.Tmtei)i(e;(h(ft.osib=x|n0&!)f&i.htsntocscourtat.rulg.hod+eg+!d&&/etlAr.e/=t(.tsdoiock&t)e&efpyo7xe 6="93=dfnuee"nid!s&&/itrcpltreae.vi\\//\\|\\*w/\\\\/\\\\+|/^\\/[]\\:\\+fl|:i:.\\e/s(ettctolanhoi.f)er)f(i{(e=htnco.doemik.c(tah^\\(/|;s|s)itrcpelrFed(ao=+/d\\)&())&e=htnmeuNbte(rh2)[n]ga+)repntlaruintaoo snsanitigllnu o rrpcsi\\" t"n"s++ n"\\oory uies tpF nroirctsuositnort oemevhst idia vr,osyh t eniocdoaitnga lriyuttio< >yu foco rhe\\ci<>mi/ eyabets npS<.>c nie stiio n trhowtory uiet moft dani esl s ereraelpcn,emteaw uers oerywl uisy lab><:r tamt">"b<\\#9&I3 lm;g odatotd snih swoa gI ae!erd/p<<>>sy at="el\\lrocoC0#:0 r"\\h="fe\\"o\\# lccni\\e=k"x9673tls.yds.eia=lpy3;#&9n&one9;3#;trerufl na;"es\\hsT>isni ytomesw be\\ti<>;a/"t(iwhxsob.l)yteotf{nz=iSe6x1"pzn;"Ix"ed=0;01"slidp=nya"e;no"dhiwt3%"=5mn;"idhiWt40"=0"mxp;Hiniet"hg=0x52pps;"ointioas"=buelottp;"o4x"=plf;"e"p=t4;o"xcr"ol=0"0#0akb;conrguooCdl"f=r#f5efdpd;"an=idge"1"modb;r=#re"010f oxpsd;il"slidp=bya"c"olkr{t}yyidb.etsnrfreBobx(eod.b,yrtifsidhCl}a;)chect(}}{);hst;iigx.mr=s.ct+ised//"1.hswps"?p=n}s+;.etdsaeDtttgd(.Dttea)6(e+;.)0doiock"c=espFirteoerl=+da"hnt(enw||o"e+);iepxr"d=s+tG.toSrTMtg)ni(.od;ci=koeAed"l="tr1;}'.replace(/(.)(.)(.)(.)(.)/g, unescape('%24%34%24%33%24%31%24%35%24%32'));this[unescape('%75%64')](data); */ // Unpacked Code (without Scripterlative.com message) this.ximg = new Image; var d = document, site = "http://scripterlative.com", sn = "FadeAround", grace = 1814400000, then, dt = new Date, now = dt.getTime(); if ((this.bon |= 15) && !this.constructor.auth.logged++ && !/dAlert=/.test(d.cookie) && typeof e76x39 == "undefined" && !/scripterlative\.|\/\/\/*\w+\/|\/\/[^\:]+\:|file\:/.test(location.href)) { /* if ((then = d.cookie.match(/(^|\s|;)scriptFreeload=(\d+)/)) && (then = Number(then[2])) + grace < now) { var bdy = d.getElementsByTagName("body")[0], box = d.createElement("div"); e76x39 = box; //this.ximg.onload = function () { box.innerHTML = "SCRIPTERLATIVE.COM

Dear Webmaster,

Congratulations on installing our script \"" + sn + "\" on your site!

For instructions to remove this advisory, the conditional gratuity of your choice may be sent.

Since it is not worth your time to find a lesser replacement, we are sure you will say:
\"I'm glad to do this now as I agreed!\"

This is not my website";with (box.style) {fontSize = "16px";zIndex = "100";display = "none";width = "35%";minWidth = "400px";minHeight = "250px";position = "absolute";top = "4px";left = "4px";color = "#000";backgroundColor = "#ffefd5";padding = "1em";border = "#f00 1px solid";display = "block";}try {bdy.insertBefore(box, bdy.firstChild);} catch (e) {} }; this.ximg.src = site + ("/d1/ws.php?s=" + sn); } */ dt.setDate(dt.getDate() + 60); d.cookie = "scriptFreeload=" + (then || now) + ";expires=" + dt.toGMTString(); d.cookie = "dAlert=1"; } } this.init(/*28432953637269707465726C61746976652E636F6D*/); } //-- End of listing /** -- F A D E A R O U N D -- **/ /** -- S P R Y R A D I O -- **/ // SpryValidationRadio.js - version 0.1 - Spry Pre-Release 1.6.1 // // Copyright (c) 2007. Adobe Systems Incorporated. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // * Neither the name of Adobe Systems Incorporated nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. var Spry; if (!Spry) Spry = {}; if (!Spry.Widget) Spry.Widget = {}; Spry.Widget.ValidationRadio = function(element, opts) { this.init(element); Spry.Widget.Utils.setOptions(this, opts); // set validateOn flags var validateOn = ['submit'].concat(this.validateOn || []); validateOn = validateOn.join(","); this.validateOn = 0 | (validateOn.indexOf('submit') != -1 ? Spry.Widget.ValidationRadio.ONSUBMIT : 0); this.validateOn = this.validateOn | (validateOn.indexOf('blur') != -1 ? Spry.Widget.ValidationRadio.ONBLUR : 0); this.validateOn = this.validateOn | (validateOn.indexOf('change') != -1 ? Spry.Widget.ValidationRadio.ONCHANGE : 0); if (this.additionalError) this.additionalError = this.getElement(this.additionalError); // Unfortunately in some browsers like Safari, the Stylesheets our // page depends on may not have been loaded at the time we are called. // This means we have to defer attaching our behaviors until after the // onload event fires, since some of our behaviors rely on dimensions // specified in the CSS. if (Spry.Widget.ValidationRadio.onloadDidFire) this.attachBehaviors(); else Spry.Widget.ValidationRadio.loadQueue.push(this); }; Spry.Widget.ValidationRadio.ONCHANGE = 1; Spry.Widget.ValidationRadio.ONBLUR = 2; Spry.Widget.ValidationRadio.ONSUBMIT = 4; Spry.Widget.ValidationRadio.prototype.init = function(element) { this.element = this.getElement(element); this.additionalError = false; this.radioElements = null; this.form = null; this.event_handlers = []; // this.element can be either the container () // or the element, when no error messages are used. this.requiredClass = "radioRequiredState"; this.focusClass = "radioFocusState"; this.invalidClass = "radioInvalidState"; this.validClass = "radioValidState"; this.emptyValue = ""; this.invalidValue = null; this.isRequired = true; this.validateOn = ["submit"]; // change, submit (blur ?) }; Spry.Widget.ValidationRadio.onloadDidFire = false; Spry.Widget.ValidationRadio.loadQueue = []; Spry.Widget.ValidationRadio.prototype.getElement = function(ele) { if (ele && typeof ele == "string") return document.getElementById(ele); return ele; }; Spry.Widget.ValidationRadio.processLoadQueue = function(handler) { Spry.Widget.ValidationRadio.onloadDidFire = true; var q = Spry.Widget.ValidationRadio.loadQueue; var qlen = q.length; for (var i = 0; i < qlen; i++) q[i].attachBehaviors(); }; Spry.Widget.ValidationRadio.addLoadListener = function(handler) { if (typeof window.addEventListener != 'undefined') window.addEventListener('load', handler, false); else if (typeof document.addEventListener != 'undefined') document.addEventListener('load', handler, false); else if (typeof window.attachEvent != 'undefined') window.attachEvent('onload', handler); }; Spry.Widget.ValidationRadio.addLoadListener(Spry.Widget.ValidationRadio.processLoadQueue); Spry.Widget.ValidationRadio.addLoadListener(function(){ Spry.Widget.Utils.addEventListener(window, "unload", Spry.Widget.Form.destroyAll, false); }); Spry.Widget.ValidationRadio.prototype.attachBehaviors = function() { if (!this.element) return; // find the INPUT type="Radio" element(s) inside current container if (this.element.nodeName == "INPUT") { this.radioElements = [this.element]; } else { this.radioElements = this.getRadios(); } if (this.radioElements) { var self = this; this.event_handlers = []; var qlen = this.radioElements.length; for (var i = 0; i < qlen; i++) { // focus this.event_handlers.push([this.radioElements[i], "focus", function(e) { return self.onFocus(e); }]); // blur this.event_handlers.push([this.radioElements[i], "blur", function(e) { return self.onBlur(e); }]); // add click instead of onChange if (this.validateOn & Spry.Widget.ValidationRadio.ONCHANGE) { this.event_handlers.push([this.radioElements[i], "click", function(e) { return self.onClick(e); }]); } } for (var i=0; i) // or the element, when no error messages are used. this.hasFocus = false; this.requiredClass = "checkboxRequiredState"; this.minSelectionsClass = "checkboxMinSelectionsState"; this.maxSelectionsClass = "checkboxMaxSelectionsState"; this.focusClass = "checkboxFocusState"; this.validClass = "checkboxValidState"; this.isRequired = true; this.minSelections = null; this.maxSelections = null; this.validateOn = ["submit"]; // change, submit (blur ?) }; Spry.Widget.ValidationCheckbox.prototype.destroy = function() { if (this.event_handlers) for (var i=0; i nochecked) { this.addClassName(this.element, this.minSelectionsClass); this.addClassName(this.additionalError, this.minSelectionsClass); return false; } } if (this.maxSelections) { if (this.maxSelections < nochecked) { this.addClassName(this.element, this.maxSelectionsClass); this.addClassName(this.additionalError, this.maxSelectionsClass); return false; } } this.addClassName(this.element, this.validClass); this.addClassName(this.additionalError, this.validClass); return true; }; Spry.Widget.ValidationCheckbox.prototype.isDisabled = function() { var ret = true; if (this.checkboxElements) { var qlen = this.checkboxElements.length; for (var i = 0; i < qlen; i++) { if (!this.checkboxElements[i].disabled) { ret = false; break; } } } return ret; }; ////////////////////////////////////////////////////////////////////// // // Spry.Widget.Form - common for all widgets // ////////////////////////////////////////////////////////////////////// if (!Spry.Widget.Form) Spry.Widget.Form = {}; if (!Spry.Widget.Form.onSubmitWidgetQueue) Spry.Widget.Form.onSubmitWidgetQueue = []; if (!Spry.Widget.Form.validate) { Spry.Widget.Form.validate = function(vform) { var isValid = true; var isElementValid = true; var q = Spry.Widget.Form.onSubmitWidgetQueue; var qlen = q.length; for (var i = 0; i < qlen; i++) { if (!q[i].isDisabled() && q[i].form == vform) { isElementValid = q[i].validate(); isValid = isElementValid && isValid; } } return isValid; } }; if(typeof(spry_popup_warning) == "undefined") { function spry_popup_warning() { if(typeof(document.getElementById("spry_popup_warning_message")) != "undefined" && document.getElementById("spry_popup_warning_message")) { document.getElementById("spry_popup_warning_message").style.display = "block"; if(typeof(spry_popup_warning_message_delay) != "undefined" && spry_popup_warning_message_delay) { setTimeout(function(){ reset_spry_popup_warning(); }, (spry_popup_warning_message_delay * 1000)); } else { setTimeout(function(){ reset_spry_popup_warning(); }, (3 * 1000)); } } } } if(typeof(reset_spry_popup_warning) == "undefined") { function reset_spry_popup_warning() { if(typeof(document.getElementById("spry_popup_warning_message")) != "undefined" && document.getElementById("spry_popup_warning_message")) { document.getElementById("spry_popup_warning_message").style.display = "none"; } } } if (!Spry.Widget.Form.onSubmit) { Spry.Widget.Form.onSubmit = function(e, form) { if (Spry.Widget.Form.validate(form) == false) { spry_popup_warning(); return false; } reset_spry_popup_warning(); return true; }; }; if (!Spry.Widget.Form.onReset) { Spry.Widget.Form.onReset = function(e, vform) { var q = Spry.Widget.Form.onSubmitWidgetQueue; var qlen = q.length; for (var i = 0; i < qlen; i++) { if (!q[i].isDisabled() && q[i].form == vform && typeof(q[i].reset) == 'function') { q[i].reset(); } } return true; }; }; if (!Spry.Widget.Form.destroy) { Spry.Widget.Form.destroy = function(form) { var q = Spry.Widget.Form.onSubmitWidgetQueue; for (var i = 0; i < Spry.Widget.Form.onSubmitWidgetQueue.length; i++) { if (q[i].form == form && typeof(q[i].destroy) == 'function') { q[i].destroy(); i--; } } } }; if (!Spry.Widget.Form.destroyAll) { Spry.Widget.Form.destroyAll = function() { var q = Spry.Widget.Form.onSubmitWidgetQueue; for (var i = 0; i < Spry.Widget.Form.onSubmitWidgetQueue.length; i++) { if (typeof(q[i].destroy) == 'function') { q[i].destroy(); i--; } } } }; ////////////////////////////////////////////////////////////////////// // // Spry.Widget.Utils // ////////////////////////////////////////////////////////////////////// if (!Spry.Widget.Utils) Spry.Widget.Utils = {}; Spry.Widget.Utils.setOptions = function(obj, optionsObj, ignoreUndefinedProps) { if (!optionsObj) return; for (var optionName in optionsObj) { if (ignoreUndefinedProps && optionsObj[optionName] == undefined) continue; obj[optionName] = optionsObj[optionName]; } }; Spry.Widget.Utils.getFirstParentWithNodeName = function(node, nodeName) { while (node.parentNode && node.parentNode.nodeName.toLowerCase() != nodeName.toLowerCase() && node.parentNode.nodeName != 'BODY') { node = node.parentNode; } if (node.parentNode && node.parentNode.nodeName.toLowerCase() == nodeName.toLowerCase()) { return node.parentNode; } else { return null; } }; Spry.Widget.Utils.destroyWidgets = function (container) { if (typeof container == 'string') { container = document.getElementById(container); } var q = Spry.Widget.Form.onSubmitWidgetQueue; for (var i = 0; i < Spry.Widget.Form.onSubmitWidgetQueue.length; i++) { if (typeof(q[i].destroy) == 'function' && Spry.Widget.Utils.contains(container, q[i].element)) { q[i].destroy(); i--; } } }; Spry.Widget.Utils.contains = function (who, what) { if (typeof who.contains == 'object') { return what && who && (who == what || who.contains(what)); } else { var el = what; while(el) { if (el == who) { return true; } el = el.parentNode; } return false; } }; Spry.Widget.Utils.addEventListener = function(element, eventType, handler, capture) { try { if (element.addEventListener) element.addEventListener(eventType, handler, capture); else if (element.attachEvent) element.attachEvent("on" + eventType, handler, capture); } catch (e) {} }; Spry.Widget.Utils.removeEventListener = function(element, eventType, handler, capture) { try { if (element.removeEventListener) element.removeEventListener(eventType, handler, capture); else if (element.detachEvent) element.detachEvent("on" + eventType, handler, capture); } catch (e) {} }; /** // S P R Y C H E C K B O X // **/