// JavaScript Document

// JavaScript Document
// JavaScript Document
/* ****************************************** */
/*      RollOvers, because Inept Explorer 6   */
/*      Doesn't want to play ball             */
/* ****************************************** */

/* this can most likely be deleted */
	function ieSixRoll(idname){
		document.getElementById(idname).style.display = "block";
	}
	
	function ieSixRollOut(idname){
		document.getElementById(idname).style.display = "none";
	}


/* for the contactus.html contact form */

function checkEmail(str)
{
	var echk = true;
	var emailFilter = /^.+@.+\..{2,3}$/;
	var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
	if (str == "")
	{
		echk = false;
	}
	if (!emailFilter.test(str))
	{
		echk = false;
	}
	if (str.match(illegalChars))
	{
		echk = false;
	}
	return echk;
}

/* ****************************************** */
/*      Header Animation 					  */
/* ****************************************** */

/* each image for rotation defined here */
pic1 = new Image(217, 158);
pic1.src = "http://lib.store.yahoo.net/lib/memorysuppliers/slidecameragirl.jpg";
pic2 = new Image(217, 158);
pic2.src = "http://lib.store.yahoo.net/lib/memorysuppliers/slideflashy.jpg";
pic3 = new Image(217, 158);
pic3.src = "http://lib.store.yahoo.net/lib/memorysuppliers/slidehandcomputer.jpg";
pic4 = new Image(217, 158);
pic4.src = "http://lib.store.yahoo.net/lib/memorysuppliers/slidecameramem.jpg";

custpic1 = new Image(298, 126);
custpic1.src = "http://apps2.memorysuppliers.com/img/headerAnimation/customheaderimage1.jpg";
custpic2 = new Image(298, 126);
custpic2.src = "http://apps2.memorysuppliers.com/img/headerAnimation/customheaderimage2.jpg";

pic_counter = "0";
fd_timer = "";

/* variables to hold reference to fade out divs in headers */
var fadeoutobject;
var fadeoutsubobject;

function  rotatePicture(ptarget, parray){
		pic_counter ++;
		if(pic_counter > picture_array.length-1){
		pic_counter = 0;
		}
		document.getElementById(ptarget).style.backgroundImage = "url("+parray[pic_counter].src+")";
		fd_timer = setInterval("fadeIn()", 100);
}


fdo = 0
function fadeIn(){
	pid = document.getElementById(fadeoutsubobject);
	pidtwo = document.getElementById(fadeoutobject);
	if(fdo < 1){
	fdo += .1;
	pid.style.opacity = fdo;
	pid.style.filter = "alpha(opacity="+fdo*100+")";
	} else {
		document.getElementById(fadeoutobject).style.backgroundImage = pid.style.backgroundImage;
		pid.style.opacity = 0;
		pid.style.filter = "alpha(opacity = 0)";
		fdo = 0;
		clearInterval(fd_timer);
	}
	
}

function playAnimation(){
pic_timer = setInterval("rotatePicture('"+fadeoutsubobject+"', picture_array)", 15000);
}

/* END ANIMATION */

/* validate forms */
function checkit(){
	cn = document.getElementById('name').value;
	ce = document.getElementById('email').value;
	cr = document.getElementById('creq').value;
	
	if(cn == ""){
		document.getElementById("nameError").style.display = "inline";
		document.getElementById("nameRow").style.backgroundColor = "#ffdddd";
		document.getElementById("name").select();
		document.getElementById("name").focus();
		return false;
	} else if(!checkEmail(ce)){
		document.getElementById("emailError").style.display = "inline";
		document.getElementById("emailRow").style.backgroundColor = "#ffdddd";
		document.getElementById("email").select();
		document.getElementById("email").focus();
		return false;
	} else if(cr ==""){
		document.getElementById("reqError").style.display = "inline";

		document.getElementById("reqRow").style.backgroundColor = "#ffdddd";
		document.getElementById("creq").select();
		document.getElementById("creq").focus();
		return false;
	} else {
		return true;
	}
}


/* *************************************************** */
/*           New Main Menu Roll Over                   */
/* *************************************************** */

