var isIE = document.all?true:false;
if (!isIE) document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove = getMousePosition;
var _x;
var _y;
function show(childNum) {
	var el1 = document.getElementById("child-"+childNum);
	var el2 = document.getElementById("buttons-"+(childNum-1));
	el1.style.display = "block";
	el2.style.display = "none";
	document.getElementById("template-05").style.top = (1600 + (childNum-1)*850) + "px";
}
function popPrint(pageUrl) {
	window.open(pageUrl + "?printable=y", "Printable");
}
function popup(pageurl, windowname, w, h, scroll, t, l, r) {
		var	winprops = 'height='+h+',width='+w+',innerheight='+h+',innerwidth='+w+',top='+t+'px,left='+l+'px,scrollbars='+scroll+',resizable='+r;
		var win = window.open(pageurl, windowname, winprops);
		win.window.focus();
	//	if (win) win.focus();
	//	return win;
}
function subNavOn(id) {
    try{
	document.getElementById("drop_down_0" + id).style.backgroundColor = "#DD2878";
	navOn(id.substring(0,1));
	}
	catch(err){}
}
function subNavOff(id) {
    try{
	document.getElementById("drop_down_0" + id).style.backgroundColor = "#007E85";
	}
	catch(err){}
}
function subMenuOn(id) {
    try{
	document.getElementById("drop_down_0" + id).style.display = "inline";
	}
	catch(err){}
}

function prescriptionChange() {
	if (document.getElementById("prescription_size").value == "Other") {
		document.getElementById("other_size").style.display = "inline";
	} else {
		document.getElementById("other_size").style.display = "none";
	}
}
	
function getMousePosition(e) {
    if(typeof navOff != 'function'){return;}
	if (!isIE) {
		_x = e.pageX;
		_y = e.pageY;
	}
	if (isIE) {
		_x = event.clientX + document.body.scrollLeft;
		_y = event.clientY + document.body.scrollTop;
	}
	if ((_x > 12) && (_x < 185) && ((_y > 230) || (_y < 85))) {
	    try{
		navOff(1);
		document.getElementById("drop_down_01").style.display = "none";
		}
	    catch(err){}
	}
	else if ((_x < 12) || (_x > 230)) {
	    try{
		navOff(1);
		document.getElementById("drop_down_01").style.display = "none";
		}
	    catch(err){}
	}
	if ((_x > 189) && (_x < 376) && ((_y > 197) || (_y < 85))) {
	    try{
		navOff(3);
		document.getElementById("drop_down_03").style.display = "none";
		}
	    catch(err){}
	}
	else if ((_x < 189) || (_x > 376)) {
	    try{
		navOff(3);
		document.getElementById("drop_down_03").style.display = "none";
		}
	    catch(err){}
	}
	if ((_x > 380) && (_x < 561) && ((_y > 270) || (_y < 85))) {
	    try{
		navOff(5);
		document.getElementById("drop_down_05").style.display = "none";
		}
	    catch(err){}
	}
	else if ((_x < 380) || (_x > 561)) {
		try{
		navOff(5);
		document.getElementById("drop_down_05").style.display = "none";
		}
	    catch(err){}
	}
	if ((_x > 536) && (_x < 725) && ((_y > 256) || (_y < 85))) {
		try{
		navOff(7);
		document.getElementById("drop_down_07").style.display = "none";
		}
	    catch(err){}
	}
	else if ((_x < 536) || (_x > 725)) {
		try{
		navOff(7);
		document.getElementById("drop_down_07").style.display = "none";
		}
	    catch(err){}
	}
	if ((_x > 629) && (_x < 771) && ((_y > 229) || (_y < 85))) {
		try{
		navOff(9);
		document.getElementById("drop_down_09").style.display = "none";
		}
	    catch(err){}
	}
	else if ((_x < 629) || (_x > 771)) {
		try{
		navOff(9);
		document.getElementById("drop_down_09").style.display = "none";
		}
	    catch(err){}
	}
	return true;
}

function writeHowWorks() {
		document.write('<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"390\" height=\"260\" id=\"video_player_v2\" align=\"middle\">\n');
		document.write('<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n');
		document.write('<param name=\"movie\" value=\"../flash/video_player_v2.swf\" />\n');
		document.write('<param name=\"quality\" value=\"high\" />\n');
		document.write('<param name=\"bgcolor\" value=\"#ffffff\" />\n');
		document.write('<embed src=\"../flash/video_player_v2.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"390\" height=\"260\" name=\"video_player_v2\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n');
		document.write('</object>\n');
	}

function writeSoluTabAnim() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="384" height="199">');
	document.write('<param name="movie" value="../flash/solutab/soluTab_animation_vid.swf">');
	document.write('<param name="quality" value="high">');
	document.write('<embed src="../flash/solutab/soluTab_animation_vid.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="384" height="199"><\/embed>');
	document.write('<\/object>');
}

function writeHomePageFlash() {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="576" height="283" id="index2a" align="middle" VIEWASTEXT>\n');
	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
	document.write('<param name="movie" value="flash/index2a.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="wmode" value="transparent" />\n');
	document.write('<param name="bgcolor" value="#ffffff" />\n');
	document.write('<embed src="flash/index2a.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="576" height="283" name="index2a" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
	document.write('</object>\n');
}
