$(document).ready(function() {
	$('.leftlinklist:last').css('width', '150px');
	if (document.URL != "http://www.memorysuppliers.com/cuusbfldr.html") {
		$(document.body).append('<script type="text/javascript">var chat = 1;var chat_div_id = "chat_div";</script><script type="text/javascript" src="https://adlink.chatstat.com/JSBuilder.aspx?csuid=10167" defer="defer"></script><div id="chat_div"></div>');
	}

	$('a[href$="10167"]').attr('href', '#').removeAttr('target');
	$('.preloader').remove();
});

/* *************** */
/* Standard Finder */
/* *************** */
function initDdlMfgr(event) {
	setActiveStep('mfstep', 1, 3);
	var d = document.getElementById('ddlMfgr');
	d.options.length = 1;
	d.options[0] = new Option('Select Manufacturer', 'Select', true, true);
	d.selectedIndex = 0;

	loadDdlPL();
}

function loadDdlMfgr(event) {
	if (document.getElementById('ddlMfgr').options.length <= 1) {
		setActiveStep('mfstep', 1, 3);
		emptyDDL(document.getElementById('ddlPL'), 'Select Product Line');
		emptyDDL(document.getElementById('ddlModel'), 'Select Model');
		$.getJSON('http://apps2.memorysuppliers.com/ajax/getDropDown.php?json=?',
			{
				cat: 'All',
				cv: 'MemorySuppliers'
			},
			_loadDdlMfgr);
	}
}

function _loadDdlMfgr(data) {
	var d = document.getElementById('ddlMfgr');
	d.options.length = 0;
	
	if (data && data.length && data.length > 0) {
		d.options.length = data.length + 1;
		for (var i=0; i<data.length; ++i) {
			d.options[i+1] = new Option(data[i].name, data[i].value, false, false);
		}
		d.options[0] = new Option('Select Manufacturer', 'Select', true, true);
		d.selectedIndex = 0;

	}
	
	loadDdlPL();
}

function loadDdlPL(event) {
	emptyDDL(document.getElementById('ddlModel'), 'Select Model');
	var el1 = document.getElementById('ddlMfgr').options[document.getElementById('ddlMfgr').selectedIndex].value;
	if (el1 != 'Select' && el1 != 'Select Manufacturer' && escape(el1) != 'null' && el1 != 'N.A.' && el1 != '') {
		setActiveStep('mfstep', 2, 3);
		var d = document.getElementById('ddlPL');
		emptyDDL(d, 'Loading...');
		$.getJSON('http://apps2.memorysuppliers.com/ajax/getDropDown.php?json=?',
			{
				cat: 'All',
				mfgr: escape(el1),
				cv: 'MemorySuppliers'
			},
			
			_loadDdlPL);
		d.disabled = false;
		//cookie value from main mf Manufacturererererur
		createCookie("mfMFGR", el1, 1);
	}
	else {
		setActiveStep('mfstep', 1, 3);
		emptyDDL(document.getElementById('ddlPL'), 'Select Product Line');
	}
}

function _loadDdlPL(data) {
	var d = document.getElementById('ddlPL');
	d.options.length = 0;

	if (data && data.length && data.length > 0) {
		d.options.length = data.length + 1;
		if (data.length == 1 && data[0].name == 'N.A.') {
			d.options[1] = new Option('All Models', 'Other', false, false);
		}
		else {
			for (var i=0; i<data.length; ++i) {
				d.options[i+1] = new Option(data[i].name, data[i].value, (i == 0), (i == 0));
			}
		}
		d.options[0] = new Option('Select Product Line', 'Select', true, true);
	}
	loadDdlModel();
}

function loadDdlModel(event) {
	var el1 = document.getElementById('ddlMfgr').options[document.getElementById('ddlMfgr').selectedIndex].value;
	var el2 = document.getElementById('ddlPL').options[document.getElementById('ddlPL').selectedIndex].value;
	//create cookie from main mf product list
	createCookie("mfPL", el2, 1);
	if (el1 != 'Select' && el1 != 'Select Manufacturer', escape(el1) != 'null' && el1 != 'N.A.' && el2 != 'Select' && el2 != 'Select Product Line' && escape(el2) != 'null' && el2 != 'N.A.') {
		setActiveStep('mfstep', 3, 3);
		var d = document.getElementById('ddlModel');
		emptyDDL(d, 'Loading...');
		$.getJSON('http://apps2.memorysuppliers.com/ajax/getDropDown.php?json=?',
			{
				cat: 'All',
				mfgr: escape(el1),
				pl: escape(el2),
				cv: 'MemorySuppliers'
			},
			_loadDdlModel);
		d.disabled = false;
	}
	else {
		setActiveStep('mfstep', 2, 3);
		emptyDDL(document.getElementById('ddlModel'), 'Select Model');
	}

}

