jQuery(function($){
	$('#edBanner').click(function(){
		window.open("http://www.shina3000.com/","_blank")
		return false
	})
	$('input.submit_button').click(function(){
		if($(this).attr('clicked'))
			return false;
		else{
			$(this).attr('clicked',true).slideUp('slow')
			$('#waiting').slideDown('slow')
		}
	})
})

openCat = 0;
function expandCat(catID){
	if(catID != openCat){
		if(openCat)
			$('#cat' + openCat).hide('_default')
		$('#cat' + catID).toggle('_default')
		openCat = catID
	}else{
		$('#cat' + catID).hide('_default')
		openCat = 0
	}
	return false
}

function goProd(prodID){
	newWin = window.open("/buy_" + prodID + "_online.php","_self")
	return false
}
function goCat(catID){
	newWin = window.open("/" + catID + "_medications.php","_self")
	return false
}

function checkout(prodID){
	newWin = window.open("/checkout_" + prodID + ".php","_blank")
	newWin.focus()
	return false
}

function checkoutFromSelect(selNo){
	prodID = document.getElementById('no_'+selNo).value
	return checkout(prodID)
}

function newWin(url, name, w, h){
	l = (screen.availWidth-10 - w) / 2;
	t = (screen.availHeight-20 - h) / 2;

	features = "width="+w+",height="+h+",left="+l+",top="+t;
	features += ",screenX="+l+",screenY="+t;
	features += ",scrollbars=1,resizable=1,location=0";
	features += ",menubar=0,toolbar=0,status=0";

	nw = window.open(url, name, features);
	if(nw)
	  nw.focus();
	return nw;
}

function winOpen(url,title){
	newWin(url,null,350,350);
}

function support_popup(servername){
	winOpen("http://chat.billrx.com/request.php?l=admin&x=1&deptid=&page=http://"+servername+"/", "")
	return false
}

function expand(id){
	var container = document.getElementById('prodinfo');
	var switcher = document.getElementById('toggle_info');
	var showInfo = 'more product info &raquo;';
	var hideInfo = '« hide info';
	if($('#prodinfo').attr('loaded')){
		$('#prodinfo').toggle('slow');
		switcher.innerHTML = (switcher.innerHTML == hideInfo ? showInfo : hideInfo);
	}else{
		switcher.innerHTML = hideInfo;
		$('#prodinfo').attr('loaded', true).append('<img src="/images/load.gif" alt="" class="load" />').
			load('/prodinfo/' + id + '.php');
	}
}

function addThis(){
	document.write('<a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;pub=xa-4af9acff43ee977b" rel="nofollow">' +
				   '<img src="http://s7.addthis.com/static/btn/v2/lg-bookmark-en.gif" alt="Bookmark and Share" /></a>')
	document.write('<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pub=xa-4af9acff43ee977b"></script>')
}

function counter(){
	document.write('<a href="http://www.liveinternet.ru/click" target="_blank" rel="nofollow" id="LI"><img'+
	' src="http://counter.yadro.ru/hit?t39.01;r'+escape(document.referrer)+((typeof(screen)=="undefined")?"":
	";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+
	";"+Math.random()+'" alt="" /><\/a>')
}

function goAclepsa(prod,pID){
	var params = "screenX=16,screenY=16,location=yes,titlebar=no,status=no,scrollbars=yes,width=990,height=670"
	if(prod)
//		newAclepsa = window.open("http://www.aclepsa.com/shop/cart.php?mode=add&productid=" + pID + "&amount=1&affId=96991","Aclepsa", params)
		newAclepsa = window.open("http://www.aclepsa.com/prescriptions/" + prodID + "?affId=96991","_blank", params)
	else
		newAclepsa = window.open("http://www.aclepsa.com?type=banner&&affId=96991&&img=general-banner-468x60-01.gif","_blank", params)
	return false
}
function goEztablet(){
	newMx = window.open("http://www.max-pharmacy.com/products/" + catID + "/"+ prodID +"/order/","_blank")
//	newMx = window.open("http://www.digipharm.co.uk/products/"  + catID + "/"+ prodID +"/order/","_blank")
	return false
}
function goCarisoprodol(){
	newSoma = window.open("http://hotpillsonline.com/product-cat_28-prd_67.html","_blank")
	return false
}

function goOvertabs(prodID){
	newMx = window.open("http://www.overtabs.net/checkout_"+ prodID +".html","_self")
//	newMx = window.open("http://www.digipharm.co.uk/products/"  + catID + "/"+ prodID +"/order/","_blank")
	return false
}
function go3000(){
	if(prodID == 'celexa') prodAddr = 'buy_generic_celexa_citalopram'
	else if(prodID == 'levitra') prodAddr = 'generic_levitra_free_shipping'
	else if(prodID == 'genericviagra') prodAddr = 'generic_viagra_free_shipping'
//	else if(prodID == '') prodAddr = ''
	new3000 = window.open("http://www.shina3000.com/"+ prodAddr +".html","_blank")
	return false
}
function goRxprom(id){
	if(id)
		newRxprom = window.open("http://www.volkars.com/add-to-cart.php?id=" + id,"_blank")
	else
		newRxprom = window.open("http://www.volkars.com/pill/" + prodID2,"_blank")
	return false
}
function goRxCash(cat,prod){
	if(cat) catID = cat
	if(prod) prodID = prod
	newRxcash = window.open("http://www.hotpillsonline.com/product-cat_" + catID + "-prd_"+ prodID +".html","_blank")
	return false
}

