//TOP banner start
var dclk_ban_file = "http://banners.adnet.lt/i/viasatplushd_750x100.swf";
var dclk_ban_width = 750;
var dclk_ban_height = 100;
var dclk_click_url = "http://www.viasat.lt";
var rediras = "<%%REDIR%%>";

function switch_item(item, value) {
	if (document.all) {eval('dclk_' + item + '.style.visibility=\'' + value+ '\'');}
	else if (navigator.userAgent.indexOf('Gecko')>0) {eval('dclk_div["dclk_' + item + '"].style.visibility=\'' + value+ '\'');}
}

function dclk_show_expand() {switch_item('banner', 'visible');}
function dclk_hide_expand() {switch_item('banner', 'hidden');}

var dclk_crea1 = '';
dclk_crea1 = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="banner" width="'+dclk_ban_width+'" height="'+dclk_ban_height+'"><param name="movie" value="'+dclk_ban_file+'?clickTAG='+dclk_click_url+'" /><param name="wmode" value="transparent" /><param name="Autostart" value="true" /><param name="Quality" value="high" /><param name="allowScriptAccess" value="always" /><embed wmode="transparent" src="'+dclk_ban_file+'?clickTAG='+dclk_click_url+'" swLiveConnect="TRUE" width="'+dclk_ban_width+'" height="'+dclk_ban_height+'" type="application/x-shockwave-flash" pluginspage="' + document.protocol + '//www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" quality="high" allowScriptAccess="always"><\/embed><\/object>';

if (document.all || navigator.userAgent.indexOf('Gecko')>0) {
	document.write('<div id="dclk_banner" style="position:relative; top:0px; left:0px; width:750; height:100; visibility:visible; z-index:100;">');
	document.write(dclk_crea1);
	document.write('<\/div>');
	dclk_div = document.getElementsByTagName("div");
} 
else {	document.write(dclk_crea1); }
// TOP banner end


if(typeof org=="undefined"){var org=new Object();}if(typeof org.openx=="undefined"){org.openx=new Object();}if(typeof org.openx.util=="undefined"){org.openx.util=new Object();}if(typeof org.openx.SWFObjectUtil=="undefined"){org.openx.SWFObjectUtil=new Object();}org.openx.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=org.openx.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new org.openx.PlayerVersion(_5.toString().split(".")));}this.installedVer=org.openx.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){org.openx.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};org.openx.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new org.openx.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};org.openx.SWFObjectUtil.getPlayerVersion=function(){var _23=new org.openx.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new org.openx.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new org.openx.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new org.openx.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new org.openx.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};org.openx.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};org.openx.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};org.openx.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};org.openx.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(org.openx.SWFObject.doPrepUnload){if(!org.openx.unloadSet){org.openx.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",org.openx.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",org.openx.SWFObjectUtil.prepUnload);org.openx.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=org.openx.util.getRequestParameter;var FlashObject=org.openx.SWFObject;var SWFObject=org.openx.SWFObject;document.mmm_fo=1; 

var banner_file = "http://banners.adnet.lt/i/viasatplushd_700x500.swf";  // flash banner URL
var banner_link = "http://www.viasat.lt";  // link URL and macros
var banner_width = 700;  // banner width (px)
var banner_height = 500; // banner height (px)

var MAX_imp = '';
MAX_imp += "<"+"div id=\"MAX_imp\" style=\"position:absolute; width:"+banner_width+"px; height:"+banner_height+"px; z-index:99999; left: 0px; top: 0px; visibility: hidden\">\n";
MAX_imp += "<"+"div id=\'imp_123\' style=\'display: inline;\'><"+"a href=\'"+banner_link+"\' target=\'_blank\'><"+"img src=\'http://banners.adnet.lt/pixel.gif\' width=\'"+banner_width+"\' height=\'"+banner_height+"\' alt=\'\' title=\'\' border=\'0\' /><"+"/a><"+"/div>\n";
MAX_imp += "<"+"script type=\'text/javascript\'><"+"!--// <"+"![CDATA[\n";
MAX_imp += "var ox_swf = new FlashObject(\'"+banner_file+"\', \'Advertisement\', \'"+banner_width+"\', \'"+banner_height+"\', \'4\');\n";
MAX_imp += "ox_swf.addVariable(\'clickTAG\', \'"+banner_link+"\');\n";
MAX_imp += "ox_swf.addParam(\'wmode\',\'transparent\');\n";
MAX_imp += "ox_swf.addParam(\'allowScriptAccess\',\'always\');\n";
MAX_imp += "ox_swf.write(\'imp_123\');\n";
MAX_imp += "// ]]> --><"+"/script>\n";
MAX_imp += "<"+"/div>\n";
MAX_imp += "<iframe id=\"MAX_imp_adclick\" name=\"MAX_imp_adclick\" src=\"\" width=\"1\" height=\"1\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"no\"></iframe>\n";
document.write(MAX_imp);

function grayOut(vis, options) {
	// Pass true to gray out screen, false to ungray
	// options are optional.  This is a JSON object with the following (optional) properties
	// opacity:0-100         // Lower number = less grayout higher = more of a blackout 
	// zindex: #             // HTML elements with a higher zindex appear on top of the gray out
	// bgcolor: (#xxxxxx)    // Standard RGB Hex color code
	// grayOut(true, {'zindex':'50', 'bgcolor':'#0000FF', 'opacity':'70'});
	// Because options is JSON opacity/zindex/bgcolor are all optional and can appear
	// in any order.  Pass only the properties you need to set.
	var options = options || {}; 
	var zindex = options.zindex || 9999;
	var opacity = options.opacity || 80;
	var opaque = (opacity / 100);
	var bgcolor = options.bgcolor || '#000000';
	var dark=document.getElementById('darkenScreenObject');
	if (!dark) {
		// The dark layer doesn't exist, it's never been created.  So we'll
		// create it here and apply some basic styles.
		// If you are getting errors in IE see: http://support.microsoft.com/default.aspx/kb/927917
		var tbody = document.getElementsByTagName("body")[0];
		var tnode = document.createElement('div');           // Create the layer.
			tnode.style.position='absolute';                 // Position absolutely
			tnode.style.top='0px';                           // In the top
			tnode.style.left='0px';                          // Left corner of the page
			tnode.style.overflow='hidden';                   // Try to avoid making scroll bars            
			tnode.style.display='none';                      // Start out Hidden
			tnode.id='darkenScreenObject';                   // Name it so we can find it later
		tbody.appendChild(tnode);                            // Add it to the web page
		dark=document.getElementById('darkenScreenObject');  // Get the object.
	}
	if (vis) {
		// Calculate the page width and height 
		if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
			var pageWidth = document.body.scrollWidth+'px';
			if (window.innerHeight) {
				var pageHeight = (document.body.scrollHeight < window.innerHeight ? window.innerHeight : document.body.scrollHeight) + 'px';
			}
			else {
				var pageHeight = document.body.scrollHeight + "px";
			}
		} else if( document.body.offsetWidth ) {
			var pageWidth = document.body.offsetWidth+'px';
			var pageHeight = document.body.offsetHeight+'px';
		} else {
			var pageWidth='100%';
			var pageHeight='100%';
		}   
		var pageWidth='100%';

		//set the shader to cover the entire page and make it visible.
		dark.style.opacity=opaque;                      
		dark.style.MozOpacity=opaque;                   
		dark.style.filter='alpha(opacity='+opacity+')'; 
		dark.style.zIndex=zindex;        
		dark.style.backgroundColor=bgcolor;  
		dark.style.width= pageWidth;
		dark.style.height= pageHeight;
		dark.style.display='block';                          
	} else {
		dark.style.display='none';
	}
}