function _loadDdlModel(data) {
	var d = document.getElementById('ddlModel');
	d.options.length = 0;

	if (data && data.length && data.length > 0) {
		d.options.length = data.length + 1;
		for (var i=0; i<data.length; ++i) {
			d.options[i+1] = new Option(data[i].name, data[i].value, (i == 0), (i == 0));
		}
		d.options[0] = new Option('Select Model', 'Select', true, true);
	}
}


/* ***************** */
/* Flash Card Finder */
/* ***************** */

function initDdlMfgrFlash(event) {
	setActiveStep('mfstepFlash', 1, 3);
	var d = document.getElementById('ddlMfgrFlash');
	d.options.length = 1;
	d.options[0] = new Option('Select Manufacturer', 'Select', true, true);
	d.selectedIndex = 0;

	loadDdlPLFlash();
}

function loadDdlMfgrFlash(event) {
	if (document.getElementById('ddlMfgrFlash').options.length <= 1) {
		setActiveStep('mfstepFlash', 1, 3);
		emptyDDL(document.getElementById('ddlPLFlash'), 'Select Product Line');
		emptyDDL(document.getElementById('ddlModelFlash'), 'Select Model');
		$.getJSON('http://apps2.memorysuppliers.com/ajax/getDropDown.php?json=?',
			{
				cat: 'Flash',
				cv: 'MemorySuppliers'
			},
			_loadDdlMfgrFlash);
	}
}

function _loadDdlMfgrFlash(data) {
	var d = document.getElementById('ddlMfgrFlash');
	d.options.length = 0;
	
	if (data && data.length && data.length > 0) {
		d.options.length = data.length + 1;
		for (var i=0; i<data.length; ++i) {
			d.options[i+1] = new Option(data[i].name, data[i].value, false, false);
		}
		d.options[0] = new Option('Select Manufacturer', 'Select', true, true);
		d.selectedIndex = 0;
	}
	loadDdlPLFlash();
}

function loadDdlPLFlash(event) {
	emptyDDL(document.getElementById('ddlModelFlash'), 'Select Model');
	var el1 = document.getElementById('ddlMfgrFlash').options[document.getElementById('ddlMfgrFlash').selectedIndex].value;
	if (el1 != 'Select' && el1 != 'Select Manufacturer' && escape(el1) != 'null' && el1 != 'N.A.' && el1 != '') {
		setActiveStep('mfstepFlash', 2, 3);
		var d = document.getElementById('ddlPLFlash');
		emptyDDL(d, 'Loading...');
		$.getJSON('http://apps2.memorysuppliers.com/ajax/getDropDown.php?json=?',
			{
				cat: 'Flash',
				mfgr: escape(el1),
				cv: 'MemorySuppliers'
			},
			_loadDdlPLFlash);
		d.disabled = false;
	}
	else {
		setActiveStep('mfstepFlash', 1, 3);
		emptyDDL(document.getElementById('ddlPLFlash'), 'Select Product Line');
	}
}

function _loadDdlPLFlash(data) {
	var d = document.getElementById('ddlPLFlash');
	d.options.length = 0;

	if (data && data.length && data.length > 0) {
		d.options.length = data.length + 1;
		if (data.length == 1 && data[0].name == 'N.A.') {
			d.options[1] = new Option('All Models', 'Other', false, false);
		}
		else {
			for (var i=0; i<data.length; ++i) {
				d.options[i+1] = new Option(data[i].name, data[i].value, (i == 0), (i == 0));
			}
		}
		d.options[0] = new Option('Select Product Line', 'Select', true, true);
	}
	loadDdlModelFlash();
}

