/* This notice must be untouched at all times.


wz_alinks.js    v. 1.0

Copyright (c) 2005 APLogica, Inc.. All rights reserved.
Created 1. 0. 2005 by APLogica, Inc.
Last modified: 12. 12. 2005

Add-on affliate popups for wz_tooltips

LICENSE: LGPL

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (LGPL) as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

For more details on the GNU Lesser General Public License,
see http://www.gnu.org/copyleft/lesser.html
*/

function CJ(mode,id,d1,d2) {
var qu='"'; var jmp='http:\/\/www.'+d1+'\/click-'+id;
 switch (mode) /* mode: 0-click  1-popup  */
  {
   case 0: window.location=jmp;break; 
   case 1: return ('<a href='+qu+jmp+qu+' target=_blank><img src='+qu+'http:\/\/www.'+d2+'\/image-'+id+qu+' width=120 height=60 border=0><\/a>');break; 
  }
}

function BF(mode,bfmid,siteid,bfpage,img,alt) {
var qu='"'; var jmp='http:\/\/service.bfast.com\/bfast\/click?bfmid='+bfmid+'&siteid='+siteid+'&bfpage='+bfpage;
 switch (mode) /* mode: 0-click  1-popup  */
  {
   case 0: window.location=jmp;break; 
   case 1: return ('<IMG SRC='+qu+'http:\/\/service.bfast.com\/bfast\/serve?bfmid='+bfmid+'&siteid='+siteid+'&bfpage='+bfpage+qu+' BORDER=0 WIDTH=1 HEIGHT=1 NOSAVE ><A HREF='+qu+jmp+qu+' TARGET=_blank><IMG SRC='+qu+img+qu+' BORDER=0 WIDTH=125 HEIGHT=125 ALT='+alt+'><\/A>');
  }

}

function AZ(mode,kw) {
var qu='"'; var jmp='http:\/\/www.amazon.com\/exec\/obidos\/redirect?link_code=ur2&tag=familyportcom&camp=1789&creative=9325&path=external-search%3Fsearch-type=ss%26keyword='+escape(kw)+'%26index=blended';
 switch (mode) /* mode: 0-click  1-popup  */
  {
   case 0: window.location=jmp;break; 
   case 1: return ('<a href='+jmp+qu+' target=_blank><img src='+qu+'http:\/\/rcm-images.amazon.com\/images\/G\/01\/associates\/2005\/served-banners\/us_banner_logob_120x60.gif'+qu+' border=0><\/a><img src='+qu+'http:\/\/www.assoc-amazon.com\/e\/ir?t=familyportcom&amp;l=ur2&amp;o=1'+qu+' width=1 height=1 border=0 \/>');
  }
}

function AZimg(mode,img,jmp) {
	var qu='"'; 
 	switch (mode) /* mode: 0-click  1-popup  */
  	{
	   case 0: window.location=jmp;break; 
	   case 1: return ('<a href='+qu+jmp+qu+' target=_blank><img src='+qu+img+qu+' border=0><\/a>');
	}
}

function $(mode,adv,kw,p1,p2) {
 switch (adv)
  {
    case 'buy':  return escape(CJ(mode,'1870139-10388149','tkqlhce.com','afcyhf.com')); break; 
    case 'geek': return escape(BF(mode,'37919189','39103786','homebtnmay01_3','http:\/\/www.geeks.com\/affiliates\/statlinks\/homepage\/buttons\/homebtnmay01_3.gif','Geeks.com')); break;
    case 'bestmag': return escape(BF(mode,'37922549','41388716','page_home','http:\/\/www.bestdealmagazines.com\/bdm120x60_02.gif','Get the best deal on magazines')); break;
    case 'tracfone': return escape(CJ(mode,'1870139-10402496','jdoqocy.com','lduhtrp.net')); break;

    case 'amazon': return escape(AZ(mode,kw)); break;
    case 'amazonimg': return escape(AZimg(mode,p1,p2)); break;
    default: return escape(AZ(mode,'')); break;
  }
}