//Change title for your site
title = 'Guide to reliable Online Pharmacies'; url = 'http://'+window.location.host+'/';

function DoAdd() 
{ 
if (window.sidebar) { // Mozilla Firefox Bookmark
        window.sidebar.addPanel(title, url,""); } 
else if( window.external ) { // IE Favorite             
        window.external.AddFavorite( url, title); }     	
} 	

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function ShowPage(){
var oTbl;

oTbl=getbyid('MainTbl');
if (!oTbl) return;
oTbl.style.visibility='visible';
PL_ShowLoading(true);
}

//---- Left menu

var MenuItems;

function MenuOC(e, MainMenuItem){
var Submenu, MenuItem, ItemText, RE;

if (!MainMenuItem){
	EventInit(e);
	if (EvSrc.tagName!='SPAN') return;
	MenuItem=EvSrc.parentNode.parentNode;
	if (MenuItem.className.indexOf('left_menu_name')==-1) return;
	
	}
else{
	MenuItem=MainMenuItem;
	}

Submenu=NextNode(MenuItem.nextSibling); ItemText=GetMenuItemText(MenuItem);

if (!getat(Submenu, 'shown')){
	Submenu.style.display='block';
	MenuItem.className='left_menu_name open';
	setat(Submenu, 'shown', 1);
	if (MenuItems)
		MenuItems.value=MenuItems.value+';'+ItemText;
	}
else{
	Submenu.style.display='none';
	MenuItem.className='left_menu_name';
	setat(Submenu, 'shown', '');
	RE=new RegExp(';'+ItemText, "g");
	MenuItems.value=MenuItems.value.replace(RE, '');
	}

//Reinforce for IE :(
if (!MainMenuItem){
	EvSrc.style.cursor='help'; EvSrc.style.cursor='pointer';
	}
}

function OpenMenus(){
var M, Page, LeftMenu, aLinks, i, PageURL, Link, Submenu, MenuItem;

//init
LeftMenu=getbyid('LeftMenu'); MenuItems=D.MenuF.Items;
//Back or smth - restore
if (MenuItems.value){
	RestoreMenus(LeftMenu, MenuItems.value); return;
	}

PageURL=W.location.href;
aLinks=LeftMenu.getElementsByTagName('A');
for(i=0; i<aLinks.length; i++){
	if (aLinks[i].href==PageURL){
		Link=aLinks[i]; break;
		}
	}

if (!Link) MenuItem=NextNode(LeftMenu.firstChild);
else{
	Submenu=Link.parentNode.parentNode;
	MenuItem=Submenu.previousSibling;
	if (MenuItem.nodeType==3) MenuItem=MenuItem.previousSibling;
	}

MenuOC(null, MenuItem);
}

function GetMenuItemText(MenuItem){
return MenuItem.firstChild.firstChild.firstChild.data;
}

function RestoreMenus(LeftMenu, ItemList){
var MenuItem;

MenuItem=NextNode(LeftMenu.firstChild);

while(true){
	ItemText=GetMenuItemText(MenuItem);
	if (ItemList.indexOf(ItemText)!=-1){
		MenuOC(null, MenuItem); ItemList=MenuItems.value;
		if (ItemList.length==0) break;
		}
	
	MenuItem=NextNode(MenuItem.nextSibling);
	if (!MenuItem) break;
	MenuItem=NextNode(MenuItem.nextSibling);
	if (!MenuItem || MenuItem.tagName!='DIV') break;
	}

}

//---- Left menu - End

//Std

var W=window, D=document, F, E, EvSrc, Gec, Op, Ns, Saf, IE7, Nav;

function NextNode(o){
if (o.nodeType==3) o=o.nextSibling; return o;
}

function EventInit(e){
E=(!Gec ? event : e); EvSrc=E[Gec ? 'target' : 'srcElement'];
if (Ns && EvSrc.nodeType==3) EvSrc=EvSrc.parentNode;
}

function InitUA(){

Nav=W.navigator.userAgent; IE7=false; 
Gec=(Nav.indexOf('Gecko')!=-1); Op=(Nav.indexOf('Opera')!=-1);
Ns=(Gec && Nav.indexOf('Netscape')!=-1); Saf=(Gec && Nav.indexOf('Safari/')!=-1);

if (!Gec && !Op){
	Nav.match(/ MSIE (\d+)/);
	if (RegExp.$1>=7) IE7=true;
	}
}

function getat(o, at){
var val=o.getAttribute(at); if (Op && val=='') val=null; return val;
}

function setat(o, at, val){
if (Op && val==null) val=''; o.setAttribute(at, val);
}

function getbyid(id){return D.getElementById(id);}

//Std - End

InitUA();