// used to track which submenu to close
// after a new menu item is selected	
var dplsubtarget = "";

// used to store the setTimeout() method that
// keeps a rolled-out menu open a 1/2 second longer
var userout = "";

//method that displays an Item's submenu
function rollMe(trgt){
	
	if(dplsubtarget){
		clearInterval(userout);
		
		if(dplsubtarget.parentNode.className == "mainmenuItem"){
			delayOut(dplsubtarget.parentNode);
			
		} else if (dplsubtarget.parentNode.className == "mainmenuItem lastmenuItem"){
			twolineDelayOut(dplsubtarget.parentNode);
		
		}	
	}
	
	var submenu = trgt.childNodes[2];
	var mainItem = trgt;
	dplsubtarget = submenu;
	submenu.style.display = "block";
}

function twolineRoll(trgt){

	if(dplsubtarget){
		clearInterval(userout);
		delayOut(dplsubtarget.parentNode);
	}
	
	if(trgt.childNodes[2]){
	var submenu = trgt.childNodes[2];
	var mainItem = trgt;
	dplsubtarget = submenu;
	submenu.style.display = "block";
	}

}	
	
//closes submenu - Despite the name, this method
//technically doesn't have a 'delay' - deal with it
function delayOut(trgt){
		

	trgt.childNodes[2].style.display = "none";
	trgt.style.border = "none";

	trgt.style.backgroundColor = "transparent";
	trgt.style.padding = "2px 0px 4px 10px";
	mlink = trgt.getElementsByTagName('a');
	mlink[0].style.color = "#ffffff";
}

function twolineDelayOut(trgt){
	trgt.childNodes[2].style.display = "none";
	trgt.style.border = "none";
	trgt.style.backgroundColor = "transparent";
	trgt.style.padding = "2px 0px 4px 10px";
	mlink = trgt.getElementsByTagName('a');
	mlink[0].style.color = "#d7edff";
}

function holidayRoll(nm){
	trgt = document.getElementById(nm); 
	trgt.style.border = "none";
	trgt.style.backgroundColor = "transparent";
	trgt.style.padding = "2px 0px 4px 10px";
	mlink = trgt.getElementsByTagName('a');
	mlink[0].style.color = "#d7edff";
}

	
	
//attaches mouseover/out methods to the main menu
/* I think this is used on custom pages only */
function setMainMenu(){	
	var mainItems = document.getElementsByTagName('li');

	for(i=0; i < mainItems.length; i++){



		if(mainItems[i].className == "mainmenuItem"){
	
			mainItems[i].onmouseover = function(){
				rollMe(this);
				if(this.id == "holidaylink"){
					this.style.backgroundColor = "#ff0033";
				} else {
					this.style.backgroundColor = "#e8f1fa";
				}
				this.style.borderTop = "1px solid #000000";
				this.style.borderBottom = "1px solid #000000";
				this.style.padding = "1px 0px 3px 10px";
				mlink = this.getElementsByTagName('a');
				mlink[0].style.color = "#000000";

			} 
				
			mainItems[i].onmouseout = function(){
				
				//needed for JS to properly scope things
				//as simply adding the method to setTimeout
				//will generate errors - silly JS
				myOb = this;
				userout = setTimeout(function(){delayOut(myOb)}, 500);
			}
		
		} else if(mainItems[i].className == "mainmenuItem lastmenuItem"){
			
			mainItems[i].onmouseover = function(){
				twolineRoll(this);
				

				this.style.backgroundColor = "#e8f1fa";
				this.style.borderTop = "1px solid #000000";
				this.style.borderBottom = "1px solid #000000";
				this.style.padding = "1px 0px 3px 10px";
				mlink = this.getElementsByTagName('a');
				mlink[0].style.color = "#000000";
				
			}
			
			mainItems[i].onmouseout = function(){
				
				//needed for JS to properly scope things
				//as simply adding the method to setTimeout
				//will generate errors - silly JS
				myOb = this;
				userout = setTimeout(function(){twolineDelayOut(myOb)}, 500);
				holidayRoll("holidaylink");
			}
			
		}
		
	}
}


