function changeSite()
{
  var newSite = "http://www.metromedicalonline.com/";
          
  var currentURL = window.location + "";
  rExp = /.+\//gi;
  var newURL = currentURL.replace(rExp, "");
  newURL = newSite + newURL;
  window.location = newURL;
}
  // only use www.metromedicalonline.com URL
  var currentLoc = window.location + " ";
  var RE = new RegExp(".+store.metro.+","i");
  if(currentLoc.match(RE))
  {
    changeSite();
  }
  var RE = new RegExp("http://metromedicalonline.+","i");
  if(currentLoc.match(RE))
  {
    changeSite();
  }

  function emailPage()
  {
      eval("window.open('http://www.ydesigns.biz/tools/email-a-friend/?storename=yhst-87084252606611&theURL="+window.location+"','email_popup','menubar=no,scrollbars=no,width=500,height=420')");  
  }
  

function expandImage(imgLoc,imgH,imgW)

  {

imgH = imgH * 1; imgW = imgW * 1;

var X = window.screen.availHeight;

var Y = window.screen.availWidth;

X = X - 100;  Y = Y - 50;

if(X > (imgH + 90))	

{ X = (imgH + 90); }

if(Y > (imgW + 40))	

{ Y = (imgW + 40); }

if(Y<210){	Y = 210;	}

  var popWin = window.open('','','toolbar=0, location=0,status=0,menubar=0,resizable=0,scrollbars=1,width='+Y+',height=' + X);
  

  popWin.document.open();

  popWin.document.write('<ht'+'ml><he'+'ad><ti'+'tle>Simply Network</tit'+'le></he'+'ad><bo'+'dy>');

  popWin.document.write('<img alt="loading expanded image... please wait..." name=mainImage src='+imgLoc+' border=0>');

  popWin.document.write('<br><br><font face=helvetica,arial style="font-size:1.1em;"><center><a href="javascript:window.close()"><font color=#b6b19a >Close Window</a>');

  popWin.document.write('</body></html>');

  popWin.document.close();

  popWin.moveTo(50,50);

  }

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function submitForm()
{
	var continueToSubmit = true;
	if( continueToSubmit && document.optin.OILB_EMAIL.value.length != 0 )
	{
		var emailValue = document.optin.OILB_EMAIL.value;
		if( ( emailValue.indexOf( '@' ) <= 0 ) || ( emailValue.indexOf( '.', emailValue.indexOf( '@' ) ) <= 0 ) )
	{
			continueToSubmit = false;
			alert('You must provide a valid email address.');
			document.optin.OILB_EMAIL.focus();
		}
	}
	if( continueToSubmit && document.optin.OILB_EMAIL.value.length == 0 )
	{
		continueToSubmit = false;
		alert('You must provide a value for Email.');
		document.optin.OILB_EMAIL.focus();
	}
	if( continueToSubmit )
	{
var popWin = window.open('','','toolbar=0, location=0,status=0,menubar=0,scrollbars=0,resizable=0, width=200,height=200,left=300,top=300');
 popWin.document.open();
popWin.document.write('<ht'+'ml><he'+'ad><tit'+'le>MetroMedicalOnline.com</ti'+'tle></he'+'ad><bo'+'dy onload=javascript:document.optin.submit();><FORM NAME=optin METHOD=POST ACTION=http://builder.campaigner.com/app/campaigner/services/optinlist/processoptinrequest.jsp?oilb=86636185&builderType=classic><INPUT TYPE=HIDDEN NAME=commitcontact VALUE=true><input type=HIDDEN NAME=OILB_EMAIL Value='+document.optin.OILB_EMAIL.value+'></form>Registering....</bo'+'dy></HT'+'ML>');

popWin.document.close();
  
	}
}

function addToWishlist(pageID,pageName,imgLoc)
{
pageName = pageName.replace("&","and");
var strLocation = "http://ydesigns.biz/tools/wishlist/shoplist/addlist.php?"+
				  "storeID=yhst-87084252606611&pageID="+pageID+"&pageName="+pageName+"&imgLoc="+imgLoc;
var yhst87084252606611popup = window.open(strLocation,"yhst87084252606611popup","toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0,width=305,height=540");
yhst87084252606611popup.focus();
}
