function TablePopOut(obj){
	if(document.getElementById){
	var el = document.getElementById("sub"+obj);
	var el2 = document.getElementById("arrow"+obj);
	var ar = document.getElementById("itemtable").getElementsByTagName("span");
		if(el.style.display != "block"){
				/*for (var i=0; i<ar.length; i++){
					if (ar[i].className=="popouttable")
					ar[i].style.display = "none";
					document.getElementById("arrow"+i).innerHTML ='<div style="cursor:pointer;" onclick="TablePopOut('+obj+')"><img src="/lib/mysupplement-store/more-info.gif"><div>';
				}*/
			el2.innerHTML ='<div style="cursor:pointer;" onclick="TablePopOut('+obj+')"><img src="/lib/mysupplement-store/more-info-down.gif">';
			el.style.display = "block";
		}else{
			el.style.display = "none";
			el2.innerHTML ='<div style="cursor:pointer;" onclick="TablePopOut('+obj+')"><img src="/lib/mysupplement-store/more-info.gif"><div>';
		}
	}
}

function sendToFriend(account){
var newwindow = "http://hosting.solidcactus.com/sendtofriend/mysupplementsstore/solidcactus-sendtofriend.asp?url=" + escape(window.location) + "&store=" + escape(account) + "&imageref=" + escape(imref) + "&itemname=" + escape(itemname);
var window_properties = "top=0,left=0,scrollbars=yes,width=650,height=575";
var Window = window.open(newwindow,"sendtofriend",window_properties);
};

function makeWin(imsrc, ww, wh) {
ww=ww+25; wh=wh+50;
w1=window.open('','w1','width='+ww+',height='+wh+',status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
w1.document.open();
w1.document.write("<html><head><title>Image Zoom<\/title><META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\"><META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\"><\/head>");
w1.document.write("<body bgcolor='#FFFFFF' text='#000000' leftmargin=2 topmargin=10><p align=center>");
w1.document.write("<img name=theimg src=" + imsrc + "><br>");
w1.document.write("<a href=\"javascript:window.close();\"><font size=1 face=tahoma color=#000000>close window<\/font><\/a><\/body><\/html>");
w1.focus();
};

function isEmail(str) {
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported)
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
    var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
    var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
    return (!r1.test(str) && r2.test(str));
}

function openNewletterWin(wName, wWidth, wHeight, wResize) {
	if(isEmail(document.optin.OILB_EMAIL.value) == "") {
		alert("Your e-mail address seems not to be valid.");
		document.optin.OILB_EMAIL.focus();
		return false;
	}else{
		features = 'top=0,left=0,scrollbars=1,status=0,resizable=' + ((wResize) ? 0 : 0) + ((wWidth) ? ',width=' + wWidth : '') + ((wHeight) ? ',height=' + wHeight : '');
		popWin = window.open('', wName, features);
		if(popWin.focus) { popWin.focus(); }
		return true;
	}
}