// Copyright 2005 Seeker Software
var win = null;
var nFormat=1; // emb machine
// Ultimate client-side JavaScript client sniff. Version 3.03
// (C) Netscape Communications 1999-2001.  Permission granted to reuse and distribute.
//stripped
//determining browser
var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

// Note: Opera and WebTV spoof Navigator.  We do strict client detection.
// If you want to allow spoofing, take out the tests for opera and webtv.
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
            && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_nav2 = (is_nav && (is_major == 2));
var is_nav3 = (is_nav && (is_major == 3));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav4up = (is_nav && (is_major >= 4));
var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                     (agt.indexOf("; nav") != -1)) );
var is_nav6 = (is_nav && (is_major == 5));
var is_nav6up = (is_nav && (is_major >= 5));
var is_gecko = (agt.indexOf('gecko') != -1);


var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

function opwindow(pTitle,pImage)
{
	var left=100;//document.getElementById('myimage').style.left
	var top=20;//document.getElementById('myimage').style.top
		
		//create pop-up window
	try
	{
	   if( win )
	   {
	      if( win.closed() == false )
	      {
		      win.window.close();
		   }
		   win = null;
	   }	
	}
   catch(e)
   {
      print("Error: Warning " + e);
   }
	win=open("", "displaywindow","width=700,height=720,status=no,scrollbars=yes,resizeable=yes,toolbar=no,menubar=no");
	win.document.open();
	win.document.write("<html><head>");
   win.document.write("<SCRIPT LANGUAGE='JavaScript'>");
   win.document.write("var oFormart;");
   win.document.write("var nFormat=1;");
   win.document.write("var sOrder=' ';");
   win.document.write("function setFormat(fmt) {nFormat=fnt;}");
   win.document.write("function addToCart() {sOrder='"+pImage+"';}");
   win.document.write("</script>");
	win.document.write("</head><body>");
   win.document.write("  <center>");
   win.document.write("  <table border=2>");
   win.document.write("   <tr>");
	win.document.write("    <td colspan='2'><a><img src='"+pImage+".jpg'</a></td>");
   win.document.write("   </tr>");
   win.document.write("   <tr>");
	win.document.write("    <td<select id='oFormat' SIZE='1' onchange='setFormat()'");
   win.document.write(">");
   win.document.write("      <OPTION value='1' SELECTED>PES");
   win.document.write("      <OPTION value='2'>HUS");
   win.document.write("      <OPTION value='3'>PAF");
	win.document.write("     </select>");
   win.document.write("     <input type='button' value='Add to Cart' onClick='addToCart()'>"+pTitle);
	win.document.write("    </td>");
	win.document.write("    <td align='right'>");
   win.document.write("     <input' type='button' value='Close Window' onClick='window.close()'>");
	win.document.write("    </td>");
   win.document.write("   </tr>");
   win.document.write("  </table>");
   win.document.write("  </center>");
	win.document.write("</body></html>");
	win.document.close();
	win.moveTo(left,top);
	if( is_ie )
	{
   	win.focus();
   }
	return true;
}

// First, extract the form variables: <br>@extract($_GET); <br>// Then your variables will be named and populated like so: <br>$name <br>$equipment_Type <br>$capability<!-- /post --></font>
function openphp(pSet)
{
	var left=100;//document.getElementById('myimage').style.left
	var top=20;//document.getElementById('myimage').style.top
		
		//create pop-up window
	if( win != null )
	{
		win.window.close();
		win = null;
	}	
//   win=open("http://www.enchantedembroidery.com/php/viewset.php?pImage='"+pImage+"'",
   win=open("http://www.HugMeBears.com/php/viewimage.php?Set="+pSet,
             "displaywindow",
             "width=600,height=600,status=no,scrollbars=yes,resizeable=yes,toolbar=no,menubar=no");
   if( win )
   {
	   win.moveTo(left,top);
	   if( is_ie )
	   {
   	   win.focus();
 	      win = null; //IE ESDs if we don't do this
 	   }
	}
	else
	{
	   if( is_ie )
	   {
	      alert( "Please disable pop blocker or click the add this site to your trusted list of sites!\r\r Click the warning bar above.\r\
	         click Popup clockers->Add this site\rRestart explorer\r\r\Note, Enchanted Embroidery does not use popups for ads during your visit!" );
	   }
	   else
	   {
	      alert( "Please disable pop blocker or click the add this site to your trusted list of sites!\r\r Click the warning bar above.\r\
	         Add this site\rRestart browser\r\r\Note, Enchanted Embroidery does not use popups for ads during your visit!" );
	   }
	}
}

function openphp2(pTitle,pSet)
{
	var left=100;//document.getElementById('myimage').style.left
	var top=20;//document.getElementById('myimage').style.top
		
		//create pop-up window
	if( win != null )
	{
		win.window.close();
		win = null;
	}	
//   win=open("http://www.enchantedembroidery.com/php/viewset.php?pImage='"+pImage+"'",
   win=open("http://www.enchantedembroidery.com/php/viewset2.php?Set="+pSet+"&Title="+pTitle,
             "displaywindow",
             "width=620,height=650,status=no,scrollbars=yes,resizeable=yes,toolbar=no,menubar=no");
	win.moveTo(left,top);
	if( is_ie )
	{
   	win.focus();
 	   win = null; //IE ESDs if we don't do this
 	}
}

function opencart()
{
	win=open("", "displaywindow","width=200,height=120,status=no,scrollbars=yes,resizeable=yes,toolbar=no,menubar=no");
	win.document.open();
	win.document.write("<html><head>");
	win.document.write("</head><body bgColor='#00C000'>");
	win.document.write("<div align='center'>No carts available at this time!</div>");
	win.document.write("</body></html>");
	win.document.close();
	win.moveTo(left,top);
}
function Table1_onclick()
{
}

function closewindow()
{
   if( win )
   	win.close();
   	
	win = null;
	return true;
}

