/*

 * ByTagg Widgets

 *

 * WG 80x15

 */


var gg_following = "";
var GGpopup = function(action)

{

	if (action == 'open')

	{

		document.getElementById('gg-80x15-popup').style.display = 'block';

	}

	else

	{

		document.getElementById('gg-80x15-popup').style.display = 'none';

	}

}

bytagg = new function() 

{

		this.init = function() 

		{

			var root = 'ff'+Math.ceil(Math.random()*100);
			while (gg_following.indexOf("/") != -1) {gg_following = gg_following.replace("/", "!BA;");}	
	

			this.serverResponse = function(data) 

			{

				var loc = escape(document.location);

				var ref = escape(document.referrer);

		    	var div = document.getElementById(root);

		    	

		    	var imgBase = 'http://img.bytagg.com/';

		    	//var getURL = 'http://download.bytagg.com/bytagg.'+gg_lang+'.'+gg_id+'.exe';
				var getURL = 'http://bytagg.com/'+gg_lang+'/download/P_'+gg_id+'/F_'+gg_following+'';


				var hint_width = 50;
				if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
					hint_width = 60;
				}
		    	

		    	var htmlReturn = '<div style="text-align:left;width:114px">';

				htmlReturn = htmlReturn + '<div id="gg-80x15-popup" style="z-index:999998;display:none;width:114px;height:62px;background:transparent url(' + imgBase + 'wg-popup-bg1.png) 0 0 no-repeat;position:absolute;margin:-60px 0 0 -20px">';

				htmlReturn = htmlReturn + '<a target="_blank" id="nottofollowgg" class="nottofollowgg" href="' + getURL + '" style="text-align:left;font-family:Arial;font-size:9px;color:#FFFFFF;width:'+hint_width+'px !important;height:58px;display:block;padding:6px 4px 0 46px;text-decoration:none">';

				htmlReturn = htmlReturn + '<span id="nottofollowgg2" class="nottofollowgg2" style="line-height:12px !important;font-size:10px">'+gg_tx1+'</span>';

				htmlReturn = htmlReturn + '</a>';

				htmlReturn = htmlReturn + '</div>';

		    	htmlReturn = htmlReturn + '<div id="gg-80x15" style="z-index:999999;position:relative;width:80px;height:15px;background:transparent url(' + imgBase + 'wg_80x15.gif) 50% 0 no-repeat">';

				htmlReturn = htmlReturn + '<a target="_blank" href="' + getURL + '" onmouseover="GGpopup(\'open\')" onmouseout="GGpopup(\'close\')" style="text-decoration:none;display:block;width:80px;height:15px;font-size:9px;clear:both">&nbsp;</a>';

				htmlReturn = htmlReturn + '</div>';

				htmlReturn = htmlReturn + '</div>';

		    	

		    	

		    	div.innerHTML = htmlReturn;

		    	div.style.display = 'block'; // make element visible

		    	div.style.visibility = 'visible'; // make element visible

		  	}

	

		  	document.write("<div id='"+root+"' style='display: none'></div>");

			bytagg.serverResponse('');

		}

}