function loadDdlModelFlash(event) {
	var el1 = document.getElementById('ddlMfgrFlash').options[document.getElementById('ddlMfgrFlash').selectedIndex].value;
	var el2 = document.getElementById('ddlPLFlash').options[document.getElementById('ddlPLFlash').selectedIndex].value;
	if (el1 != 'Select' && el1 != 'Select Manufacturer', escape(el1) != 'null' && el1 != 'N.A.' && el2 != 'Select' && el2 != 'Select Product Line' && escape(el2) != 'null' && el2 != 'N.A.') {
		setActiveStep('mfstepFlash', 3, 3);
		var d = document.getElementById('ddlModelFlash');
		emptyDDL(d, 'Loading...');
		$.getJSON('http://apps2.memorysuppliers.com/ajax/getDropDown.php?json=?',
			{
				cat: 'Flash',
				mfgr: escape(el1),
				pl: escape(el2),
				cv: 'MemorySuppliers'
			},
			_loadDdlModelFlash);
		d.disabled = false;
	}
	else {
		setActiveStep('mfstepFlash', 2, 3);
		emptyDDL(document.getElementById('ddlModelFlash'), 'Select Model');
	}
}

function _loadDdlModelFlash(data) {
	var d = document.getElementById('ddlModelFlash');
	d.options.length = 0;

	if (data && data.length && data.length > 0) {
		d.options.length = data.length + 1;
		for (var i=0; i<data.length; ++i) {
			d.options[i+1] = new Option(data[i].name, data[i].value, (i == 0), (i == 0));
		}
		d.options[0] = new Option('Select Model', 'Select', true, true);
	}
}


/* 12.29.08 vars for prod table */
pbarr = new Array('prodbox-expert-box','prodbox-lowprice-box','prodbox-volume-box','prodbox-govment-box','prodbox-whybuy-box','prodbox-friend-box');
function
openProdbox(target) { for (i=0; i<pbarr.length; i++) { if (target
!== pbarr[i]) { $('#'+pbarr[i]).slideUp(200); } } if
($('#'+target).css('display') == 'block') { $('#'+target).slideUp(200);
} else { $('#'+target).slideDown(200); }
}

function emptyDDL(ddl, selectName) {
	ddl.options.length = 0;
	ddl.options[0] = new Option(selectName, 'Select', true, true);
	ddl.disabled = true;
}

function setActiveStep(name, stepId, total) {
	for (i=0; i<=total; ++i) {
		if (i == stepId) {
			if (document.getElementById(name + i)) {
				document.getElementById(name + i).style.backgroundPosition = '0 0';
			}
		}
		else {
			if (document.getElementById(name + i)) {
				document.getElementById(name + i).style.backgroundPosition = '0 100%';
			}
		}
	}
}

Biz = window.Biz || {};
Biz.Product = window.Biz.Product || {};

Biz.Product.DetailPage = {
	swapProductImage : function(img, href) {
		document.getElementById('rndImagePreview').src = img;
		if (href != null)
			document.getElementById('rndImagePreviewLink').href = href;
	}
};

Biz.Product.i18n = {
	update : function(d) {
		$('.i18n').each(function(i) {
			p = parseFloat(this.getAttribute('amount'));
			m = this.getAttribute('currency');
			s = this.getAttribute('i18n');
			if (p && m && m.length && s && s.length) {
				this.innerHTML = s + ((p * parseFloat(d[m.toUpperCase()])).toFixed(2));
			}
		});
	},
	run : function() {
		$.getJSON('http://apps2.memorysuppliers.com/ajax/currency.php?cb=?', { i: 'usd', o: 'aud,cad,eur,gbp', of: 'json' }, Biz.Product.i18n.update);
	}
};

jQuery.fn.getUrlParam = function(strParamName) {
	strParamName = escape(unescape(strParamName));

	var returnVal = new Array();
	var qString = null;

	if ($(this).attr("nodeName") == "#document") {
		if (window.location.search.search(strParamName) > -1 ) {
			qString = window.location.search.substr(1,window.location.search.length).split("&");
		}
	}
	else if ($(this).attr("src") != "undefined") {
		var strHref = $(this).attr("src")
		if ( strHref.indexOf("?") > -1 ) {
			var strQueryString = strHref.substr(strHref.indexOf("?")+1);
			qString = strQueryString.split("&");
		}
	}
	else if ($(this).attr("href") != "undefined") {
		var strHref = $(this).attr("href")
		if ( strHref.indexOf("?") > -1 ) {
			var strQueryString = strHref.substr(strHref.indexOf("?")+1);
			qString = strQueryString.split("&");
		}
	}
	else {
		return null;
  }

	if (qString == null) return null;

	for (var i=0;i<qString.length; i++) {
		if (escape(unescape(qString[i].split("=")[0])) == strParamName) {
			returnVal.push(decodeURIComponent( qString[i].split("=")[1].replace(/\+/g,' ') ));
		}
	}

	return (returnVal.length == 0)? null : (returnVal.length == 1)? returnVal[0] : returnVal;
}

