// Get query arguments loader
function getArgs() {
  var args = new Object();
  var query = location.search.substring(1);
  var pairs = query.split("&");
  for(var i = 0; i < pairs.length; i++) {
    var pos = pairs[i].indexOf('=');
    if (pos == -1) continue;
    var argname = pairs[i].substring(0,pos);
    var value = pairs[i].substring(pos+1);
    args[argname] = unescape(value);
  }
  return args;
}

function createCookie(name,value,days) {
        if (days) {
                var date = new Date();
                date.setTime(date.getTime()+(days*24*60*60*1000));
                var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
                var c = ca[i];
                while (c.charAt(0)==' ') c = c.substring(1,c.length);
                if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
}

var args = getArgs();
if (args.mv_pc) {
  mv_pc = String(args.mv_pc);
  createCookie('mv_pc', mv_pc, 7);
  //document.write(mv_pc);
}



function phonepopup() {
        newwindow2=window.open('','name','height=500,width=700');
        var tmp = newwindow2.document;
        tmp.write('<html><head><title>Pristine Herbal Touch - International Phone Numbers</title>\n');
        tmp.write('<style type="text/css">body{font-family:arial;} img{border:0;}</style>\n');
        tmp.write('</head><body>\n');
        tmp.write('<table border="0" cellspacing="1" cellpadding="5">\n');
        tmp.write('<tr><td colspan="4" align="center"><h3>Call to Order - Open 7 Days a Week!</h3></td></tr>\n');
        tmp.write('<tr style="background-color:#eee"><td width="160" align="center"><b>USA & Canada</b></td><td width="140" align="center"><font size="-1">toll-free</font></td><td align="center" width="150">8am - 9pm</td><td align="center">800-395-8401</td></tr>\n');
        tmp.write('<tr style="background-color:#f7f7f7"><td width="160" align="center"><b>United Kingdom</b></td><td width="140" align="center">London</td><td align="center" width="150">8am - 9pm</td><td align="center">020-7993-2084</td></tr>\n');
        tmp.write('<tr style="background-color:#f7f7f7"><td width="160" align="center"><b>Australia</b></td><td width="140" align="center"><font size="-1">toll-free</font></td><td align="center" width="150">8am - 9pm</td><td align="center">1800 449278</td></tr>\n');
        tmp.write('<tr style="background-color:#eee"><td width="160" align="center"><b>Ireland</b></td><td width="140" align="center">Dublin</td><td align="center" width="150">8am - 9pm</td><td align="center">01-657-1805</td></tr>\n');
        tmp.write('<tr style="background-color:#eee"><td width="160" align="center"><b>New Zealand</b></td><td width="140" align="center">Auckland</td><td align="center" width="150">8am - 9pm</td><td align="center">09-846-7036</td></tr>\n');
        tmp.write('<tr style="background-color:#eee"><td width="160" align="center"><b>France</b></td><td width="140" align="center">Paris</td><td align="center" width="150">9am - 6pm</td><td align="center">01 48 96 78 23</td></tr>\n');
        tmp.write('<tr style="background-color:#f7f7f7"><td width="160" align="center"><b>International</b></td><td width="140">&nbsp;</td><td align="center" width="150">8am - 9pm GMT</td><td align="center">1-310-862-4510</td></tr>\n');
        tmp.write('<tr style="background-color:#eee"><td width="160" align="center"><b>Skype</b></td><td colspan="2" align="center"><br />Call us for free from anywhere<br />in the world with Skype!<br /><font size="-1">Don\'t have Skype? <a href="http://www.skype.com/download/">Click here to download.</a><br /></font><font size="-2">Please note, you will need a microphone to use Skype!</font><br /><br /></td>\n');
        tmp.write('<td align="center"><a href="callto://vanish888/"><img src="https://www.wartmolevanish.com/pristine/images/wmv3/skypeus.gif" width="184" height="56" /></a></td></tr>\n');
        tmp.write('</table>\n');
        tmp.close();
}

function parseNavigation(ob) {
// created by joe crawford october 2002
// http://artlung.com/lab/scripting/dropdown-only-some-new-window/
toBeBrokenDown = ob.options[ob.selectedIndex].value.split("|");

targetWindow = toBeBrokenDown[0];
targetURL    = toBeBrokenDown[1];

	if (targetWindow!=='') {
		// if a new Window name is specified, then it will
		// open in a new Window.
		window.open(targetURL,targetWindow,'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=800,height=600');
		// if we open a new window, then we have to re-set
		// the select box to the first option
		// which should have no value
		ob.selectedIndex = 0;
	} else {
		// or else it will open in the current window		
		window.open(targetURL,'_top')
	}
}

function loadURL(url) {
var load = window.open(url,'','scrollbars=yes,menubar=no,height=600,width=700,resizable=yes,toolbar=no,location=no,status=no');
}

function popitup2() {
        newwindow2=window.open('','name','height=380,width=420');
        var tmp = newwindow2.document;
        tmp.write('<html><head><title>Military APO / FPO Instructions</title>');
        tmp.write('<style type="text/css">body { font-family: arial; }</style>');
        tmp.write('</head><body><h3>Military Customers - Special Instructions</h3>');
        tmp.write('<p>All APO / FPO addresses are considered United States addresses even if you are stationed in another country. </p>');
        tmp.write('<ol>');
        tmp.write('<li>For "<b>Country</b>", please select United States.</li>');
        tmp.write('<li>For "<b>City</b>", enter either APO or FPO, NOT the destination city.  If needed you may enter the destination city on the second line of the address field.</li>');
        tmp.write('<li>For "<b>State</b>", please select');
        tmp.write('<ul><li>AA (Military Americas)</li><li>AE (Military Europe / Canada)</li><li>AP(Armed Forces Pacific)</li></ul></li>');
        tmp.write('</ol>');
        tmp.write('</body></html>');
        tmp.close();
}