function MAX_findObj(n, d) {
  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=MAX_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MAX_getClientSize() {
	if (window.innerHeight >= 0) {
		return [window.innerWidth, window.innerHeight];
	} else if (document.documentElement && document.documentElement.clientWidth > 0) {
		return [document.documentElement.clientWidth,document.documentElement.clientHeight]
	} else if (document.body.clientHeight > 0) {
		return [document.body.clientWidth,document.body.clientHeight]
	} else {
		return [0, 0]
	}
}

function MAX_adlayers_place_imp()
{
	var c = MAX_findObj('MAX_imp');

	if (!c)
		return false;

	_s='style'

	var clientSize = MAX_getClientSize()
	ih = clientSize[1]
	iw = clientSize[0]

	if(document.all && !window.opera)
	{
		sl = document.body.scrollLeft || document.documentElement.scrollLeft;
		st = document.body.scrollTop || document.documentElement.scrollTop;
		of = 0;
	}
	else
	{
		sl = window.pageXOffset;
		st = window.pageYOffset;

		if (window.opera)
			of = 0;
		else
			of = 16;
	}

		 c[_s].left = parseInt(sl+(iw - banner_width) / 2 +0) + (window.opera?'':'px');
		 c[_s].top = parseInt(st+(ih - banner_height) / 2 +0) + (window.opera?'':'px');

	c[_s].visibility = MAX_adlayers_visible_imp;
    c[_s].display = MAX_adlayers_display_imp;
    if (MAX_adlayers_display_imp == 'none') {
        c.innerHTML = '&nbsp;';
    }
}

function imp_switch_select(value) {
       for (i = 0; i < document.all.tags('SELECT').length; i++) {obj = document.all.tags('SELECT')[i];if (! obj || ! obj.offsetParent) continue; obj.style.visibility = value;}
    }

function MAX_simplepop_imp(what)
{
	var c = MAX_findObj('MAX_imp');

	if (!c)
		return false;

	if (c.style)
		c = c.style;

	switch(what)
	{
		case 'close':
			MAX_adlayers_visible_imp = 'hidden';
            //MAX_adlayers_display_imp = 'none';
			MAX_adlayers_place_imp();
			window.clearInterval(MAX_adlayers_timerid_imp);
			if (document.all) imp_switch_select('visible'); //show SELECT
			document.body.style.overflow='visible'; //show SCROLLBAR
			dclk_show_expand();
			grayOut(false);			
			break;

		case 'open':
			grayOut(true);
			dclk_hide_expand();
			MAX_adlayers_visible_imp = 'visible';
            MAX_adlayers_display_imp = 'block';
			MAX_adlayers_place_imp();
			MAX_adlayers_timerid_imp = window.setInterval('MAX_adlayers_place_imp()', 10);
			if (document.all) imp_switch_select('hidden'); // hide SELECT		
			document.body.style.overflow='hidden'; //hide SCROLLBAR
			break;
	}
}


function ad_close() {
       MAX_simplepop_imp('close');
    }
function ad_open() {
	   MAX_simplepop_imp('open');
	   document.getElementById('MAX_imp_adclick').src=rediras;
    }
function ad_visible() {
       return MAX_adlayers_visible_imp;
    }

var MAX_adlayers_timerid_imp;
var MAX_adlayers_visible_imp;
var MAX_adlayers_display_imp;

//MAX_simplepop_imp('open');