$(document).ready(function() {
	if ($('.above-prodbox, .itemTopPriceTable')) {
		$.getJSON('http://apps2.memorysuppliers.com/ajax/shipcountdown.php?cb=?', {}, function(j) {
			if ($('.above-prodbox'))
				$('.above-prodbox').append(j.s);
			else
				$('.itemTopPriceTable').after(j.s);
		});
	}
});

Biz = window.Biz || {};
Biz.Consultant = {
	_ddlMfgrName : '',
	_ddlMfgrID : '',
	_ddlPLName : '',
	_ddlPLID : '',
	_ddlModelName : '',
	_ddlModelID : '',
	
	emptyDDL : function(ddl, selectName) {
		ddl.options.length = 0;
		ddl.options[0] = new Option(selectName, 'Select', true, true);
		ddl.disabled = true;
	},
	
	initDdlMfgr : function(event) {
		var d = document.getElementById(Biz.Consultant._ddlMfgrID);
		d.options.length = 1;
		d.options[0] = new Option(Biz.Consultant._ddlMfgrName, 'Select', true, true);
		d.selectedIndex = 0;

		Biz.Consultant.loadDdlPL();
	},
	
	loadDdlMfgr : function(event) {
		if (document.getElementById(Biz.Consultant._ddlMfgrID).options.length <= 1) {
			Biz.Consultant.emptyDDL(document.getElementById(Biz.Consultant._ddlPLID), Biz.Consultant._ddlPLName);
			Biz.Consultant.emptyDDL(document.getElementById(Biz.Consultant._ddlModelID), Biz.Consultant._ddlModelName);
			$.getJSON('http://apps2.memorysuppliers.com/ajax/getDropDown.php?json=?', { cat: 'All', cv: 'MemorySuppliers' }, Biz.Consultant._loadDdlMfgr);
			try {
				pt2._trackPageview('/consultant');
				pt2._trackEvent('Memory Finder - Left Column', 'Manufacturer');
			} catch(err) {}
		}
	},

	_loadDdlMfgr : function(data) {
		var d = document.getElementById(Biz.Consultant._ddlMfgrID);
		d.options.length = 0;
		
		if (data && data.length && data.length > 0) {
			d.options.length = data.length + 1;
			for (var i=0; i<data.length; ++i) {
				d.options[i+1] = new Option(data[i].name, data[i].value, false, false);
			}
			d.options[0] = new Option(Biz.Consultant._ddlMfgrName, 'Select', true, true);
			d.selectedIndex = 0;
		}
		
		/* MINE */
		if(c_mfgr = readCookie('mfMFGR')){
			//$('#lcol-ddlMfgr').val(c_mfgr, true);
			var sel_trgt = document.getElementById("lcol-ddlMfgr");
			var meh = sel_trgt.getElementsByTagName("option");
			$("#lcol-ddlMfgr").val(c_mfgr);
		}
		/* END MINE */
		
		Biz.Consultant.loadDdlPL();
	},

	loadDdlPL : function(event) {
		Biz.Consultant.emptyDDL(document.getElementById(Biz.Consultant._ddlModelID), Biz.Consultant._ddlModelName);
		var el1 = document.getElementById(Biz.Consultant._ddlMfgrID).options[document.getElementById(Biz.Consultant._ddlMfgrID).selectedIndex].value;
		if (el1 != 'Select' && el1 != Biz.Consultant._ddlMfgrName && escape(el1) != 'null' && el1 != 'N.A.' && el1 != '') {
			var d = document.getElementById(Biz.Consultant._ddlPLID);
			Biz.Consultant.emptyDDL(d, 'Loading...');
			$.getJSON('http://apps2.memorysuppliers.com/ajax/getDropDown.php?json=?', { cat: 'All', mfgr: escape(el1), cv: 'MemorySuppliers' }, Biz.Consultant._loadDdlPL);
			try {
				pt2._trackPageview('/consultant/'+escape(el1));
				pt2._trackEvent('Memory Finder - Left Column', 'Product Line', el1);
			} catch(err) {}
			d.disabled = false;
			createCookie("mfMFGR", el1, 1);
		}
		else {
			Biz.Consultant.emptyDDL(document.getElementById(Biz.Consultant._ddlPLID), Biz.Consultant._ddlPLName);
		}
	},

	_loadDdlPL : function(data) {
		var d = document.getElementById(Biz.Consultant._ddlPLID);
		d.options.length = 0;
	
		if (data && data.length && data.length > 0) {
			d.options.length = data.length + 1;
			if (data.length == 1 && data[0].name == 'N.A.') {
				d.options[1] = new Option('All Models', 'Other', false, false);
			}
			else {
				for (var i=0; i<data.length; ++i) {
					d.options[i+1] = new Option(data[i].name, data[i].value, (i == 0), (i == 0));
				}
			}
			d.options[0] = new Option(Biz.Consultant._ddlPLName, 'Select', true, true);
		}
		
		/* MINE */
		if(c_pl = readCookie('mfPL')){
			var pl_trgt = document.getElementById("lcol-ddlPL");
			var meh = pl_trgt.getElementsByTagName("option");
			$("#lcol-ddlPL").val(c_pl);
		}
		/* END MINE */
		
		Biz.Consultant.loadDdlModel();
		//PRODUCT LINE

	},

	loadDdlModel : function(event) {
		var el1 = document.getElementById(Biz.Consultant._ddlMfgrID).options[document.getElementById(Biz.Consultant._ddlMfgrID).selectedIndex].value;
		var el2 = document.getElementById(Biz.Consultant._ddlPLID).options[document.getElementById(Biz.Consultant._ddlPLID).selectedIndex].value;
		if (el1 != 'Select' && el1 != Biz.Consultant._ddlMfgrName, escape(el1) != 'null' && el1 != 'N.A.' && el2 != 'Select' && el2 != Biz.Consultant._ddlPLName && escape(el2) != 'null' && el2 != 'N.A.') {
			var d = document.getElementById(Biz.Consultant._ddlModelID);
			Biz.Consultant.emptyDDL(d, 'Loading...');
			$.getJSON('http://apps2.memorysuppliers.com/ajax/getDropDown.php?json=?', { cat: 'All', mfgr: escape(el1), pl: escape(el2), cv: 'MemorySuppliers' }, Biz.Consultant._loadDdlModel);
			try {
				pt2._trackPageview('/consultant/'+escape(el1)+'/'+escape(el2));
				pt2._trackEvent('Memory Finder - Left Column', 'Model', el2);
			} catch(err) {}
			d.disabled = false;
			createCookie("mfPL", el2, 1);
		}
		else {
			Biz.Consultant.emptyDDL(document.getElementById(Biz.Consultant._ddlModelID), Biz.Consultant._ddlModelName);
		}
	},

	_loadDdlModel : function(data) {
		var d = document.getElementById(Biz.Consultant._ddlModelID);
		d.options.length = 0;
	
		if (data && data.length && data.length > 0) {
			d.options.length = data.length + 1;
			for (var i=0; i<data.length; ++i) {
				d.options[i+1] = new Option(data[i].name, data[i].value, (i == 0), (i == 0));
			}
			d.options[0] = new Option(Biz.Consultant._ddlModelName, 'Select', true, true);
		}
			third_drop = document.getElementById(Biz.Consultant._ddlModelID);
			third_op = third_drop.getElementsByTagName("option");
			if(readCookie("mfMN")){
				third_op[0].innerHTML = readCookie("mfMN");
			}
	},

	init : function(ddl1name, ddl1id, ddl2name, ddl2id, ddl3name, ddl3id) {
		if (document.getElementById(ddl1id) && document.getElementById(ddl2id) && document.getElementById(ddl3id)) {
			Biz.Consultant._ddlMfgrName = ddl1name;
			Biz.Consultant._ddlMfgrID = ddl1id;
			Biz.Consultant._ddlPLName = ddl2name;
			Biz.Consultant._ddlPLID = ddl2id;
			Biz.Consultant._ddlModelName = ddl3name;
			Biz.Consultant._ddlModelID = ddl3id;
			
			Biz.Consultant.initDdlMfgr();
			$('#'+Biz.Consultant._ddlMfgrID).mouseover(Biz.Consultant.loadDdlMfgr);
			$('#'+Biz.Consultant._ddlMfgrID).change(Biz.Consultant.loadDdlPL);
			$('#'+Biz.Consultant._ddlPLID).change(Biz.Consultant.loadDdlModel);
			$('#'+Biz.Consultant._ddlModelID).change(function() {
				var d = document.getElementById(Biz.Consultant._ddlModelID).options[document.getElementById(Biz.Consultant._ddlModelID).selectedIndex];
				createCookie("mfMN", d.innerHTML, 1);
				window.location = "http://www.memorysuppliers.com/list-parts.html?systemid=" + d.value;;
			});
		}
	}
};


