var cart_url = 'http://www.generic4all.com/basket.dhtml';
var affiliate_pageID = '4525';
var basedomain = 'http://www.generic4all.com';
var product_images = basedomain +'/upload_files/product_images/'
var currency = '$';

if (!affiliate_pageID || parseInt(affiliate_pageID) == NaN)
{
	affiliate_pageID = gup('refID');
}

if (!affiliate_pageID || parseInt(affiliate_pageID) == NaN)
{
		affiliate_pageID = 0;
}

//Replacing links.
$('a[href*={refID}]').each(function(){
		this.href = this.href.replace(/{refID}/gi, affiliate_pageID);
		this.href = this.href.replace(/%7BrefID%7D/gi, affiliate_pageID);
});


function gup(name)
{
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	var regexS = "[\\?&]"+name+"=([^&#]*)";
	var regex = new RegExp( regexS );
	var results = regex.exec( window.location.href );
	if( results == null ) return "";
	else return results[1];
}


var product_selects = {
	0: {
		elm_id: 'product-options-1',
		productID: 172
	},
	1: {
		elm_id: 'product-options-2',
		productID: 326
	},
	2: {
		elm_id: 'product-options-3',
		productID: 242
	},
	3: {
		elm_id: 'product-options-4',
		productID: 396
	},
	4: {
		elm_id: 'product-options-5',
		productID: 325
	},
	5: {
		elm_id: 'product-options-6',
		productID: 373
	},
	6: {
		elm_id: 'product-options-7',
		productID: 218
	},
	7: {
		elm_id: 'product-options-8',
		productID: 269
	},
	8: {
		elm_id: 'product-options-9',
		productID: 173
	},
	9: {
		elm_id: 'product-options-10',
		productID: 5
	},
	10: {
		elm_id: 'product-options-11',
		productID: 327
	},
	11: {
		elm_id: 'product-options-12',
		productID: 396
	},
	12: {
		elm_id: 'product-options-13',
		productID: 406
	},
	13: {
		elm_id: 'product-options-14',
		productID: 374
	},
	14: {
		elm_id: 'product-options-15',
		productID: 409
	},
	15: {
		elm_id: 'product-options-16',
		productID: 183
	},
	16: {
		elm_id: 'product-options-17',
		productID: 115
	},
	17: {
		elm_id: 'product-options-18',
		productID: 396
	},
	18: {
		elm_id: 'product-options-19',
		productID: 390
	},
	19: {
		elm_id: 'product-options-20',
		productID: 391
	}
};

var main_table_titles = {
	0: {word: 'Quantity'},
	1: {word: 'Price'},
	2: {word: 'Bonus'},
	3: {word: 'Price per unit'},
	4: {word: 'Add to cart'}
};

var main_table_defines = {
	'buy-now' : 'Buy Now',
	'left-buy-now-image' : 'images/buy-now-left.png',
	'right-buy-now-image' : 'images/buy-now-right.png'
};
