window.theOffSet=0;
function changeTextSize(theDirection)
{
	if(!theDirection)
		theDirection=-1;
	if(window.theOffSet+theDirection>3 || window.theOffSet+theDirection<-2)
		return;
	else
		window.theOffSet=window.theOffSet+theDirection;
	elementsArrTd = document.getElementById("container").getElementsByTagName("td");
	elementsArrTable = document.getElementById("container").getElementsByTagName("table");
	elementsArrA = document.getElementById("container").getElementsByTagName("a");
	elementsArrSpan = document.getElementById("container").getElementsByTagName("span");
	doChangeSize(elementsArrTd);
	doChangeSize(elementsArrTable);
	doChangeSize(elementsArrA);
	doChangeSize(elementsArrSpan);
}

function doChangeSize(elementsArr)
{
for (var tmpI = 0; tmpI < elementsArr.length; tmpI++) 
	{
		var theClassName=elementsArr[tmpI].className;
		//---------------- 9px ----------------------------------
		if (theClassName=="legales") 
			elementsArr[tmpI].style.fontSize=9+window.theOffSet+"px";
		else if (theClassName=="link_legales_home") 
			elementsArr[tmpI].style.fontSize=9+window.theOffSet+"px";
		else if (theClassName=="legales_home2") 
			elementsArr[tmpI].style.fontSize=9+window.theOffSet+"px";
		else if (theClassName=="lightgraylink") 
			elementsArr[tmpI].style.fontSize=9+window.theOffSet+"px";
		//---------------- 10px ----------------------------------
		else if (theClassName=="print") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="copy_indicaciones") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="bot_compraInternet") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="table_ofertas_verde") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="bot_ofertas_bg") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="table_ofertas_azul") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="title_prod_indicaciones") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="table_prod_indicaciones") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="title_prod_indicaciones_der") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="table_prod_indicaciones_der") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="bot_ofertas_bg2") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="copyBlue_asterisco") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="copyBlue3") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="copy_indicaciones_white") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		else if (theClassName=="link_English") 
			elementsArr[tmpI].style.fontSize=10+window.theOffSet+"px";
		//---------------- 11px ----------------------------------
		else if (theClassName=="copyBlue2") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="table_breadcrumb") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="productsNav") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="copyBlue") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="bot_compraInternet_bg") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="title_ofertas_verde") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="copyBlue_list") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="copyBlue_list2") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="copyBlue_list3") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="table_ofertas_especiales") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="copyBluetxtbullet") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="recuadro_preguntanos") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="recuadro_preguntanos_copy") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="copywhite_gde") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="breadcrumblink") 
			elementsArr[tmpI].style.fontSize=11+window.theOffSet+"px";
		else if (theClassName=="table_breadcrumb") 
			alert(99)
		//---------------- 12px ----------------------------------
		else if (theClassName=="copyBlue_gde") 
			elementsArr[tmpI].style.fontSize=12+window.theOffSet+"px";
		else if (theClassName=="columnas_seccion") 
			elementsArr[tmpI].style.fontSize=12+window.theOffSet+"px";
		else if (theClassName=="title_cyan") 
			elementsArr[tmpI].style.fontSize=12+window.theOffSet+"px";
		else if (theClassName=="title_ofertas") 
			elementsArr[tmpI].style.fontSize=12+window.theOffSet+"px";
		else if (theClassName=="separar_Siguiente") 
			elementsArr[tmpI].style.fontSize=12+window.theOffSet+"px";
		else if (theClassName=="copyBlue_colizq") 
			elementsArr[tmpI].style.fontSize=12+window.theOffSet+"px";
		else if (theClassName=="table_seccion") 
			elementsArr[tmpI].style.fontSize=12+window.theOffSet+"px";
		else if (theClassName=="copyBlue_gde_underl") 
			elementsArr[tmpI].style.fontSize=12+window.theOffSet+"px";
		else if (theClassName=="copyBlue_gde2") 
			elementsArr[tmpI].style.fontSize=12+window.theOffSet+"px";	
		else if (theClassName=="title_ofertas_esp") 
			elementsArr[tmpI].style.fontSize=12+window.theOffSet+"px";
		else if (theClassName=="table_seccion2") 
			elementsArr[tmpI].style.fontSize=12+window.theOffSet+"px";
		else if (theClassName=="copyBlue_gde3") 
			elementsArr[tmpI].style.fontSize=12+window.theOffSet+"px";
		else if (theClassName=="linkBlue2") 
			elementsArr[tmpI].style.fontSize=12+window.theOffSet+"px";
		//---------------- 13px ----------------------------------
		else if (theClassName=="secciones_mapa") 
			elementsArr[tmpI].style.fontSize=13+window.theOffSet+"px";
		else if (theClassName=="secciones_mapa_link") 
			elementsArr[tmpI].style.fontSize=13+window.theOffSet+"px";
		//---------------- 14px ----------------------------------
		else if (theClassName=="table_title") 
			elementsArr[tmpI].style.fontSize=14+window.theOffSet+"px";
		//---------------- 14px ----------------------------------
		else if (theClassName=="table_title2") 
			elementsArr[tmpI].style.fontSize=16+window.theOffSet+"px";
		//----------------------------------------------------------
	}
}
function doPrint()
{
	window.print();
}