// Cookie Set/Get Methods
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	//document.cookie = name+"="+value+expires+"; path=/";
	document.cookie = name+"="+value+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

// end cookie methods


$(document).ready(function() {
	Biz.Consultant.init('Select Manufacturer', 'lcol-ddlMfgr', 'Select Product Line', 'lcol-ddlPL', 'Select Model', 'lcol-ddlModel');
	$('.lcol-mf').append('<a href="http://www.memorysuppliers.com/find-parts.html" class="hboldvfix1" style="padding-left: 10px; font-size: 11px;">or Search by Model</a>');
	Biz.Product.i18n.run();
	$('#mastsearch4').attr('action', 'http://apps2.memorysuppliers.com/search/search.php');

	/* old legacy stuff */
	$('li a[href$="orderstatus"]').hide();
	$('form[action$="rma.php"]').attr('action', 'http://apps2.memorysuppliers.com/forms/process-rma.php');
	$('form[action$="contactus.php"]').attr('action', 'http://apps2.memorysuppliers.com/forms/process-contactus.php');

	if (document.getElementById('mfsearch')) {
		$('#mfsearch').parent().get(0).action = 'http://www.memorysuppliers.com/find-parts.html';
		$('#mfsearch').parent().get(0).name = 'mfsearch';
		$('#mfsearch #submit').get(0).href = 'javascript:document.forms["mfsearch"].submit();';
		$('#mfsearch #text').get(0).name = 'keyword';
	}
	
	
	$('.mfbox2 #mfsearch #help').click(function() {
		window.open('http://apps2.memorysuppliers.com/testing/help-find-system-type.html', 'Help Find System Type','scrollbars=yes,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
		return false;
	});
	
});

$(document).ready(function() {
	if (window.location == 'http://www.memorysuppliers.com/memoryfinder.html') {
		$('.item-header-text').after($('.mfbox3').clone(1));
		$('.mfbox3:last').remove();
	}

	if (document.getElementById('ddlMfgr')) {
		initDdlMfgr();
		$('#ddlMfgr').mouseover(loadDdlMfgr);
		$('#ddlMfgr').change(loadDdlPL);
		$('#ddlPL').change(loadDdlModel);
		$('#ddlModel').change(function() {
			var d = document.getElementById('ddlModel').options[document.getElementById('ddlModel').selectedIndex]; 
			createCookie("mfMN", d.innerHTML, 1);
			window.location = "http://www.memorysuppliers.com/list-parts.html?systemid=" + d.value;
		});

		initDdlMfgrFlash();
		$('#ddlMfgrFlash').mouseover(loadDdlMfgrFlash);
		$('#ddlMfgrFlash').change(loadDdlPLFlash);
		$('#ddlPLFlash').change(loadDdlModelFlash);
		$('#ddlModelFlash').change(function() {
			var d = document.getElementById('ddlModelFlash').options[document.getElementById('ddlModelFlash').selectedIndex];
			window.location = "http://www.memorysuppliers.com/list-parts.html?systemid=" + d.value;
		});
		
	}

		if(readCookie("mfMFGR")){
			// test to make sure you're on  mf result page, and if so set dropdowns
			tCk = readCookie("mfMFGR");
			wndwLoc = window.location.href.substr(0, 46);
			if(tCk.length > 0 && wndwLoc == "http://www.memorysuppliers.com/list-parts.html"){
			  Biz.Consultant.loadDdlMfgr();
			} else {
				//if you're not on the page, you don't need the cookies 
				eraseCookie("mfMFGR");
				eraseCookie("mfPL");
				eraseCookie("mfMN");				
			}
			
		}

	
});