var flashinstalled = 0;
var flashversion = 0;
MSDetect = "false";
if (navigator.plugins && navigator.plugins.length)
{
	x = navigator.plugins["Shockwave Flash"];
	if (x)
	{
		flashinstalled = 2;
		if (x.description)
		{
			y = x.description;
			flashversion = y.charAt(y.indexOf('.')-1);
		}
	}
	else
		flashinstalled = 1;
	
	if (navigator.plugins["Shockwave Flash 2.0"])
	{
		flashinstalled = 2;
		flashversion = 2;
	}
}
else if (navigator.mimeTypes && navigator.mimeTypes.length)
{
	x = navigator.mimeTypes['application/x-shockwave-flash'];
	if (x && x.enabledPlugin)
		flashinstalled = 2;
	else
		flashinstalled = 1;
}
else
	MSDetect = "true";


function Rcertify() 
{
popupWin = window.open('http://www.bbbonline.org/cks.asp?id=10308217521834839', 'Participant','location=yes,scrollbars=yes,width=450,height=300'); 
window.name = 'opener';
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

var timerDelay = 275;
var timerID = 0;

function CallTimeout(obj, image, url) { 
 menu = obj;
 newimage = image;
 newurl = url;
 window.timerID = setTimeout("MM_showMenu(menu,0,25,null,newimage);MM_swapImage(newimage,'',newurl,1);", timerDelay); 
}


function EndTimeout() {
 window.clearTimeout(timerID);
}


function mmLoadMenus() {
  if (window.mm_menu_0327205113_0) return;
  window.mm_menu_0327205113_0 = new Menu("root",171,22,"Arial, Verdana, Helvetica, sans-serif",12,"#404040","#000000","#ebebeb","#cecccd","left","middle",5,0,250,-5,7,true,true,true,0,true,true);
  mm_menu_0327205113_0.addMenuItem("Embroidery&nbsp;Designs","location='/products/abc0146.html'");
  mm_menu_0327205113_0.addMenuItem("Embroidery&nbsp;Machines","location='/products/abc0068.html'");
  mm_menu_0327205113_0.addMenuItem("Free&nbsp;Embroidery&nbsp;Designs","location='http://www.sewforum.com/viewforum.php?f=16'");
  mm_menu_0327205113_0.addMenuItem("Furniture","location='/products/abc0074.html'");
  mm_menu_0327205113_0.addMenuItem("Industrial&nbsp;Sewing","location='/products/abc0070.html'");
  mm_menu_0327205113_0.addMenuItem("Knitting&nbsp;Machines","location='/products/abc0072.html'");
  mm_menu_0327205113_0.addMenuItem("Quilting&nbsp;Equipment","location='/products/abc0073.html'");
  mm_menu_0327205113_0.addMenuItem("Sergers&nbsp;/&nbsp;Overlocks","location='/products/abc0069.html'");
  mm_menu_0327205113_0.addMenuItem("Sewing&nbsp;Accessories","location='/products/abc0094.html'");
  mm_menu_0327205113_0.addMenuItem("Sewing&nbsp;Machines","location='/products/abc0067.html'");
  mm_menu_0327205113_0.addMenuItem("Smocking&nbsp;Pleaters","location='/products/abc0071.html'");
  mm_menu_0327205113_0.addMenuItem("Software","location='/products/abc0145.html'");
   mm_menu_0327205113_0.hideOnMouseOut=true;
   mm_menu_0327205113_0.menuBorder=1;
   mm_menu_0327205113_0.menuLiteBgColor='#ffffff';
   mm_menu_0327205113_0.menuBorderBgColor='#b8b8b8';
   mm_menu_0327205113_0.bgColor='#b8b6b7';
  window.mm_menu_0327205355_1 = new Menu("root",143,22,"Arial, Verdana, Helvetica, sans-serif",12,"#404040","#000000","#ebebeb","#cecccd","left","middle",5,0,250,-5,7,true,true,true,0,true,true);
  mm_menu_0327205355_1.addMenuItem("Backpack&nbsp;Vacs","location='/products/abc0617.html'");
  mm_menu_0327205355_1.addMenuItem("Canister&nbsp;Vacs","location='/products/abc0078.html'");
  mm_menu_0327205355_1.addMenuItem("Commercial&nbsp;Vacs","location='/products/abc0600.html'");
  mm_menu_0327205355_1.addMenuItem("Hand&nbsp;Vacs","location='/products/abc0079.html'");
  mm_menu_0327205355_1.addMenuItem("Steam&nbsp;Vacs","location='/products/abc0774.html'");
  mm_menu_0327205355_1.addMenuItem("Stick&nbsp;Vacs","location='/products/abc0773.html'"); 
  mm_menu_0327205355_1.addMenuItem("Sweepers","location='/products/abc0775.html'");
  mm_menu_0327205355_1.addMenuItem("Upright&nbsp;Vacs","location='/products/abc0772.html'");
  mm_menu_0327205355_1.addMenuItem("Vacuum&nbsp;Accessories","location='/products/abc0082.html'");
  mm_menu_0327205355_1.addMenuItem("Vacuum&nbsp;Brands","location='/products/abc0075.html'"); 
   mm_menu_0327205355_1.hideOnMouseOut=true;
   mm_menu_0327205355_1.menuBorder=1;
   mm_menu_0327205355_1.menuLiteBgColor='#ffffff';
   mm_menu_0327205355_1.menuBorderBgColor='#b8b8b8';
   mm_menu_0327205355_1.bgColor='#b8b6b7';
  window.mm_menu_0327205535_2 = new Menu("root",134,22,"Arial, Verdana, Helvetica, sans-serif",12,"#404040","#000000","#ebebeb","#cecccd","left","middle",5,0,250,-5,7,true,true,true,0,true,true);
  mm_menu_0327205535_2.addMenuItem("Clearance","location='/products/abc0911.html'");
  mm_menu_0327205535_2.addMenuItem("Garment&nbsp;Steamers","location='/products/abc0085.html'");
  mm_menu_0327205535_2.addMenuItem("Ironing&nbsp;Boards","location='/products/abc0711.html'");
  mm_menu_0327205535_2.addMenuItem("Irons&nbsp;/&nbsp;Equipment","location='/products/abc0083.html'");
  mm_menu_0327205535_2.addMenuItem("Ironing&nbsp;Presses","location='/products/abc0084.html'");
  mm_menu_0327205535_2.addMenuItem("Kitchen&nbsp;Electrics","location='/products/abc0087.html'");
  mm_menu_0327205535_2.addMenuItem("Steam&nbsp;Cleaners","location='/products/abc0086.html'");
   mm_menu_0327205535_2.hideOnMouseOut=true;
   mm_menu_0327205535_2.menuBorder=1;
   mm_menu_0327205535_2.menuLiteBgColor='#ffffff';
   mm_menu_0327205535_2.menuBorderBgColor='#b8b8b8';
   mm_menu_0327205535_2.bgColor='#b8b6b7';
  window.mm_menu_0327205651_3 = new Menu("root",124,22,"Arial, Verdana, Helvetica, sans-serif",12,"#404040","#000000","#ebebeb","#cecccd","left","middle",5,0,250,-5,7,true,true,true,0,true,true);
  mm_menu_0327205651_3.addMenuItem("Aero&nbsp;/&nbsp;Air&nbsp;Beds","location='/products/abc0666.html'");
  mm_menu_0327205651_3.addMenuItem("Air&nbsp;Purifiers","location='/products/abc0089.html'");
  mm_menu_0327205651_3.addMenuItem("Home&nbsp;Electronics","location='/products/abc0531.html'");
  mm_menu_0327205651_3.addMenuItem("Lamps&nbsp;/&nbsp;Magnify","location='/products/abc0088.html'");
  mm_menu_0327205651_3.addMenuItem("Lawn&nbsp;&amp;&nbsp;Garden","location='/products/abc1058.html'");
  mm_menu_0327205651_3.addMenuItem("Personal&nbsp;Care","location='/products/abc0090.html'");  
   mm_menu_0327205651_3.hideOnMouseOut=true;
   mm_menu_0327205651_3.menuBorder=1;
   mm_menu_0327205651_3.menuLiteBgColor='#ffffff';
   mm_menu_0327205651_3.menuBorderBgColor='#b8b8b8';
   mm_menu_0327205651_3.bgColor='#b8b6b7';
  window.mm_menu_0327205812_4 = new Menu("root",123,22,"Arial, Verdana, Helvetica, sans-serif",12,"#404040","#000000","#ebebeb","#cecccd","left","middle",5,0,250,-5,7,true,true,true,0,true,true);
  mm_menu_0327205812_4.addMenuItem("Sewing&nbsp;Machines","location='/products/abc1125.html'");  
  mm_menu_0327205812_4.addMenuItem("Vacuums","location='/products/abc1126.html'");
  mm_menu_0327205812_4.addMenuItem("Outlet Store","location='/info/outletstore.php'");
  mm_menu_0327205812_4.addMenuItem("More ...","location='/products/abc1127.html'");
   mm_menu_0327205812_4.hideOnMouseOut=true;
   mm_menu_0327205812_4.menuBorder=1;
   mm_menu_0327205812_4.menuLiteBgColor='#ffffff';
   mm_menu_0327205812_4.menuBorderBgColor='#b8b8b8';
   mm_menu_0327205812_4.bgColor='#b8b6b7';
   mm_menu_0327205113_0.restoreParam = 'restore_img.gif'
   mm_menu_0327205355_1.restoreParam = 'restore_img.gif'
   mm_menu_0327205535_2.restoreParam = 'restore_img.gif'
   mm_menu_0327205651_3.restoreParam = 'restore_img.gif'
   mm_menu_0327205812_4.restoreParam = 'restore_img.gif'

  mm_menu_0327205812_4.writeMenus();
} // mmLoadMenus()


function validateSearch(ab) {
	if(ab.search.value == "" || ab.search.value == "Type Search Here" || ab.search.value.length<2) {
  		alert("Please enter valid search criteria.");
		ab.search.focus();
		return false;
	}
	return true;
}

function showIframe(e)
{
	var iframe = document.getElementById('xmasinfo');
	var x, y;
	if ( e.pageX ) {
		x = e.pageX; y = e.pageY;
	} else {
		x = e.clientX; y = e.clientY;
	}
	iframe.style.left=(x+10)+"px";
	iframe.style.top=(y+10)+"px";
}

function closeIframe()
{	
	var iframe = document.getElementById('xmasinfo');
	iframe.style.left="-3000px";
}

function navLinkGo(path, e)
{
    if(!(e.ctrlKey || e.metaKey || e.altKey || e.shiftKey || e.modifers))
        window.location.assign(path)
}


function add_translate_link()
{
	var lang_links = {
		'es' : 'Habla espa&ntilde;ol?',
		'fr' : 'Voc&ecirc; fala portugu&eacute;s?',
		'de' : 'Spreken sie deutsch?',
		'it' : 'Parlate il italiano?',
		'ja' : 'Japanese Translation',
		'ko' : 'Korean Translation',
		'zh' : 'Chinese Translation'
	}

	var full_lang = window.navigator.language
	if(!full_lang)
		full_lang = window.navigator.userLanguage
	if(!full_lang)
		full_lang = window.navigator.browserLanguage
	if(!full_lang)
		full_lang = window.navigator.systemLanguage
	if(!full_lang)
		return;
	
	var lang_code = full_lang.split('-')[0].toLowerCase()
	var link_text = lang_links[lang_code]

	if(link_text)
	{
		var current_location = encodeURIComponent(window.location)
		var href = 'http://translate.google.com/translate?u=' + current_location + '&langpair=en%7C' + lang_code + '&hl=en&ie=latin1&oe=UTF-8&prev=/language_tools'
		
		var stores_link_element = document.getElementById('storeslink')
		stores_link_element.href = href
		stores_link_element.innerHTML = link_text
	}
}