/*********************************************/
/*    Custom Product Quote      5.11.09      */
/*********************************************/
function clearTheTextArea(){
	
	ta_list = document.getElementsByTagName("textarea");
	
	for(i = 0; i<ta_list.length; i++){
		
		ta_list[i].onfocus = function(){
			this.innerHTML = "";	
		}
		
	}

}

/********************************************/ 
/*      Header search methods               */
/********************************************/

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(5($){$.7=$.7||{};$.1M.4=5(a,b){3(a&&a.X==2Y){b=a;a=J}b=b||{};a=a&&a.X==1W&&--a||0;x 2.R(5(){37 $.7.4(2,$.19(b,{z:a}))})};$.R([\'2T\',\'2S\',\'2N\',\'2E\',\'2x\',\'2r\',\'2l\'],5(i,c){$.1M[\'4\'+c]=5(){6 b=1N;x 2.R(5(){6 a=$.7.4.1o(2);a[c.2a()].36(a,b)})}});$.1M.33=5(){6 b=-1;3(2[0]){6 a=$.7.4.1o(2[0]),$m=$(\'t\',2);b=$m.1k($m.16(\'.\'+a.y.v)[0]);$m=J}x b>=0?++b:-1};$.7.4=5(a,b){2.H=a;2.y=$.19({z:0,M:\'N\',1g:[],G:J,14:E,15:b.14?1y:E,1c:\'2k&#2j;\',1Q:E,1P:\'7-4-\',1m:{},1s:\'2f\',W:5(){},Y:5(){},1n:5(){},1a:5(){},N:5(){},D:5(){},B:5(){},T:5(){},27:\'<t><a l="#{l}"><S>#{25}</S></a></t>\',1J:\'<24></24>\',1I:\'7-4-2X\',v:\'7-4-2W\',1x:\'7-4-15\',12:\'7-4-1g\',18:\'7-4-1F\',P:\'7-4-D\',1e:\'7-4-2R\'},b);2.y.M+=\'.7-4\';2.y.G=$.G&&$.G.X==1C&&2.y.G;$.q(a,$.7.4.13,2);2.1i(1y)};$.7.4.13=\'2L\';$.7.4.1o=5(a){x $.q(a,$.7.4.13)};$.19($.7.4.2I,{1z:5(a){x a.1h&&a.1h.V(/\\s/g,\'23\').V(/[^A-2u-2s-9\\-23:\\.]/g,\'\')||2.y.1P+$.q(a)},1i:5(g){2.$m=$(\'t:2o(a[l])\',2.H);2.$4=2.$m.2m(5(){x $(\'a\',2)[0]});2.$8=$([]);6 f=2,o=2.y;2.$4.R(5(i,a){3(a.I&&a.I.V(\'#\',\'\')){f.$8=f.$8.W(a.I)}w 3($(a).U(\'l\')!=\'#\'){$.q(a,\'l\',a.l);6 b=f.1z(a);a.l=\'#\'+b;f.$8=f.$8.W($(\'#\'+b)[0]||$(o.1J).U(\'10\',b).u(o.18).2i(f.$8[i-1]||f.H))}w{o.1g.2h(i+1)}});3(g){$(2.H).L(o.1I)||$(2.H).u(o.1I);2.$8.R(5(){6 a=$(2);a.L(o.18)||a.u(o.18)});2g(6 i=0,1t;1t=o.1g[i];i++){2.1a(1t)}2.$4.R(5(i,a){3(1r.I){3(a.I==1r.I){o.z=i;3($.O.Z||$.O.2e){6 b=$(1r.I),1O=b.U(\'10\');b.U(\'10\',\'\');1p(5(){b.U(\'10\',1O)},2d)}2c(0,0);x E}}w 3(o.G){6 p=2b($.G($.7.4.13+$.q(f.H)));3(p&&f.$4[p]){o.z=p;x E}}w 3(f.$m.C(i).L(o.v)){o.z=i;x E}});6 n=2.$m.F;29(2.$m.C(o.z).L(o.12)&&n){o.z=++o.z<2.$m.F?o.z:0;n--}3(!n){o.14=o.15=1y}2.$8.u(o.P);2.$m.K(o.v);3(!o.14){2.$8.C(o.z).B().K(o.P);2.$m.C(o.z).u(o.v)}6 j=!o.14&&$.q(2.$4[o.z],\'l\');3(j){2.T(o.z+1,j)}3(!/^N/.35(o.M)){2.$4.28(\'N\',5(e){e.34()})}$(32).31(5(){f.$4.26(o.M);f.$m=f.$4=f.$8=J})}6 k={},1K=o.30||o.1s,Q={},1q=o.2Z||o.1s;3(o.1v||o.1w){3(o.1v){k[\'1u\']=\'B\';Q[\'1u\']=\'D\'}3(o.1w){k[\'11\']=\'B\';Q[\'11\']=\'D\'}}w{3(o.1H){k=o.1H}w{k[\'22-21\']=0;1K=1}3(o.1Z){Q=o.1Z}w{Q[\'22-21\']=0;1q=1}}6 h={1d:\'\',2U:\'\',1u:\'\'};3(!$.O.Z){h[\'11\']=\'\'}5 1G(b,c,a){c.1Y(Q,1q,5(){c.u(o.P).17(h);3($.O.Z&&Q[\'11\']){c[0].1X.16=\'\'}o.D(b,c[0],a&&a[0]||J);3(a){1j(b,a,c)}})}5 1j(b,a,c){3(!(o.1v||o.1w||o.1H)){a.17(\'1d\',\'1E\')}a.1Y(k,1K,5(){a.K(o.P).17(h);3($.O.Z&&k[\'11\']){a[0].1X.16=\'\'}o.B(b,a[0],c&&c[0]||J)})}5 1D(c,a,d,b){a.u(o.v).2Q().K(o.v);1G(c,d,b)}2.$4.26(o.M).28(o.M,5(){6 b=$(2).2P(\'t:C(0)\'),$D=f.$8.16(\':2O\'),$B=$(2.I);3((b.L(o.v)&&!o.15)||b.L(o.12)||o.N(2,$B[0],$D[0])===E){2.1f();x E}3(o.G){$.G($.7.4.13+$.q(f.H),f.$4.1k(2),o.G)}3(o.15){3(b.L(o.v)){b.K(o.v);f.$8.1B();1G(2,$D);2.1f();x E}w 3(!$D.F){f.$8.1B();3($.q(2,\'l\')){6 a=2;f.T(f.$4.1k(2)+1,$.q(2,\'l\'),5(){b.u(o.v).u(o.1x);1j(a,$B)})}w{b.u(o.v).u(o.1x);1j(2,$B)}2.1f();x E}}f.$8.1B();3($B.F){3($.q(2,\'l\')){6 a=2;f.T(f.$4.1k(2)+1,$.q(2,\'l\'),5(){1D(a,b,$D,$B)})}w{1D(2,b,$D,$B)}}w{1V\'1A 1U 1S: 2M 2K 2J.\';}3($.O.Z){2.1f()}x E})},W:5(d,b,f){3(d&&b){f=f||2.$4.F;6 o=2.y,$t=$(o.27.V(/#\\{l\\}/,d).V(/#\\{25\\}/,b));6 a=d.2H(\'#\')==0?d.V(\'#\',\'\'):2.1z($(\'a:2G-2F\',$t)[0]);6 c=$(\'#\'+a);c=c.F&&c||$(o.1J).U(\'10\',a).u(o.18).u(o.P);3(f>=2.$m.F){$t.1T(2.H);c.1T(2.H.2D)}w{$t.1R(2.$m[f-1]);c.1R(2.$8[f-1])}2.1i();3(2.$4.F==1){$t.u(o.v);c.K(o.P);6 e=$.q(2.$4[0],\'l\');3(e){2.T(f+1,e)}}o.W(2.$4[f],2.$8[f])}w{1V\'1A 1U 1S: 2C 2B 1N 2A W 2z.\';}},Y:5(a){3(a&&a.X==1W){6 o=2.y,$t=2.$m.C(a-1).Y(),$1F=2.$8.C(a-1).Y();3($t.L(o.v)&&2.$4.F>1){2.N(a+(a<2.$4.F?1:-1))}2.1i();o.Y($t.2y()[0],$1F[0])}},1n:5(a){6 o=2.y,$t=2.$m.C(a-1);$t.K(o.12);3($.O.2V){$t.17(\'1d\',\'2w-1E\');1p(5(){$t.17(\'1d\',\'1E\')},0)}o.1n(2.$4[a-1],2.$8[a-1])},1a:5(a){6 o=2.y;2.$m.C(a-1).u(o.12);o.1a(2.$4[a-1],2.$8[a-1])},N:5(a){2.$4.C(a-1).2v(2.y.M)},T:5(g,d,b){6 e=2,o=2.y,$a=2.$4.C(g-1),a=$a[0],$S=$(\'S\',a);3(d&&d.X==1C){b=d;d=J}3(d){$.q(a,\'l\',d)}w{d=$.q(a,\'l\')}3(o.1c){$.q(a,\'1h\',$S.1l());$S.1l(\'<20>\'+o.1c+\'</20>\')}6 c=5(){e.$4.16(\'.\'+o.1e).R(5(){$(2).K(o.1e);3(o.1c){$(\'S\',2).1l($.q(2,\'1h\'))}});e.1b=J};6 f=$.19({},o.1m,{2t:d,1L:5(r,s){$(a.I).1l(r);c();3(b&&b.X==1C){b()}3(o.1Q){$.2q(a,\'l\')}o.T(e.$4[g-1],e.$8[g-1]);o.1m.1L&&o.1m.1L(r,s)}});3(2.1b){2.1b.2p();c()}$a.u(o.1e);1p(5(){e.1b=$.2n(f)},0)},l:5(b,a){$.q(2.$4.C(b-1)[0],\'l\',a)}})})(1A);',62,194,'||this|if|tabs|function|var|ui|panels|||||||||||||href|lis||||data|||li|addClass|selectedClass|else|return|options|initial||show|eq|hide|false|length|cookie|source|hash|null|removeClass|hasClass|event|click|browser|hideClass|hideAnim|each|span|load|attr|replace|add|constructor|remove|msie|id|opacity|disabledClass|INSTANCE_KEY|unselected|unselect|filter|css|panelClass|extend|disable|xhr|spinner|display|loadingClass|blur|disabled|title|tabify|showTab|index|html|ajaxOptions|enable|getInstance|setTimeout|hideSpeed|location|fxSpeed|position|height|fxSlide|fxFade|unselectClass|true|tabId|jQuery|stop|Function|switchTab|block|panel|hideTab|fxShow|navClass|panelTemplate|showSpeed|success|fn|arguments|toShowId|idPrefix|cache|insertBefore|Tabs|appendTo|UI|throw|Number|style|animate|fxHide|em|width|min|_|div|text|unbind|tabTemplate|bind|while|toLowerCase|parseInt|scrollTo|500|opera|normal|for|push|insertAfter|8230|Loading|Href|map|ajax|has|abort|removeData|Load|z0|url|Za|trigger|inline|Click|end|tab|to|enough|Not|parentNode|Disable|child|first|indexOf|prototype|identifier|fragment|ui_tabs_instance|Mismatching|Enable|visible|parents|siblings|loading|Remove|Add|overflow|safari|selected|nav|Object|fxHideSpeed|fxShowSpeed|unload|window|tabsSelected|preventDefault|test|apply|new'.split('|'),0,{}))

$(document).ready(function(){
	$('.description-group > ul').tabs();
	
	if(document.getElementById('preload')) {
		$("#preload").remove();
	}
	
	if(document.getElementById("custompagequoteformtable")){
		clearTheTextArea();
		
	} else if(document.getElementById("shapeformtable")){
		clearTheTextArea();
	
	} else if(document.getElementById("custom-card-table")){
		clearTheTextArea();
	}

	$(".itemimages-thumb-link").mouseover(function(e) {
		var thumbImage = $(this).find("img");
		var thumbFeatureId=thumbImage.attr("rel");
		var thumbFeatureImage=$('#'+thumbFeatureId);
		var featureImageLink=$(".itemimages-feature-link");
		var featureImage=featureImageLink.find("img");
		if(thumbFeatureImage.attr("src")) {
			featureImage.attr("width",thumbFeatureImage.attr("width"));
			featureImage.attr("height",thumbFeatureImage.attr("height"));
			featureImage.attr("src",thumbFeatureImage.attr("src"));
			featureImageLink.attr("href",$(this).attr("href"));
			$(".itemimages-feature-enlarge-link").attr("href",$(this).attr("href"));
		}
	});
});

function popUp(URL) {
	day=new Date();
	id=day.getTime();
	eval("page"+id+" = window.open(URL, '"+id+"', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=660,height=630,left = 310,top = 197');");
}

dplcsttst = new Array();
dplcsttst[0] = "<em>\"I could not be happier with the custom USB flash drives we received for our open house event.\"</em><br/><span style='font-size: 9px; text-align: right;'>-Tracey G.Jackson<br/>Northwestern University</span>";
dplcsttst[1] = "<em>\"Thanks for going above and beyond what was expected. We look forward to working with you again on similar projects.\"</em><br/><span style='font-size: 9px; text-align: right;'>-Darren H.<br/>NCC Networks, Inc.</span>";
dplcsttst[2] = "<em>\"I wanted to personally take the time to thank Memory Suppliers for their exceptional customer service and turnaround time.\"</em><br/><span style='font-size: 9px; text-align: right;'>-Aizaz A.<br/>Loudoun County Public Schools</span>";

function settest(){
	n = dplcsttst.length;
	document.getElementById('testtarget').innerHTML = dplcsttst[Math.floor(Math.random()*n)];
}

function checkqqEmail()
{
	var str = document.getElementById("qqemail").value;
	var notValid = document.getElementById("qqerror");
	var echk = true;
	var emailFilter = /^.+@.+\..{2,3}$/;
	var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
	if (str == "")
	{
		notValid.style.display = "inline";
		echk = false;
	}
	if (!emailFilter.test(str))
	{
		notValid.style.display = "inline";
		echk = false;
	}
	if (str.match(illegalChars))
	{
		notValid.style.display = "inline";
		echk = false;
	}
	return echk;
}


function checkqqNameAndEmail(cpName){
	/* make room for company */
	/* if field is passed, set a variable */
	if(cpName){
		var strCompany = document.getElementById(cpName).value;	
		var notValidCompany = document.getElementById("qqerror3");
	}
	var strEmail = document.getElementById("qqemail").value;
	var strName = document.getElementById("qqname").value;
	var notValidEmail = document.getElementById("qqerror");
	var notValidName = document.getElementById("qqerror2");
	var echk = true;
	var emailFilter = /^.+@.+\..{2,3}$/;
	var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/;

	if (strName == ""){   
		notValidName.style.display = "inline";
		echk = false;
	}

	if (strName.match(illegalChars)){
		notValidName.style.display = "inline";
		echk = false;
	}

	if(cpName && strCompany == ""){ 
		notValidCompany.style.display = "inline";
		echk = false;
	}
	
	if (strEmail == ""){
		notValidEmail.style.display = "inline";
		echk = false;
	}
	if (!emailFilter.test(strEmail))
	{
		notValidEmail.style.display = "inline";
		echk = false;
	}
	if (strEmail.match(illegalChars))
	{
		notValidEmail.style.display = "inline";
		echk = false;
	}

	return echk;	
	
}

/* **************************** */
/*    check the quantity quote  */
/*    3.6.09                    */
/* **************************** */
function checkquantityNameAndEmail(cpName){
	var strEmail = document.getElementById("qqemail").value;
	var strName = document.getElementById("qqname").value;
	var qFieldName = document.getElementById('qqname');
	var qFieldEmail = document.getElementById('qqemail');
	var echk = true;
	var emailFilter = /^.+@.+\..{2,3}$/;
	var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/;

	if (strName == "" || strName == "*Name" || strName == "Required Field" ){   
		qFieldName.style.color = "#ff0033";
		qFieldName.value = "Required Field";
		echk = false;
	}

	if (strName.match(illegalChars)){
		qFieldName.style.color = "#ff0033";
		qFieldName.value = "Required Field";
		echk = false;
	}
	
	if (strEmail == ""){
		qFieldEmail.style.color = "#ff0033";
		qFieldEmail.value = "Required Field";
		echk = false;
	}
	if (!emailFilter.test(strEmail))
	{
		qFieldEmail.style.color = "#ff0033";
		qFieldEmail.value = "Required Field";
		echk = false;
	}
	if (strEmail.match(illegalChars))
	{
		qFieldEmail.style.color = "#ff0033";
		qFieldEmail.value = "Required Field";
		echk = false;
	}

	return echk;	
	
}


/*   Product Page Quote   */
/*    3.19.09             */
/* ********************** */

function checkNameAndEmail(frm){
	entered_name 	= frm.eman;
	entered_email 	= frm.liame;
	mailstring		= entered_email.value;
	return_value	= true;
	
	emailFilter 	= /^.+@.+\..{2,3}$/;
	illegalChars	= /[\(\)\<\>\,\;\:\\\"\[\]]/;
				
	if(entered_name.value == "" || entered_name.value == "Required Field"){
		entered_name.style.color = "red";
		entered_name.value = "Required Field";
		return_value = false;
					
	}
				
	if (!emailFilter.test(mailstring)){
		entered_email.style.color = "red";
		entered_email.value = "Required Field";
		return_value = false;
	}
	if (mailstring.match(illegalChars)){
		entered_email.style.color = "red";
		entered_email.value = "Required Field";
		return_value = false;
	}
				
	return return_value;
}


/* ************************** */
/*      Product Page Tabs     */
/*       3.20.09              */
/* ************************** */
	function prodTabSelected(selTab, tabPanel){
		document.getElementById("ptabOne").style.display = "none";
		document.getElementById("ptabTwo").style.display = "none";
		document.getElementById("ptabThree").style.display = "none";
		document.getElementById("ptabFour").style.display = "none";
		document.getElementById("ptabFive").style.display = "none";	
		if(document.getElementById("ptabSix")){
			document.getElementById("ptabSix").style.display  = "none";
		}
		
		document.getElementById('tab1').onmouseover = function(){
			prodTabRoll(this);
		}
		document.getElementById('tab1').onmouseover = function(){
			prodTabRoll(this);
		}
		document.getElementById('tab2').onmouseover = function(){
			prodTabRoll(this);
		}
		document.getElementById('tab3').onmouseover = function(){
			prodTabRoll(this);
		}
		document.getElementById('tab4').onmouseover = function(){
			prodTabRoll(this);
		}
		document.getElementById('tab5').onmouseover = function(){
			prodTabRoll(this);
		}	
		if(document.getElementById('tab6')){
			document.getElementById('tab6').onmouseover = function(){
				prodTabRoll(this);
			}
		}

		document.getElementById('tab1').style.backgroundPosition = "left bottom";
		document.getElementById('tab2').style.backgroundPosition = "left bottom";
		document.getElementById('tab3').style.backgroundPosition = "left bottom";
		document.getElementById('tab4').style.backgroundPosition = "left bottom";
		document.getElementById('tab5').style.backgroundPosition = "left bottom";
		if(document.getElementById('tab6')){
			document.getElementById('tab6').style.backgroundPosition = "left bottom";
		}

		selTab.onmouseout = null;
		selTab.onmouseover = null;
		selTab.style.backgroundPosition = "left top";
		document.getElementById(tabPanel).style.display = "block";
	}
	
	
	function prodTabRoll(tb){
		tb.style.backgroundPosition = "left top";
		tb.onmouseout = function(){
			tb.style.backgroundPosition = "left bottom";
		}
	}


/* ************************** */
/*      Shape Page Tabs       */
/*       3.20.09              */
/* ************************** */
	function shapeTabSelected(selTab, tabPanel){
		document.getElementById("shapeTab1").style.display = "none";
		document.getElementById("shapeTab2").style.display = "none";
		document.getElementById("shapeTab3").style.display = "none";
		document.getElementById("shapeTab4").style.display = "none";
		
		document.getElementById('tab1').onmouseover = function(){
			shapeTabRoll(this);
		}
		document.getElementById('tab1').onmouseover = function(){
			shapeTabRoll(this);
		}
		document.getElementById('tab2').onmouseover = function(){
			shapeTabRoll(this);
		}
		document.getElementById('tab3').onmouseover = function(){
			shapeTabRoll(this);
		}
		document.getElementById('tab4').onmouseover = function(){
			shapeTabRoll(this);
		}

		document.getElementById('tab1').style.backgroundPosition = "left top";
		document.getElementById('tab2').style.backgroundPosition = "left top";
		document.getElementById('tab3').style.backgroundPosition = "left top";
		document.getElementById('tab4').style.backgroundPosition = "left top";

		selTab.onmouseout = null;
		selTab.onmouseover = null;
		selTab.style.backgroundPosition = "left bottom";
		document.getElementById(tabPanel).style.display = "block";
	}
	
	
	function shapeTabRoll(tb){
		tb.style.backgroundPosition = "left bottom";
		tb.onmouseout = function(){
			tb.style.backgroundPosition = "left top";
		}
	}

/* Pay Pal Pop Up Window */
function paypalpop(urlstring) {
window.open( urlstring, "paypalWindow", 
"scrollbars=yes,menubar=no,height=440,width=550,resizable=yes,toolbar=no,location=no,status=no" )
}
var paypalurl = "https://www.paypal.com/us/cgi-bin/webscr?cmd=xpt/cps/popup/Promo/NoPaymentsForNinetyDays-outside&channel=2&promo=1101";
/* end Pay Pal Pop Up Window */

function technoPop(techstring){
	window.open(techstring, "technoWindow");
}

//var technoUrl = "http://www.technologo.com/newtl/oneClickCatalog_View.jsp?rnd=9&fwid=20550011842053&pgn=1&sr=&imid=&fid=&wo=";
var technoUrl = "logopreview.html";

$(document).ready(function() {
	$("#body-cell textarea[width$='height: 200px;']").attr('readonly', 'readonly');
	$('textarea[style="width: 100%; height: 200px;"]').attr('readonly', 'readonly');
					
	$('#hmMU').hover(function() { $(this).css("background-position", "bottom"); }, function() { $(this).css("background-position", "top"); });
	$('#hmDFC').hover(function() { $(this).css("background-position", "bottom"); }, function() { $(this).css("background-position", "top"); });
	$('#hmBC').hover(function() { $(this).css("background-position", "bottom"); }, function() { $(this).css("background-position", "top"); });
	$('#hmMP').hover(function() { $(this).css("background-position", "bottom"); }, function() { $(this).css("background-position", "top"); });	
	$('#hmCP').hover(function() { $(this).css("background-position", "bottom"); }, function() { $(this).css("background-position", "top"); });
	$('#hmGSA').hover(function() { $(this).css("background-position", "bottom"); }, function() { $(this).css("background-position", "top"); });
	$('#hmCC').hover(function() { $(this).css("background-position", "bottom"); }, function() { $(this).css("background-position", "top"); });

if(document.getElementById("headerslideshow")){
	
	fadeoutobject 		= "headerslideshow";
	fadeoutsubobject 	= "headerslideshowsub";
	picture_array = new Array(pic1, pic2, pic3, pic4);
	
} else {

	fadeoutobject 		= "headerslideshow2";
	fadeoutsubobject 	= "headerslideshowsub2";
	//picture_array = new Array(pic1, pic2, pic3, pic4);
	picture_array = new Array(custpic1, custpic2);

}

playAnimation();  
setMainMenu();

//insert element in quote form to ensure it processes
$("#k2qq").append("<input type='hidden' name='sftest' value='submittal form' />");
$("#custompagequoteform").append("<input type='hidden' name='sftest' value='submittal form' />");

if(document.getElementById("qqaddinfo")){
	document.getElementById("qqaddinfo").onfocus = function(){
			document.getElementById("qqaddinfo").value = "";
	}
}
});