function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//function setClass()
//{
// alert('begin');
// //determine browser type and if IE, set the class
//    var agt=navigator.userAgent.toLowerCase();
//    var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
// if (is_ie) {
//
//    var obj= document.getElementById(leftcol);
//    alert(obj);
//    obj.class = "menubg";
//
//    //document.all.leftcol.style.class="menubg";
//  }
//}


function advWindow(url, dat_width, dat_height) {

	options = "left=0,top=0,toolbar=0,status=0,menubar=0,scrollbars=1,resizable=0,width=" + dat_width + ",height=" + dat_height;
	anotherWindow = window.open('adv.htm','',options);
	anotherWindow.document.close();
}

function propsWindow(url, dat_width, dat_height) {

	options = "left=0,top=0,toolbar=0,status=0,menubar=0,scrollbars=1,resizable=0,width=" + dat_width + ",height=" + dat_height;
	anotherWindow = window.open('properties.htm','',options);
	anotherWindow.document.close();
}

function resistWindow(url, dat_width, dat_height) {

	options = "left=0,top=0,toolbar=0,status=0,menubar=0,scrollbars=1,resizable=0,width=" + dat_width + ",height=" + dat_height;
	anotherWindow = window.open('chemresist.htm','',options);
	anotherWindow.document.close();
}

function advHCWindow(url, dat_width, dat_height) {

	options = "left=0,top=0,toolbar=0,status=0,menubar=0,scrollbars=1,resizable=0,width=" + dat_width + ",height=" + dat_height;
	anotherWindow = window.open('adv.htm','',options);
	anotherWindow.document.close();
}

function propsHCWindow(url, dat_width, dat_height) {

	options = "left=0,top=0,toolbar=0,status=0,menubar=0,scrollbars=1,resizable=0,width=" + dat_width + ",height=" + dat_height;
	anotherWindow = window.open('properties.htm','',options);
	anotherWindow.document.close();
}

function pop(url, dat_width, dat_height) {

	myhtml = '<html><head><title>Icoco Coffee</title>';
	myhtml = myhtml + '<link rel="stylesheet" href="ps.css" type="text/css"/>';
	myhtml = myhtml + '</head><body onBlur="window.close()" topmargin="0" leftmargin="0">';
	myhtml = myhtml + '<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td>';
	myhtml = myhtml + '<img src="' + url + '" border="0">';
	myhtml = myhtml + '</td></tr></table>';
	myhtml = myhtml + '<table bgcolor="#FFF6E8" width="100%" border="0" cellpadding="0" cellspacing="0">';
	myhtml = myhtml + '<tr><td height="5">';
	myhtml = myhtml + '<img src="site_images/spacer.gif" height="5"/>';
	myhtml = myhtml + '</td></tr><tr><td width="10">';
	myhtml = myhtml + '<img src="site_images/spacer.gif" width="10"/></td>';
	myhtml = myhtml + '<td class="footer">© 2007 IcocoCoffeeNz</td>';
	myhtml = myhtml + '<td align="right" valign="top"><a href="#" class="pop" title="close" onClick="window.close();">>>close</a>';
	myhtml = myhtml + '</td><td width="10"><img src="site_images/spacer.gif" width="10"/></td></tr>';
	myhtml = myhtml + '<tr><td><img src="site_images/spacer.gif" height="10"/></td></tr></table>';
	myhtml = myhtml + '</p></body></html>';

	options = "left=50,top=50,toolbar=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + dat_width + ",height=" + dat_height;

	mywindow = window.open('','',options);
	mywindow.document.writeln(myhtml);
	mywindow.document.close();
}

function popsealcradv(url, dat_width, dat_height) {

	myhtml = '<html><head><title>POLYSEAL (NZ) LTD. Industrial Coatings, Flooring & Waterproofing</title>';
	myhtml = myhtml + '<link rel="stylesheet" href="ps.css" type="text/css"/>';
	myhtml = myhtml + '</head><body topmargin="0" leftmargin="0">';
	myhtml = myhtml + '<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td>';
	myhtml = myhtml + '<img src="' + url + '" border="0">';
	myhtml = myhtml + '</td></tr></table>';
	myhtml = myhtml + '<table bgcolor="#000080" width="100%" border="0" cellpadding="0" cellspacing="0">';
	myhtml = myhtml + '<tr><td height="5">';
	myhtml = myhtml + '<img src="site_images/spacer.gif" height="5"/>';
	myhtml = myhtml + '</td></tr><tr><td width="10">';
	myhtml = myhtml + '<img src="site_images/spacer.gif" width="10"/></td>';
	myhtml = myhtml + '<td class="login">Copyright © 2005 Polyseal (NZ) Ltd</td>';
	myhtml = myhtml + '<td align="right" bgcolor="#000080"><a class="menu" href="#" title="close" onClick="window.close();">>>close window</a>';
	myhtml = myhtml + '</td><td width="10"><img src="site_images/spacer.gif" width="10"/></td></tr>';
	myhtml = myhtml + '<tr><td><img src="site_images/spacer.gif" height="10"/></td></tr></table>';
	myhtml = myhtml + '</p></body></html>';

	options = "left=0,top=0,toolbar=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + dat_width + ",height=" + dat_height;

	mywindow = window.open('','',options);
	mywindow.document.writeln(myhtml);
	mywindow.document.close();
}

function pop21(url, dat_width, dat_height) {
	//myhtml = '<html><head><title>Map</title>';


	options = "left=0,top=0,toolbar=1,status=1,menubar=1,scrollbars=1,resizable=1,location=1,width=" + dat_width + ",height=" + dat_height;

	mywindow = window.open(url,'',options);
	
	//mywindow.document.close();
}



function popcentre(url,name,width,height) {
   var titleBarHeight, windowBorderWidth
   titleBarHeight = 24
   windowBorderWidth = 4

   var screenWidth, screenHeight
   screenWidth = 800
   screenHeight = 600

   if (window.screen) {

      if (window.screen.availWidth) {
      
         // ok browser has the appropriate properties we need to centre it
         screenWidth = window.screen.availWidth
         screenHeight = window.screen.availHeight
   alert(screenWidth);
   alert(screenHeight);
         
      }
   }

   var windowWidth = windowBorderWidth + width + windowBorderWidth
   var windowHeight = titleBarHeight + height + windowBorderWidth

   var left = (screenWidth - windowWidth) / 2
   var top = (screenHeight - windowHeight) / 2

   var myoptions = 'left=0,top=0,screenX=0,screenY=0,width='+width+',height='+height+',scrollbars=yes,resizable=1,toolbar=yes,location=1,directories=1,status=1,menubar=1,copyhistory=1';
   
   alert(url+name+myoptions);
   window.open(url,name,myoptions);
}


function validateEmail(theForm,theField)
      {
        var regex=/^\w+((\.|-|,|'|&)\w+)*@\w+(-\w+)*(\.\w+(-\w+)*)+$/;

        var ok=regex.exec(theField.value);
        if (!ok)
        {
          alert("Please enter a valid e-mail address (e.g. you@yourdomain.com).");
          return false;
        }
        window.open("http://registration.virtualspectator.com/cgi-bin/ac2003/roi/clone.cgi?Email="+theField.value,"Confirm","resizable,height=160,width=400");
        return true;
      }



