function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ShowLargeImg(pId, cId, img, posId){
	var pEl = document.getElementById(pId);
	var cEl = document.getElementById(cId);
	var posEl = document.getElementById(posId);
	var xy = findPos(posEl);//retun val one dim. array
	cEl.innerHTML = '<img src="images/'+img+'" />';
	pEl.style.display = 'block';
	pEl.style.top = xy[1] + "px";
	pEl.style.left = xy[0] - 255 + "px";
}
function ShowLargeImgWCaption(pId, cId, img, posId){
	var pEl = document.getElementById(pId);
	var cEl = document.getElementById(cId);
	var posEl = document.getElementById(posId);
	var xy = findPos(posEl);//retun val one dim. array
	var caption = '';
	switch(img){
		case 'art_whitehead.jpg': caption = '<p>If the comedones stay beneath the skin, they are called <strong>closed comedones.</strong> This type of acne produces a white bump commonly called a <strong>whitehead</strong>.</p>';
		break;
		case 'art_blackhead.jpg': caption = '<p>A comedone that reaches the surface of the skin and opens up is commonly called a <strong>blackhead</strong>. Although it may look black on the skin\'s surface, this discoloration is not due to dirt. Both whiteheads and blackheads may stay in the skin for a long time.</p>';
		break;
		case 'art_papule.jpg': caption = '<p><strong>Inflammatory lesions:</strong> Papules (PAP-yules) form when overloaded hair follicles spill their contents into the surrounding skin tissue. They appear as small bumps and are usually red, swollen, and tender. (&ldquo;Ouch, don&rsquo;t touch me there!&rdquo;) Red pimples are inflamed papules that usually appear as small, pink bumps on the skin and can be tender to the touch.</p>';
		break;
		case 'art_pustule.jpg': caption = '<p>Sometimes these papules are topped by pus-filled pimples called <strong>pustules</strong> (PUHST-yules) that may be red at the base. These are caused by the body&rsquo;s white blood cells attacking a clogged hair follicle. (Tempting to pop, but DON&rsquo;T. More about that later.)</p>';
		break;
	}
	cEl.innerHTML = '<img src="images/'+img+'" />'+caption;
	pEl.style.display = 'block';
	pEl.style.top = xy[1] + "px";
	pEl.style.left = xy[0] - 297 + "px";
}
function HideLargeImg(pId, cId){
	var pEl = document.getElementById(pId);
	var cEl = document.getElementById(cId);
	cEl.innerHTML = '';
	pEl.style.display = 'none';
}
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}
function OpenCloseFlashVideo(id, swf){
	var el = document.getElementById(id);
	//var myLink = (document.getElementById(id+"Flash")!= null)?document.getElementById(id+"Flash"):false;
	//var myLink = document.getElementById(id+"Flash");
	var myLink = id+"Flash";
	//el.style.display=(el.style.display=='block'?'none':'block');
	el.style.display='block';
	var o = new SWFObject(swf, "howToUseAdultswf", "240", "225", "8", "#ffffff");
				 o.write(myLink);
	/* myLink.innerHTML = '<script type="text/javascript">'
				 + 'var flashTeenHowTo = new SWFObject("'+swf+'", "howtouse", "240", "225", "8", "#ffffff");'
				 + 'flashTeenHowTo.write("flashTeenHowTo");'
			+ '</script>'; */
	/* if(myLink && el.style.display=='block'){
		myLink.innerHTML = 'Stop';
	}else{
		myLink.innerHTML = txtCallToAction;
	} */
}
function EmptyFlashContainer(parentDiv, flashDiv){
	var par = document.getElementById(parentDiv);
	var flash = document.getElementById(flashDiv);
	(par.style.display=='none')?flash.innerHTML = '':eval(flashDiv).write(flashDiv);
}
function CreateBookmarkLink(title, url) {

 //title = "Webpage Title"; 
  // Blogger - Replace with <$BlogItemTitle$> 
  // MovableType - Replace with <$MTEntryTitle$>

 //url = "Webpage URL";
  // Blogger - Replace with <$BlogItemPermalinkURL$> 
  // MovableType - Replace with <$MTEntryPermalink$>
  // WordPress - <?php bloginfo('url'); ?>

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
 }
 