function doEmail()
{
	window.open("/espanol/generic.jhtml?id=imodium/espanol/include/Envia_Pagina_Amigo.inc","email","width=700,height=658,toolbar=0,menubar=0,scrollbars=0,resizable=0,status=0,status=0,location=0,directories=0,copyhistory=0");

}

function newWindow(url,name,w,h,t,m,s,r,st,l,d,c) 
{
	var windowOptions = "width=" + w + "," +
	"height=" + h + "," +
	"toolbar=" + t + "," +
	"menubar=" + m +"," +
	"scrollbars=" + s + "," +
	"resizable=" + r + "," +
	"status=" + st + "," +
	"location=" + l + "," +
	"directories=" + d + "," +
	"copyhistory=" + c;
	window.open(url, name, windowOptions);
}

function printBathroomResults(city, state, zipCode) 
{
	newWindow('/generic.jhtml?id=imodium/include/3_5_1.inc&city=' + city + '&state=' + state + '&zipCode=' + zipCode,'bathroomresults',659,625,0,0,1,0,0,0,0,0);
}

function flashDetection()
{
	 var flash_versions=10;
	 var flash_installed=0;
	if (navigator.plugins && navigator.plugins.length) 
	{
		for (x = 0; x <navigator.plugins.length; x++) 
		{
			if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) 
			{
				flash_installed = 1;
				break;
			}
		}
	}
	else if (window.ActiveXObject) 
	{
		for (x = 2; x <= flash_versions; x++) 
		{
			try {
				oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
				if (oFlash) 
				{
					flash_installed = 1;
					break;
				}
			}
			catch(e) {}
		}
	}
	return(flash_installed);
}

function resize()
{
	if (screen.width<=1024) {
		// no snugfit.
	} else {
		var debug = 0;

		/* Need to resize the window if it's not AOL, or < AOL 9.0 */
		var ua = navigator.userAgent.toLowerCase();
		var ver = navigator.appVersion.toLowerCase();
		var is_aol = ua.indexOf('aol') != -1;
		var is_msie = (ua.indexOf('msie') > 0)?true:false;
		var is_moz = navigator.appCodeName == "Mozilla";
		var is_netscape = ua.indexOf('netscape') != -1;
		var is_firefox = ua.indexOf('firefox') != -1;
		var is_gecko = ua.indexOf('gecko') != -1;
		var is_cs7 = ua.indexOf('cs 2000 7.0/7.0') != -1;
		var is_safari = ua.indexOf('safari') != -1;
		var aol_ver = parseFloat(ua.substring(ua.indexOf('aol')+4));
		var msie_ver = parseFloat(ver.substring(ver.indexOf('msie')+5));
		var moz_ver = parseFloat(ver);
		var safari_ver = parseFloat(ua.substring(ua.indexOf('safari')+7));
		var netscape_ver = parseFloat(ua.substring(ua.indexOf('netscape/')+9));
		var is_mac = (ua.indexOf('macintosh')!=-1 || ua.indexOf('mac_')!=-1);
		var agt = navigator.userAgent.toLowerCase();
		var isAOL   = (agt.indexOf("aol") != -1);
		var isGecko =  (agt.indexOf("gecko") != -1);
		var isIE55 =  (agt.indexOf("msie 5.5") != -1);
		var isIE52 =  (agt.indexOf("msie 5.2") != -1);
		var isMac = 1;
		if (is_mac) {
			var w=954, h=633;
		} else {
			var w=954, h=633;
		}
				
		if (isAOL) {
			top.resizeTo(w, h);
			top.moveTo(0,0);
		} else {
			if (isGecko) {
				if(is_safari)
					w=969;
				if(is_firefox)
					w=970;
				var overSizeWidth = w - top.window.innerWidth;
				var overSizeHeight = h - top.window.innerHeight;
			}
			else {
				if (isIE55 || isIE52) {
					var overSizeWidth = w - document.body.clientWidth;
					var overSizeHeight = h - document.body.clientHeight;
				} else {
					if (document.compatMode && document.compatMode != "BackCompat") {
						var overSizeWidth = w - document.documentElement.clientWidth;
						var overSizeHeight = h - document.documentElement.clientHeight;
					} else {
						var overSizeWidth = w - document.body.clientWidth;
						var overSizeHeight = h - document.body.clientHeight;
					}
				}
			}
			try {
				top.resizeBy (overSizeWidth, overSizeHeight );
			}
			catch(err) {}
		}
	}
}

function fixMozInit()
{
	var ua = navigator.userAgent.toLowerCase();
	var is_firefox = ua.indexOf('firefox') != -1;
	var is_safari = ua.indexOf('safari') != -1;
	if(is_safari || is_firefox)
		document.body.style.overflowY="scroll";
}

function wo(param)
{
	if(param==1)
	{
		theWin=window.open("/espanol/generic.jhtml?id=imodium/espanol/include/Buy_product_online.inc","_blank","toolbar,resizable,width=850,height=500");
		theWin.finalUrl="http://international.drugstore.com/templates/brand/default.asp?brand=7266";
	}
	else if(param==2)
	{
		theWin=window.open("/espanol/generic.jhtml?id=imodium/espanol/include/Buy_product_online.inc","_blank","toolbar,resizable,width=850,height=500");
		theWin.finalUrl="http://www.cvs.com/CVSApp/user/home/home.jsp";
	}
}
