<!-- hide this script from non-javascript-enabled browsers
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;
}
/* Functions that swaps images. */
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];}}
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
function popWindow(page, width, height, win, scrollbars, resizable, toolbar, menubar)
{
	if (!height)
		height = 396;
	if (!width)
		width = 360;
	if (!win)
		win = "_new"
	var h, w, scrol, siz;
	w = "WIDTH=" + width.toString();
	h = "HEIGHT=" + height.toString();
	scrol = ",scrollbars=" + ( (scrollbars) ? "yes" : "no" );
	siz = ",resizable=" + ( (resizable) ? "yes" : "no" );
	tool = ",toolbar=" + ( (toolbar) ? "yes" : "no" );
	menu = ",menubar=" + ( (menubar) ? "yes" : "no" );
	attr = w + "," + h + scrol + siz + tool + menu;
	popupWin = window.open(page,win,attr);
	popupWin.focus();
}
function popBook(myPage)
{
	popWindow(myPage,360,396,'bookfeature');
}

//-this function used in the sector block of craigmichaels
function toggleEvent(eid,type)
{
	var field = document.getElementById('e_' + eid);
	var ffield = document.getElementById('e_featured');
	
	if (type == 'none')
	{
		field.style.display = type;
		ffield.style.display = '';
	}
	else if (type == '')
	{
		field.style.display = type;
		ffield.style.display = 'none';	
	}
}

function getObj(name)
{
  myObj = new Object();
  if (document.getElementById)
    {
      myObj.obj = document.getElementById(name);
      if(myObj.obj != null)
	myObj.style = document.getElementById(name).style;
    }
  else if (document.all)
    {
      myObj.obj = document.all[name];
      if(myObj.obj != null)
	myObj.style = document.all[name].style;
    }
  else if (document.layers)
    {
      myObj.obj = document.layers[name];
      if(myObj.obj != null)
	myObj.style = document.layers[name];
    }
  if (!myObj.obj) return null;
  return myObj;
}

//MM_reloadPage(true);

// stop hiding -->
function addBookmark(title,url) {
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}

function ToggleProductView(section, image, zoom, pos) {
	switch(section) {
		case 'view1':
			if (document.getElementById('view1') != null) document.getElementById('view1').src = '/images/product-view-top-active.jpg';
			if (document.getElementById('view2') != null) document.getElementById('view2').src = '/images/product-view-middle.jpg';
			if (document.getElementById('view3') != null) document.getElementById('view3').src = '/images/product-view-bottom.jpg';
		break;
		case 'view2':
			if (document.getElementById('view1') != null) document.getElementById('view1').src = '/images/product-view-top.jpg';
			if (document.getElementById('view2') != null) document.getElementById('view2').src = '/images/product-view-middle-active.jpg';
			if (document.getElementById('view3') != null) document.getElementById('view3').src = '/images/product-view-bottom.jpg';
		break;
		case 'view3':
			if (document.getElementById('view1') != null) document.getElementById('view1').src = '/images/product-view-top.jpg';
			if (document.getElementById('view2') != null) document.getElementById('view2').src = '/images/product-view-middle.jpg';
			if (document.getElementById('view3') != null) document.getElementById('view3').src = '/images/product-view-bottom-active.jpg';
		break;
	}
	document.product_image.src = image;
	document.getElementById('zoom').href = zoom;
	document.getElementById('zoom').getAttributeNode("position").value = pos;

}

function ImageToggle(section, image) {
	document[section].src = image;
	document[section].style.cursor = 'pointer';
}

function ToggleCollapse(section) {
	switch(section) {
		case 'similar':
			if (document.getElementById('similar').style.display == 'none') {
				document.getElementById('similar').style.display = 'block';
				document.getElementById('similartext').innerHTML = '[-] HIDE SIMILAR ITEMS';
				document.getElementById('similarpreview').style.display = 'none';
			}
			else {
				document.getElementById('similar').style.display = 'none';
				document.getElementById('similartext').innerHTML = '[+] SHOW SIMILAR ITEMS';
				document.getElementById('similarpreview').style.display = 'block';
			}
		break;
		case 'productinfo':
			if (document.getElementById('productinfo').style.display == 'none') {
				document.getElementById('productinfo').style.display = 'block';
				document.getElementById('producttext').innerHTML = '[+] PRODUCT INFORMATION';
			}
			else {
				document.getElementById('productinfo').style.display = 'none';
				document.getElementById('producttext').innerHTML = '[-] PRODUCT INFORMATION';
			}
		break;		
		case 'testimonials':
			if (document.getElementById('testimonials').style.display == 'none') {
				document.getElementById('testimonials').style.display = 'block';
				document.getElementById('testimonialstext').innerHTML = '[-] HIDE CUSTOMER TESTIMONIALS';
			}
			else {
				document.getElementById('testimonials').style.display = 'none';
				document.getElementById('testimonialstext').innerHTML = '[+] SHOW CUSTOMER TESTIMONIALS';
			}
		break;		
		
	}
}

function popupImage (image, name, parameters){
	//alert(parameters);
	var tmp = parameters.split(",");
	var tmp2 = tmp[0].split("=");
	var width = tmp2[1];

	var tmp2 = tmp[1].split("=");
	var height = tmp2[1];
	
	newWindow = window.open('', '', 'height = '+height+', width = '+width);
	newWindow.document.write('<html><head><title></title>');
	newWindow.document.write('<body bgcolor="#000000" scroll="no" style="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0">');
	newWindow.document.write('<img src="'+image+'">');
	newWindow.document.write('</body></head></html>');
	
}

function isValidEmail(str) {
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	if (!filter.test(str)) {
		return false;
	}
	else {
		return true;
	}
}