webglade

JavaScript library to dynamically create XUL GUI from Glade XML files
git clone https://logand.com/git/webglade.git/
Log | Files | Refs | README | LICENSE

ProductLineController.js (30052B)


      1 /**
      2 *
      3 *
      4 * @FileName: ProductLineController.js
      5 * @$LastChangedDate: 2004-07-04 19:24:15 +0200 (Sun, 04 Jul 2004) $
      6 * @Author: Fabio Serra AKA Faser - faser@faser.net
      7 * @Copyright: Fabio Serra
      8 * @Licenze: MPL 1.1
      9 *
     10 */
     11 
     12 function ProductLineController() {
     13 	//reference to the GUI element
     14 	this.elLocale = document.getElementById('locale-popup');
     15 	this.elCatalog = document.getElementById('mode-popup');
     16 	this.elSearch = document.getElementById('search-popup');
     17 	this.elSort = document.getElementById('sort-popup');
     18 
     19 	//Base Object to store different Product Line Object
     20 	this.myProductLine = {};
     21 
     22 }
     23 
     24 //Update the product line toolbar
     25 ProductLineController.prototype.update = function () {
     26 	var locale = this.elLocale.selectedItem.getAttribute('value');
     27 	if(typeof this.myProductLine[locale] == "undefined") {
     28 		this.myProductLine[locale] = new ProductLine();
     29 
     30 		switch(locale)  {
     31 			case "us":
     32 				this.createProductLineUS(this.myProductLine[locale]);
     33 				break;
     34 			case "uk":
     35 				this.createProductLineUK(this.myProductLine[locale]);
     36 				break;
     37 			case "de":
     38 				this.createProductLineDE(this.myProductLine[locale]);
     39 				break;
     40 			case "fr":
     41 				this.createProductLineFR(this.myProductLine[locale]);
     42 				break;
     43 			case "ca":
     44 				this.createProductLineCA(this.myProductLine[locale]);
     45 				break;
     46 			case "jp":
     47 				this.createProductLineJP(this.myProductLine[locale]);
     48 				break;
     49 		}
     50 	}
     51 
     52 	this.checkCatalog(locale);
     53 	this.checkSearch(locale);
     54 	this.checkSort(locale);
     55 }
     56 
     57 //Check valid catalog for defined locale
     58 ProductLineController.prototype.checkCatalog = function(locale) {
     59 	var catalogItem = this.elCatalog.getElementsByTagName('menuitem');
     60 	for(var i=0;i<catalogItem.length;i++) {
     61 		if(!this.myProductLine[locale].isValidProductLine(catalogItem[i].value)) {
     62 			catalogItem[i].setAttribute('disabled','true');
     63 		}else{
     64 			catalogItem[i].setAttribute('disabled','false');
     65 		}
     66 	}
     67 }
     68 
     69 //Check valid search for defined locale
     70 ProductLineController.prototype.checkSearch = function(locale) {
     71 	var currentCatalog = this.elCatalog.selectedItem.getAttribute('value');
     72 	var searchItem = this.elSearch.getElementsByTagName('menuitem');
     73 	for(var i=0;i<searchItem.length;i++) {
     74 		if(!this.myProductLine[locale].isValidSearchType(currentCatalog,searchItem[i].value)) {
     75 			searchItem[i].setAttribute('disabled','true');
     76 		}else{
     77 			searchItem[i].setAttribute('disabled','false');
     78 		}
     79 	}
     80 }
     81 
     82 //Check valid sort for defined locale
     83 ProductLineController.prototype.checkSort = function(locale) {
     84 	var currentCatalog = this.elCatalog.selectedItem.getAttribute('value');
     85 	var sortItem = this.elSort.getElementsByTagName('menuitem');
     86 	for(var i=0;i<sortItem.length;i++) {
     87 		if(!this.myProductLine[locale].isValidSort(currentCatalog,sortItem[i].value)) {
     88 			sortItem[i].setAttribute('disabled','true');
     89 		}else{
     90 			sortItem[i].setAttribute('disabled','false');
     91 		}
     92 	}
     93 }
     94 
     95 //Return the selected locale if enabled
     96 ProductLineController.prototype.getLocale = function() {
     97 	var disabled = this.elLocale.selectedItem.getAttribute('disabled');
     98 	if(disabled == "false") {
     99 		return this.elLocale.selectedItem.getAttribute('value');
    100 	}else{
    101 		return false;
    102 	}
    103 }
    104 
    105 
    106 //Return catalog value if the item is not been disabled
    107 ProductLineController.prototype.getCatalog = function() {
    108 	var disabled = this.elCatalog.selectedItem.getAttribute('disabled');
    109 	if(disabled == "false") {
    110 		return this.elCatalog.selectedItem.getAttribute('value');
    111 	}else{
    112 		return false;
    113 	}
    114 }
    115 
    116 ProductLineController.prototype.getCatalogValue = function() {
    117 	var locale = this.getLocale();
    118 	var key = this.getCatalog();
    119 	if(!key || !locale) {
    120 		return false;
    121 	}else{
    122 		return this.myProductLine[locale].getCatalogValue(key);
    123 	}
    124 }
    125 
    126 
    127 
    128 //Return search value if the item is not been disabled
    129 ProductLineController.prototype.getSearch = function() {
    130 	var disabled = this.elSearch.selectedItem.getAttribute('disabled');
    131 	if(disabled == "false") {
    132 		return this.elSearch.selectedItem.getAttribute('value');
    133 	}else{
    134 		return false;
    135 	}
    136 }
    137 
    138 //Return sort if the item is not been disabled
    139 ProductLineController.prototype.getSort = function() {
    140 	var disabled = this.elSort.selectedItem.getAttribute('disabled');
    141 	if(disabled == "false") {
    142 		return this.elSort.selectedItem.getAttribute('value');
    143 	}else{
    144 		return false;
    145 	}
    146 }
    147 
    148 ProductLineController.prototype.getSortValue = function() {
    149 	var locale = this.getLocale();
    150 	var catalogKey = this.getCatalog();
    151 	var sortKey = this.getSort();
    152 	if(!locale || !catalogKey || !sortKey) {
    153 		return false
    154 	}else{
    155 		return this.myProductLine[locale].getSortValue(catalogKey,sortKey);
    156 	}
    157 }
    158 
    159 
    160 
    161 //Create the objetc for the provided locale
    162 //Amazon.com
    163 ProductLineController.prototype.createProductLineUS = function(obj) {
    164 	//Blended
    165 	obj.addCatalog('blended','blended');
    166 	obj.addSearchType('blended','KeywordSearch');
    167 	obj.addSort('blended','+salesrank','+salesrank');
    168 	//Books
    169 	obj.addCatalog('books','books');
    170 	obj.addSearchType('books','KeywordSearch,AsinSearch,AuthorSearch,ManufacturerSearch,UpcSearch');
    171 	obj.addSort('books','+pmrank','+pmrank');
    172 	obj.addSort('books','+salesrank','+salesrank');
    173 	obj.addSort('books','+reviewrank','+reviewrank');
    174 	obj.addSort('books','+pricerank','+pricerank');
    175 	obj.addSort('books','+inverse-pricerank','+inverse-pricerank');
    176 	obj.addSort('books','+daterank','+daterank');
    177 	obj.addSort('books','+titlerank','+titlerank');
    178 	obj.addSort('books','-titlerank','-titlerank');
    179 	//Magazines
    180 	obj.addCatalog('magazines','magazines');
    181 	obj.addSearchType('magazines','KeywordSearch,AsinSearch');
    182 	obj.addSort('magazines','+salesrank','+salesrank');
    183 	//Popular Music
    184 	obj.addCatalog('music','music');
    185 	obj.addSearchType('music','KeywordSearch,AsinSearch,ArtistSearch,ManufacturerSearch,UpcSearch');
    186 	obj.addSort('music','+pmrank','+psrank');
    187 	obj.addSort('music','+salesrank','+salesrank');
    188 	obj.addSort('music','+artistrank','+artistrank');
    189 	obj.addSort('music','+orig-rel-date','+orig-rel-date');
    190 	obj.addSort('music','+titlerank','+titlerank');
    191 	//Classical Music
    192 	obj.addCatalog('classical','classical');
    193 	obj.addSearchType('classical','KeywordSearch,AsinSearch,ArtistSearch,ManufacturerSearch,UpcSearch');
    194 	obj.addSort('classical','+pmrank','+psrank');
    195 	obj.addSort('classical','+salesrank','+salesrank');
    196 	obj.addSort('classical','+artistrank','+artistrank');
    197 	obj.addSort('classical','+orig-rel-date','+orig-rel-date');
    198 	obj.addSort('classical','+titlerank','+titlerank');
    199 	//DVD
    200 	obj.addCatalog('dvd','dvd');
    201 	obj.addSearchType('dvd','KeywordSearch,AsinSearch,ArtistSearch,ActorSearch,DirectorSearch,ManufacturerSearch,UpcSearch');
    202 	obj.addSort('dvd','+salesrank','+salesrank');
    203 	obj.addSort('dvd','+titlerank','+titlerank');
    204 	//Video (vhs)
    205 	obj.addCatalog('vhs','vhs');
    206 	obj.addSearchType('vhs','KeywordSearch,AsinSearch,ArtistSearch,ActorSearch,DirectorSearch,ManufacturerSearch,UpcSearch');
    207 	obj.addSort('vhs','+salesrank','+salesrank');
    208 	obj.addSort('vhs','+titlerank','+titlerank');
    209 	obj.addSort('vhs','+pmrank','+psrank');
    210 	//Electronics
    211 	obj.addCatalog('electronics','electronics');
    212 	obj.addSearchType('electronics','KeywordSearch,AsinSearch,UpcSearch');
    213 	obj.addSort('electronics','+salesrank','+salesrank');
    214 	obj.addSort('electronics','+titlerank','+titlerank');
    215 	obj.addSort('electronics','+pmrank','+pmrank');
    216 	obj.addSort('electronics','+reviewrank','+reviewrank');
    217 	//Software
    218 	obj.addCatalog('software','software');
    219 	obj.addSearchType('software','KeywordSearch,AsinSearch,ManufacturerSearch,UpcSearch');
    220 	obj.addSort('software','+salesrank','+salesrank');
    221 	obj.addSort('software','+titlerank','+titlerank');
    222 	obj.addSort('software','+pmrank','+pmrank');
    223 	obj.addSort('software','+pricrerank','+price');
    224 	obj.addSort('software','+inverse-pricerank','-price');
    225 	//Videogames
    226 	obj.addCatalog('videogames','videogames');
    227 	obj.addSearchType('videogames','KeywordSearch,AsinSearch,ManufacturerSearch,UpcSearch');
    228 	obj.addSort('videogames','+salesrank','+salesrank');
    229 	obj.addSort('videogames','+titlerank','+titlerank');
    230 	obj.addSort('videogames','+pmrank','+pmrank');
    231 	obj.addSort('videogames','+pricerank','+price');
    232 	obj.addSort('videogames','+inverse-pricerank','-price');
    233 	//Camera
    234 	obj.addCatalog('photo','photo');
    235 	obj.addSearchType('photo','KeywordSearch,AsinSearch,ManufacturerSearch,UpcSearch');
    236 	obj.addSort('photo','+salesrank','+salesrank');
    237 	obj.addSort('photo','+pmrank','+pmrank');
    238 	obj.addSort('photo','+titlerank','+titlerank');
    239 	obj.addSort('photo','-titlerank','-titlerank');
    240 	//Toys
    241 	obj.addCatalog('toys','toys');
    242 	obj.addSearchType('toys','KeywordSearch,AsinSearch,ManufacturerSearch,UpcSearch');
    243 	obj.addSort('toys','+salesrank','+salesrank');
    244 	obj.addSort('toys','+pmrank','+pmrank');
    245 	obj.addSort('toys','+titlerank','+titlerank');
    246 	obj.addSort('toys','+pricerank','+pricerank');
    247 	obj.addSort('toys','+inverse-pricerank','+inverse-pricerank');
    248 	//Housewares
    249 	obj.addCatalog('kitchen','kitchen');
    250 	obj.addSearchType('kitchen','KeywordSearch,AsinSearch,ManufacturerSearch,UpcSearch');
    251 	obj.addSort('kitchen','+salesrank','+salesrank');
    252 	obj.addSort('kitchen','+pmrank','+pmrank');
    253 	obj.addSort('kitchen','+titlerank','+titlerank');
    254 	obj.addSort('kitchen','-titlerank','-titlerank')
    255 	obj.addSort('kitchen','+pricerank','+price');
    256 	obj.addSort('kitchen','+inverse-pricerank','-price');
    257 	obj.addSort('kitchen','+manufactrank','+manufactrank');
    258 	obj.addSort('kitchen','-manufactrank','-manufactrank');
    259 	//Tools
    260 	obj.addCatalog('tools','tools');
    261 	obj.addSearchType('tools','KeywordSearch,AsinSearch,ManufacturerSearch,UpcSearch');
    262 	obj.addSort('tools','+salesrank','+salesrank');
    263 	obj.addSort('tools','+pmrank','+psrank');
    264 	obj.addSort('tools','+titlerank','+titlerank');
    265 	obj.addSort('tools','-titlerank','-titlerank')
    266 	obj.addSort('tools','+pricerank','+price');
    267 	obj.addSort('tools','+inverse-pricerank','-price');
    268 	obj.addSort('tools','+manufactrank','+manufactrank');
    269 	obj.addSort('tools','-manufactrank','-manufactrank');
    270 	//Outdoor Living
    271 	obj.addCatalog('garden','garden');
    272 	obj.addSearchType('garden','KeywordSearch,AsinSearch,ManufacturerSearch,UpcSearch');
    273 	obj.addSort('garden','+salesrank','+salesrank');
    274 	obj.addSort('garden','+pmrank','+psrank');
    275 	obj.addSort('garden','+titlerank','+titlerank');
    276 	obj.addSort('garden','-titlerank','-titlerank')
    277 	obj.addSort('garden','+pricerank','+price');
    278 	obj.addSort('garden','+inverse-pricerank','-price');
    279 	obj.addSort('garden','+manufactrank','+manufactrank');
    280 	obj.addSort('garden','-manufactrank','-manufactrank');
    281 	//Baby
    282 	obj.addCatalog('baby','baby');
    283 	obj.addSearchType('baby','KeywordSearch,AsinSearch,ManufacturerSearch,UpcSearch');
    284 	obj.addSort('garden','+salesrank','+salesrank');
    285 	//jewelry
    286 	obj.addCatalog('jewelry','jewelry');
    287 	obj.addSearchType('jewelry','KeywordSearch,AsinSearch,ManufacturerSearch,UpcSearch');
    288 	obj.addSort('jewelry','+salesrank','+salesrank');
    289 }
    290 
    291 //Amazon.co.uk
    292 ProductLineController.prototype.createProductLineUK = function(obj) {
    293 	//Blended
    294 	obj.addCatalog('blended','blended');
    295 	obj.addSearchType('blended','KeywordSearch');
    296 	obj.addSort('blended','+salesrank','+salesrank');
    297 	//Books
    298 	obj.addCatalog('books','books-uk');
    299 	obj.addSearchType('books','KeywordSearch,AsinSearch,AuthorSearch,ManufacturerSearch');
    300 	obj.addSort('books','+pmrank','+pmrank');
    301 	obj.addSort('books','+salesrank','+salesrank');
    302 	obj.addSort('books','+reviewrank','+reviewrank');
    303 	obj.addSort('books','+pricerank','+pricerank');
    304 	obj.addSort('books','+inverse-pricerank','+inverse-pricerank');
    305 	obj.addSort('books','+daterank','+daterank');
    306 	obj.addSort('books','+titlerank','+titlerank');
    307 	obj.addSort('books','-titlerank','-titlerank');
    308 	//Popular Music
    309 	obj.addCatalog('music','music');
    310 	obj.addSearchType('music','KeywordSearch,AsinSearch,ArtistSearch,ManufacturerSearch');
    311 	obj.addSort('music','+pmrank','+psrank');
    312 	obj.addSort('music','+salesrank','+salesrank');
    313 	obj.addSort('music','+artistrank','+artistrank');
    314 	obj.addSort('music','+orig-rel-date','+orig-rel-date');
    315 	obj.addSort('music','+titlerank','+titlerank');
    316 	//Classical Music
    317 	obj.addCatalog('classical','classical');
    318 	obj.addSearchType('classical','KeywordSearch,AsinSearch,ArtistSearch,ManufacturerSearch');
    319 	obj.addSort('classical','+pmrank','+psrank');
    320 	obj.addSort('classical','+salesrank','+salesrank');
    321 	obj.addSort('classical','+artistrank','+artistrank');
    322 	obj.addSort('classical','+orig-rel-date','+orig-rel-date');
    323 	obj.addSort('classical','+titlerank','+titlerank');
    324 	//DVD
    325 	obj.addCatalog('dvd','dvd-uk');
    326 	obj.addSearchType('dvd','KeywordSearch,AsinSearch,ArtistSearch,ActorSearch,DirectorSearch,ManufacturerSearch');
    327 	obj.addSort('dvd','+salesrank','+salesrank');
    328 	obj.addSort('dvd','+titlerank','+titlerank');
    329 	//Video (vhs)
    330 	obj.addCatalog('vhs','vhs-uk');
    331 	obj.addSearchType('vhs','KeywordSearch,AsinSearch,ArtistSearch,ActorSearch,DirectorSearch,ManufacturerSearch');
    332 	obj.addSort('vhs','+salesrank','+salesrank');
    333 	obj.addSort('vhs','+titlerank','+titlerank');
    334 	obj.addSort('vhs','+pmrank','+psrank');
    335 	//Electronics
    336 	obj.addCatalog('electronics','electronics-uk');
    337 	obj.addSearchType('electronics','KeywordSearch,AsinSearch,ManufacturerSearch');
    338 	obj.addSort('electronics','+salesrank','+salesrank');
    339 	obj.addSort('electronics','+titlerank','+titlerank');
    340 	obj.addSort('electronics','+pmrank','+pmrank');
    341 	obj.addSort('electronics','+reviewrank','+reviewrank');
    342 	//Software
    343 	obj.addCatalog('software','software-uk');
    344 	obj.addSearchType('software','KeywordSearch,AsinSearch,ManufacturerSearch');
    345 	obj.addSort('software','+salesrank','+salesrank');
    346 	obj.addSort('software','+titlerank','+titlerank');
    347 	obj.addSort('software','+pmrank','+pmrank');
    348 	obj.addSort('software','+pricrerank','+price');
    349 	obj.addSort('software','+inverse-pricerank','-price');
    350 	//Videogames
    351 	obj.addCatalog('videogames','video-games-uk');
    352 	obj.addSearchType('videogames','KeywordSearch,AsinSearch,ManufacturerSearch');
    353 	obj.addSort('videogames','+salesrank','+salesrank');
    354 	obj.addSort('videogames','+titlerank','+titlerank');
    355 	obj.addSort('videogames','+pmrank','+pmrank');
    356 	obj.addSort('videogames','+pricerank','+price');
    357 	obj.addSort('videogames','+inverse-pricerank','-price');
    358 	//Toys
    359 	obj.addCatalog('toys','toys-uk');
    360 	obj.addSearchType('toys','KeywordSearch,AsinSearch,ManufacturerSearch');
    361 	obj.addSort('toys','+salesrank','+salesrank');
    362 	obj.addSort('toys','+pmrank','+pmrank');
    363 	obj.addSort('toys','+titlerank','+titlerank');
    364 	obj.addSort('toys','+pricerank','+pricerank');
    365 	obj.addSort('toys','+inverse-pricerank','+inverse-pricerank');
    366 	//Housewares
    367 	obj.addCatalog('kitchen','kitchen-uk');
    368 	obj.addSearchType('kitchen','KeywordSearch,AsinSearch,ManufacturerSearch');
    369 	obj.addSort('kitchen','+salesrank','+salesrank');
    370 	obj.addSort('kitchen','+pmrank','+pmrank');
    371 	obj.addSort('kitchen','+titlerank','+titlerank');
    372 	obj.addSort('kitchen','-titlerank','-titlerank')
    373 	obj.addSort('kitchen','+pricerank','+price');
    374 	obj.addSort('kitchen','+inverse-pricerank','-price');
    375 	obj.addSort('kitchen','+manufactrank','+manufactrank');
    376 	obj.addSort('kitchen','-manufactrank','-manufactrank');
    377 }
    378 
    379 //Amazon.de
    380 ProductLineController.prototype.createProductLineDE = function(obj) {
    381 	//Blended
    382 	obj.addCatalog('blended','blended');
    383 	obj.addSearchType('blended','KeywordSearch');
    384 	obj.addSort('blended','+salesrank','+salesrank');
    385 	//Books
    386 	obj.addCatalog('books','books-de');
    387 	obj.addSearchType('books','KeywordSearch,AsinSearch,AuthorSearch,ManufacturerSearch');
    388 	obj.addSort('books','+pmrank','+pmrank');
    389 	obj.addSort('books','+salesrank','+salesrank');
    390 	obj.addSort('books','+reviewrank','+reviewrank');
    391 	obj.addSort('books','+pricerank','+pricerank');
    392 	obj.addSort('books','+inverse-pricerank','+inverse-pricerank');
    393 	obj.addSort('books','+daterank','+daterank');
    394 	obj.addSort('books','+titlerank','+titlerank');
    395 	obj.addSort('books','-titlerank','-titlerank');
    396 	//Magazines
    397 	obj.addCatalog('magazines','magazines-de');
    398 	obj.addSearchType('magazines','KeywordSearch,AsinSearch');
    399 	obj.addSort('magazines','+salesrank','+salesrank');
    400 	//Popular Music
    401 	obj.addCatalog('music','pop-music-de');
    402 	obj.addSearchType('music','KeywordSearch,AsinSearch,ArtistSearch,ManufacturerSearch');
    403 	obj.addSort('music','+pmrank','+psrank');
    404 	obj.addSort('music','+salesrank','+salesrank');
    405 	obj.addSort('music','+artistrank','+artistrank');
    406 	obj.addSort('music','+orig-rel-date','+orig-rel-date');
    407 	obj.addSort('music','+titlerank','+titlerank');
    408 	//Classical Music
    409 	obj.addCatalog('classical','classical-de');
    410 	obj.addSearchType('classical','KeywordSearch,AsinSearch,ArtistSearch,ManufacturerSearch');
    411 	obj.addSort('classical','+pmrank','+psrank');
    412 	obj.addSort('classical','+salesrank','+salesrank');
    413 	obj.addSort('classical','+artistrank','+artistrank');
    414 	obj.addSort('classical','+orig-rel-date','+orig-rel-date');
    415 	obj.addSort('classical','+titlerank','+titlerank');
    416 	//DVD
    417 	obj.addCatalog('dvd','dvd-de');
    418 	obj.addSearchType('dvd','KeywordSearch,AsinSearch,ArtistSearch,ActorSearch,DirectorSearch,ManufacturerSearch');
    419 	obj.addSort('dvd','+salesrank','+salesrank');
    420 	obj.addSort('dvd','+titlerank','+titlerank');
    421 	//Video (vhs)
    422 	obj.addCatalog('vhs','vhs-de');
    423 	obj.addSearchType('vhs','KeywordSearch,AsinSearch,ArtistSearch,ActorSearch,DirectorSearch,ManufacturerSearch');
    424 	obj.addSort('vhs','+salesrank','+salesrank');
    425 	obj.addSort('vhs','+titlerank','+titlerank');
    426 	obj.addSort('vhs','+pmrank','+psrank');
    427 	//Electronics
    428 	obj.addCatalog('electronics','ce-de');
    429 	obj.addSearchType('electronics','KeywordSearch,AsinSearch,ArtistSearch,ActorSearch,DirectorSearch,ManufacturerSearch');
    430 	obj.addSort('electronics','+salesrank','+salesrank');
    431 	obj.addSort('electronics','+titlerank','+titlerank');
    432 	obj.addSort('electronics','+pmrank','+pmrank');
    433 	obj.addSort('electronics','+reviewrank','+reviewrank');
    434 	//Software
    435 	obj.addCatalog('software','software-de');
    436 	obj.addSearchType('software','KeywordSearch,AsinSearch,ManufacturerSearch');
    437 	obj.addSort('software','+salesrank','+salesrank');
    438 	obj.addSort('software','+titlerank','+titlerank');
    439 	obj.addSort('software','+pmrank','+pmrank');
    440 	obj.addSort('software','+pricrerank','+price');
    441 	obj.addSort('software','+inverse-pricerank','-price');
    442 	//Videogames
    443 	obj.addCatalog('videogames','video-games-de');
    444 	obj.addSearchType('videogames','KeywordSearch,AsinSearch,ManufacturerSearch');
    445 	obj.addSort('videogames','+salesrank','+salesrank');
    446 	obj.addSort('videogames','+titlerank','+titlerank');
    447 	obj.addSort('videogames','+pmrank','+pmrank');
    448 	obj.addSort('videogames','+pricerank','+price');
    449 	obj.addSort('videogames','+inverse-pricerank','-price');
    450 	//International Books
    451 	obj.addCatalog('books-int','books-de-intl-us');
    452 	obj.addSearchType('books-int','KeywordSearch,AsinSearch,AuthorSearch,ManufacturerSearch');
    453 	obj.addSort('books-int','+pmrank','+pmrank');
    454 	obj.addSort('books-int','+salesrank','+salesrank');
    455 	obj.addSort('books-int','+reviewrank','+reviewrank');
    456 	obj.addSort('books-int','+pricerank','+pricerank');
    457 	obj.addSort('books-int','+inverse-pricerank','+inverse-pricerank');
    458 	obj.addSort('books-int','+daterank','+daterank');
    459 	obj.addSort('books-int','+titlerank','+titlerank');
    460 	obj.addSort('books-int','-titlerank','-titlerank');
    461 }
    462 
    463 //Amazon.fr
    464 ProductLineController.prototype.createProductLineFR = function(obj) {
    465 	//Blended
    466 	obj.addCatalog('blended','blended');
    467 	obj.addSearchType('blended','KeywordSearch');
    468 	obj.addSort('blended','+salesrank','+salesrank');
    469 	//Books
    470 	obj.addCatalog('books','books-fr');
    471 	obj.addSearchType('books','KeywordSearch,AsinSearch,AuthorSearch,ManufacturerSearch');
    472 	obj.addSort('books','+salesrank','+salesrank');
    473 	obj.addSort('books','+pricerank','+pricerank');
    474 	obj.addSort('books','+inverse-pricerank','+inverse-pricerank');
    475 	obj.addSort('books','+daterank','+daterank');
    476 	obj.addSort('books','+titlerank','+titlerank');
    477 	obj.addSort('books','-titlerank','-titlerank');
    478 	//Popular Music
    479 	obj.addCatalog('music','music-fr');
    480 	obj.addSearchType('music','KeywordSearch,AsinSearch,ArtistSearch,ManufacturerSearch');
    481 	obj.addSort('music','+salesrank','+salesrank');
    482 	obj.addSort('music','+pricerank','+pricerank');
    483 	obj.addSort('music','+inverse-pricerank','+inverse-pricerank');
    484 	obj.addSort('music','+titlerank','+titlerank');
    485 	obj.addSort('music','-titlerank','-titlerank');
    486 	//Classical Music
    487 	obj.addCatalog('classical','classical-fr');
    488 	obj.addSearchType('classical','KeywordSearch,AsinSearch,ArtistSearch,ManufacturerSearch');
    489 	obj.addSort('classical','+salesrank','+salesrank');
    490 	obj.addSort('classical','+pricerank','+pricerank');
    491 	obj.addSort('classical','+inverse-pricerank','+inverse-pricerank');
    492 	obj.addSort('classical','+titlerank','+titlerank');
    493 	obj.addSort('classical','-titlerank','-titlerank');
    494 	//DVD
    495 	obj.addCatalog('dvd','dvd-fr');
    496 	obj.addSearchType('dvd','KeywordSearch,AsinSearch,ArtistSearch,ActorSearch,DirectorSearch,ManufacturerSearch');
    497 	obj.addSort('dvd','+salesrank','+salesrank');
    498 	obj.addSort('dvd','+orig-rel-date','-pubdate');
    499 	obj.addSort('dvd','+titlerank','+titlerank');
    500 	obj.addSort('dvd','-titlerank','-titlerank');
    501 	//Video (vhs)
    502 	obj.addCatalog('vhs','vhs-fr');
    503 	obj.addSearchType('vhs','KeywordSearch,AsinSearch,ArtistSearch,ActorSearch,DirectorSearch,ManufacturerSearch');
    504 	obj.addSort('vhs','+salesrank','+salesrank');
    505 	obj.addSort('vhs','+titlerank','+titlerank');
    506 	obj.addSort('vhs','-titlerank','-titlerank');
    507 	//Software
    508 	obj.addCatalog('software','software-fr');
    509 	obj.addSearchType('software','KeywordSearch,AsinSearch,ManufacturerSearch');
    510 	obj.addSort('software','+salesrank','+salesrank');
    511 	obj.addSort('software','+titlerank','+titlerank');
    512 	obj.addSort('software','-titlerank','-titlerank');
    513 	obj.addSort('software','+pricrerank','+price');
    514 	obj.addSort('software','+inverse-pricerank','-price');
    515 	//Videogames
    516 	obj.addCatalog('videogames','video-games-fr');
    517 	obj.addSearchType('videogames','KeywordSearch,AsinSearch,ManufacturerSearch');
    518 	obj.addSort('videogames','+salesrank','+salesrank');
    519 	obj.addSort('videogames','+titlerank','+titlerank');
    520 	obj.addSort('videogames','-titlerank','-titlerank');
    521 	obj.addSort('videogames','+pricerank','+price');
    522 	obj.addSort('videogames','+inverse-pricerank','-price');
    523 	obj.addSort('videogames','+daterank','date');
    524 	//International Books
    525 	obj.addCatalog('books-int','books-fr-intl-us');
    526 	obj.addSearchType('books-int','KeywordSearch,AsinSearch,AuthorSearch,ManufacturerSearch');
    527 	obj.addSort('books-int','+salesrank','+salesrank');
    528 	obj.addSort('books-int','+pricerank','+pricerank');
    529 	obj.addSort('books-int','+inverse-pricerank','+inverse-pricerank');
    530 	obj.addSort('books-int','+daterank','-daterank');
    531 	obj.addSort('books-int','+titlerank','+titlerank');
    532 	obj.addSort('books-int','-titlerank','-titlerank');
    533 }
    534 
    535 //Amazon.ca
    536 ProductLineController.prototype.createProductLineCA = function(obj) {
    537 	//Blended
    538 	obj.addCatalog('blended','blended');
    539 	obj.addSearchType('blended','KeywordSearch');
    540 	obj.addSort('blended','+salesrank','+salesrank');
    541 	//Books
    542 	obj.addCatalog('books','books-ca');
    543 	obj.addSearchType('books','KeywordSearch,AsinSearch,AuthorSearch,ManufacturerSearch');
    544 	obj.addSort('books','+salesrank','+salesrank');
    545 	obj.addSort('books','+pricerank','+pricerank');
    546 	obj.addSort('books','+inverse-pricerank','+inverse-pricerank');
    547 	obj.addSort('books','+daterank','+daterank');
    548 	obj.addSort('books','+titlerank','+titlerank');
    549 	obj.addSort('books','-titlerank','-titlerank');
    550 	//Popular Music
    551 	obj.addCatalog('music','music-ca');
    552 	obj.addSearchType('music','KeywordSearch,AsinSearch,ArtistSearch,ManufacturerSearch');
    553 	obj.addSort('music','+salesrank','+salesrank');
    554 	obj.addSort('music','+titlerank','+titlerank');
    555 	obj.addSort('music','+orig-rel-date','+orig-rel-date');
    556 	//Classical Music
    557 	obj.addCatalog('classical','classical-ca');
    558 	obj.addSearchType('classical','KeywordSearch,AsinSearch,ArtistSearch,ManufacturerSearch');
    559 	obj.addSort('classical','+salesrank','+salesrank');
    560 	obj.addSort('classical','+titlerank','+titlerank');
    561 	obj.addSort('classical','+orig-rel-date','+orig-rel-date');
    562 	//DVD
    563 	obj.addCatalog('dvd','dvd-ca');
    564 	obj.addSearchType('dvd','KeywordSearch,AsinSearch,ArtistSearch,ActorSearch,DirectorSearch,ManufacturerSearch');
    565 	obj.addSort('dvd','+salesrank','+salesrank');
    566 	obj.addSort('dvd','+titlerank','+titlerank');
    567 	//Video (vhs)
    568 	obj.addCatalog('vhs','vhs-ca');
    569 	obj.addSearchType('vhs','KeywordSearch,AsinSearch,ArtistSearch,ActorSearch,DirectorSearch,ManufacturerSearch');
    570 	obj.addSort('vhs','+salesrank','+salesrank');
    571 	obj.addSort('vhs','+titlerank','+titlerank');
    572 	//Software
    573 	obj.addCatalog('software','software-ca');
    574 	obj.addSearchType('software','KeywordSearch,AsinSearch,ManufacturerSearch');
    575 	obj.addSort('software','+salesrank','+salesrank');
    576 	obj.addSort('software','+titlerank','+titlerank');
    577 	obj.addSort('software','+pricrerank','+price');
    578 	obj.addSort('software','+inverse-pricerank','-price');
    579 	obj.addSort('software','+daterank','date');
    580 	//Videogames
    581 	obj.addCatalog('videogames','video-games-ca');
    582 	obj.addSearchType('videogames','KeywordSearch,AsinSearch,ManufacturerSearch');
    583 	obj.addSort('videogames','+salesrank','+salesrank');
    584 	obj.addSort('videogames','+titlerank','+titlerank');
    585 	obj.addSort('videogames','+pricerank','+price');
    586 	obj.addSort('videogames','+inverse-pricerank','-price');
    587 	obj.addSort('videogames','+daterank','-daterank');
    588 }
    589 //Amazon.co.jp
    590 ProductLineController.prototype.createProductLineJP = function(obj) {
    591 	//Blended
    592 	obj.addCatalog('blended','blended');
    593 	obj.addSearchType('blended','KeywordSearch');
    594 	obj.addSort('blended','+salesrank','+salesrank');
    595 	//Books
    596 	obj.addCatalog('books','books-jp');
    597 	obj.addSearchType('books','KeywordSearch,AsinSearch,AuthorSearch,ManufacturerSearch');
    598 	obj.addSort('books','+pmrank','+pmrank');
    599 	obj.addSort('books','+salesrank','+salesrank');
    600 	obj.addSort('books','+reviewrank','+reviewrank');
    601 	obj.addSort('books','+pricerank','+pricerank');
    602 	obj.addSort('books','+inverse-pricerank','+inverse-pricerank');
    603 	obj.addSort('books','+daterank','+daterank');
    604 	obj.addSort('books','+titlerank','+titlerank');
    605 	obj.addSort('books','-titlerank','-titlerank');
    606 	//Popular Music
    607 	obj.addCatalog('music','music-jp');
    608 	obj.addSearchType('music','KeywordSearch,AsinSearch,ArtistSearch,ManufacturerSearch');
    609 	obj.addSort('music','+pmrank','+psrank');
    610 	obj.addSort('music','+salesrank','+salesrank');
    611 	obj.addSort('music','+artistrank','+artistrank');
    612 	obj.addSort('music','+orig-rel-date','+orig-rel-date');
    613 	obj.addSort('music','+titlerank','+titlerank');
    614 	//Classical Music
    615 	obj.addCatalog('classical','classical-jp');
    616 	obj.addSearchType('classical','KeywordSearch,AsinSearch,ArtistSearch,ManufacturerSearch');
    617 	obj.addSort('classical','+pmrank','+psrank');
    618 	obj.addSort('classical','+salesrank','+salesrank');
    619 	obj.addSort('classical','+artistrank','+artistrank');
    620 	obj.addSort('classical','+orig-rel-date','+orig-rel-date');
    621 	obj.addSort('classical','+titlerank','+titlerank');
    622 	//DVD
    623 	obj.addCatalog('dvd','dvd-jp');
    624 	obj.addSearchType('dvd','KeywordSearch,AsinSearch,ArtistSearch,ActorSearch,DirectorSearch,ManufacturerSearch');
    625 	obj.addSort('dvd','+salesrank','+salesrank');
    626 	obj.addSort('dvd','+titlerank','+titlerank');
    627 	//Video (vhs)
    628 	obj.addCatalog('vhs','vhs-jp');
    629 	obj.addSearchType('vhs','KeywordSearch,AsinSearch,ArtistSearch,ActorSearch,DirectorSearch,ManufacturerSearch');
    630 	obj.addSort('vhs','+salesrank','+salesrank');
    631 	obj.addSort('vhs','+titlerank','+titlerank');
    632 	obj.addSort('vhs','+pmrank','+psrank');
    633 	//Electronics
    634 	obj.addCatalog('electronics','electronics-jp');
    635 	obj.addSearchType('electronics','KeywordSearch,AsinSearch,ManufacturerSearch');
    636 	obj.addSort('electronics','+salesrank','+salesrank');
    637 	obj.addSort('electronics','+titlerank','+titlerank');
    638 	obj.addSort('electronics','+pmrank','+pmrank');
    639 	obj.addSort('electronics','+reviewrank','+reviewrank');
    640 	//Software
    641 	obj.addCatalog('software','software-jp');
    642 	obj.addSearchType('software','KeywordSearch,AsinSearch,ManufacturerSearch');
    643 	obj.addSort('software','+salesrank','+salesrank');
    644 	obj.addSort('software','+titlerank','+titlerank');
    645 	obj.addSort('software','+pmrank','+pmrank');
    646 	obj.addSort('software','+pricerank','+price');
    647 	obj.addSort('software','+inverse-pricerank','-price');
    648 	//Videogames
    649 	obj.addCatalog('videogames','videogames-jp');
    650 	obj.addSearchType('videogames','KeywordSearch,AsinSearch,,ManufacturerSearch');
    651 	obj.addSort('videogames','+salesrank','+salesrank');
    652 	obj.addSort('videogames','+titlerank','+titlerank');
    653 	obj.addSort('videogames','+pmrank','+pmrank');
    654 	obj.addSort('videogames','+pricerank','+price');
    655 	obj.addSort('videogames','+inverse-pricerank','-price');
    656 	//Toys
    657 	obj.addCatalog('toys','toys-jp');
    658 	obj.addSearchType('toys','KeywordSearch,AsinSearch,ManufacturerSearch');
    659 	obj.addSort('toys','+salesrank','+salesrank');
    660 	obj.addSort('toys','+pmrank','+pmrank');
    661 	obj.addSort('toys','+titlerank','+titlerank');
    662 	obj.addSort('toys','+pricerank','+pricerank');
    663 	obj.addSort('toys','+inverse-pricerank','+inverse-pricerank');
    664 	//International Books
    665 	obj.addCatalog('books-int','books-us');
    666 	obj.addSearchType('books-int','KeywordSearch,AsinSearch,AuthorSearch,ManufacturerSearch');
    667 	obj.addSort('books-int','+pmrank','+pmrank');
    668 	obj.addSort('books-int','+salesrank','+salesrank');
    669 	obj.addSort('books-int','+reviewrank','+reviewrank');
    670 	obj.addSort('books-int','+pricerank','+pricerank');
    671 	obj.addSort('books-int','+inverse-pricerank','+inverse-pricerank');
    672 	obj.addSort('books-int','+daterank','+daterank');
    673 	obj.addSort('books-int','+titlerank','+titlerank');
    674 	obj.addSort('books-int','-titlerank','-titlerank');
    675 
    676 }