﻿/**
*
* http://www.arofex.info
* @author Manu Van De Poel / Manuvdp.be
* @version 1.021
**/
	
/**
* Bannerania constructor
* @constructor
* @param {String} _FlashObjId ID of the Bannerania player in html
* @param {String} _thisObjName name of the Bannerania player
**/
function Bannerania(_FlashObjId,_thisObjName)
{
    this.myPlayerId = _FlashObjId;
    this.myPlayerObj = null;
    this.myThisName = _thisObjName;
    this.myDirection = 1;
    this.mySpeedSlower = 8; // the bigger, the slower
    this.myArofexPlayerHeight =0;
    this.myTimer = null; 
    this.myLastWantedHeight =-1;
    this.SizeSubscribersTick = new Array();
    this.onSlideIsLoaded = new Array();
    this.myPicsFlags = new Object();
    this.myTriggerScroll = false;
	this.mySendActionToFlash = true;
	this.myLastActionNavigate = false;
	this.myFormToSubmit= undefined;
	this.myMaxTimeToSendButtonAction = 1000;
	this.enableTracer = true;
	this.traceAllControls = false;
	this.hasNavigated = false;
	this.myCommunicatorIframe = undefined;
	this.myUserActionExternalPage = undefined;
	this.myUserHash = "";
	this.mySessionID = "";
	this.myToSendActions = new Array();
	this.myIsSending = false;
	this.PrgrmIsLoaded = false;
	this.myLastNavObj = undefined;
	this.myLastAction = undefined;
	this.myInitAllControls = false;
	this.myLanguage = "";
	this.myFirstVisit = false;
}

/**
* Bannerania init
**/
Bannerania.prototype.Init = function()
{	
    //get Bannerania player from html
    this.myPlayerObj = document[this.myPlayerId];
    if (this.myPlayerObj== null || this.myPlayerObj == undefined)
    {
        this.myPlayerObj = GetElement(this.myPlayerId);
    }   
}

/**
* Sets the player height
* @param {int} descriptionHeight desired height of the player
**/
Bannerania.prototype.SetPlayerHeight = function(descriptionHeight)
{
	// check if it comes from the button
	if (this.myLastWantedHeight!=-1)
	{
		// if its from an animation it may not be animated
		// ex.: if we press the close button, it may not open/close anymore
		if (this.myLastWantedHeight != descriptionHeight) return;
	}
	
	// get the player
    obbjj = this.myPlayerObj;
    
    if (this.myArofexPlayerHeight == descriptionHeight) return;
    
    // adjust the title height so it fits with the changed player height
    if (this.myArofexPlayerHeight > descriptionHeight)
    {
        this.myDirection = -1;
        this.moveTitle(descriptionHeight)
    }
    else
    {
        this.myDirection = 1;
        this.moveTitle(descriptionHeight)
    }
    
    //set the player height
    this.myArofexPlayerHeight = descriptionHeight;
    
    //start the timer
    this.myTimer = setTimeout(this.myThisName+".flashObjectTick()",10);
}
    
/**
* Timer tick for changing the height
**/
Bannerania.prototype.flashObjectTick = function()
{
    // get the player
    obbjj = this.myPlayerObj;
    var _theheight = Number(obbjj.height);
    if (this.myDirection==1)
    {
        _theheight = _theheight +((this.myArofexPlayerHeight-_theheight)/this.mySpeedSlower)+1; //20;
        if (_theheight >= this.myArofexPlayerHeight) 
        {
        }
        else
        {
	        this.myTimer = setTimeout(this.myThisName+".flashObjectTick()",10);
        }
    }
    else
    {
        _theheight = _theheight +((this.myArofexPlayerHeight-_theheight)/this.mySpeedSlower); //20;
        if (_theheight > this.myArofexPlayerHeight) 
        {
	        this.myTimer = setTimeout(this.myThisName+".flashObjectTick()",10);
        }
    }
    obbjj.height = _theheight+"px";
   for (i=0;i<this.SizeSubscribersTick.length;i++)
   {
        eval(this.SizeSubscribersTick[i]+"("+_theheight+")");
   }
}

/**
* Moves the title
* @param {int} y distance over which the title has to be moved
**/	
Bannerania.prototype.moveTitle = function(y)
{
	if (this.myPlayerObj.SetVariable)  this.myPlayerObj.SetVariable("TitleY", y); 
}

/**
* Sets the title
* @param {string} titlename desired title
**/	
Bannerania.prototype.SetTitle = function(titlename)

{
   this.myPlayerObj.SetVariable("PageTitle", titlename); 
}

/**
* Sets the wanted height
* @param {int} value wanted height
**/	
Bannerania.prototype.SetLastWantedHeight = function(value)
{
	this.myLastWantedHeight = value;
}

/**
* Register to the flash timer tick
**/	
Bannerania.prototype.SubscribeSizeTick = function(_function)
{
    this.SizeSubscribersTick.push(_function);
}

/**
* Register to the flash play button press
**/    
Bannerania.prototype.FlashPlayPress = function()
{
}

/**
* Register to the flash pause button press
**/	
Bannerania.prototype.FlashPausePress = function()
{
}

/**
* Displays a picture from the banner in the player
* @param {int} picid id of the picture that needs to be displayed
**/	
Bannerania.prototype.ShowPic = function(picid)
{
    if (this.myPicsFlags[picid] == null) this.myPicsFlags[picid] = false;
    var len = this.myPicsFlags.length;
    // hide all images
    var querystring = "";
    for (var _element in this.myPicsFlags)
    {
        if (_element == picid)
        {
            if (this.myPicsFlags[_element] == true)
            {
                querystring += 'Sequencer.'+_element+'.setMc("_alpha","0");';
                this.myPicsFlags[_element] = false;
            }
            else
            {
                querystring += 'Sequencer.openPlayer.doStart();';
                querystring += 'Sequencer.'+_element+'.setMc("_alpha","100");';
                querystring += 'Sequencer.'+picid+'.doStart();';
                this.myPicsFlags[_element] = true;
            }
        }
        else
        {
            querystring += 'Sequencer.'+_element+'.setMc("_alpha","0");';
             //querystring += 'Sequencer.'+picid+'.doEnd();';
            this.myPicsFlags[_element] = false;
        }
   }
   this.TellArofexPlayer(querystring);
}

/**
* Register to the flash banner slideIsLoaded event
**/	
Bannerania.prototype.SubscribeSlideIsLoaded = function (_function)
{
    this.onSlideIsLoaded.push(_function);
}

/**
* Sends the slideIsLoaded event to all subscribed functions
**/	
Bannerania.prototype.SlideIsLoaded = function (_SlideId)
{
   for (i=0;i<this.onSlideIsLoaded.length;i++)
   {
        eval(this.onSlideIsLoaded[i]+"("+_SlideId+")");
   }
}

/**
* 
**/	
Bannerania.prototype.DocIsScrolling = function(_direction)
{
	if (this.PrgrmIsLoaded)
	{
		this.myPlayerObj.SetVariable("ScrollTo", _direction); 
	}
}

/**
* Sends action when the object (and page) has loaded
**/	
Bannerania.prototype.ProgramLoaded = function(_name)
{
    //init tracer when enabled
	//this.myPlayerObj.SetVariable("Session", this.mySessionID);
	//this.myPlayerObj.SetVariable("PageName", document.location); 
	//this.myPlayerObj.SetVariable("Language", this.myLanguage);
	//this.myPlayerObj.SetVariable("ThisPage", this.thisPage); 
	//this.myPlayerObj.SetVariable("FirstVisit", this.myFirstVisit);
	//this.myPlayerObj.SetVariable("Case", this.myCase);
	
	if (this.enableTracer) 
	{
	    this.InitTracer();
	    if (this.traceAllControls) this.InitTraceControls();
	}
	
	this.SendPageAction(document,document.location,"", "Opening",document.title,"Page");
	
	this.PrgrmIsLoaded = true;	
}

/**
* Returns the size of the client window
**/
Bannerania.prototype.f_clientHeight= function() {
	if (window.innerHeight>0) return window.innerHeight;
	return this.f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}

/**
* 
**/	
Bannerania.prototype.f_scrollTop= function() {
	return this.f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}

/**
* 
**/	
Bannerania.prototype.f_filterResults= function(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

/**
* 
**/	
Bannerania.prototype.TellArofexPlayer = function(functionData)
{
    this.myPlayerObj.SetVariable("TellSequencer", functionData); 
}

/**
* Inits the tracer
**/	
Bannerania.prototype.InitTracer = function()
{
	// init iframe used to send trace data to the server
	//document.write("<iframe id=\"CommunicatorFrame\" name=\"_"+this.myThisName+"\" width=\"1\" height=\"1\" frameborder=\"0\" src='http://www.manuvdp.be' ></iframe>");
	//document.write("<img id=\"CommunicatorFrame\" width=\"100\" height=\"100\" src=\"http://www.google.be/images/firefox/fox1.gif\" />");
	this.myCommunicatorIframe = GetElement("CommunicatorFrame");	
	// set the traced object to this page
	this.myCommunicatorIframe["arofexTracer"] = this;
	if(document.all )
	 {
		this.myCommunicatorIframe.onreadystatechange = this.frameloaded;
	 }
	else
	{
		this.myCommunicatorIframe.onload = this.frameloaded;
	}	
}
Bannerania.prototype.InitTraceControls = function()
{
    // get the forms from the html page
	var theformAr = document.getElementsByTagName("FORM");
	if (theformAr.length==0) return;
	
	// search the different forms
	for (var j=0;j<theformAr.length;j++)
	{
	    // search the current form for controls
		var curForm = theformAr[j];
		for (var i=0;i<curForm.length;i++)
		{
			var __element = curForm[i];
			if (this.myInitAllControls)
			{
				var _discription2 = this.GetLabelName(__element);
				this.SendPageAction(__element,this.GetObjName(curForm[i])+"."+this.GetObjName(__element),__element.type,'init',__element.value,"Control",_discription2 );
			}
			
			// set the tracer attribute to this page
			__element["arofexTracer"] = this;
			//alert (String(__element.onclick));
			if (String(__element.onclick).indexOf("ArofexNoTrace") == -1)
			{
				// copy the onclick event to a variable
				__element["onclickf"] = __element.onclick;
				__element.onclick = function()	
				{
					var _bann = this["arofexTracer"];
					// get labelName
					var _discription = _bann.GetLabelName(this);
					if (_discription=="") _discription = this.alt;
					// sends the action information to the tracer (_ControlID,_EntityType, _ActionName,_Value,_Entity)
					_bann.SendPageAction(this,_bann.GetObjName(this.form)+"."+_bann.GetObjName(this),this.type,'Clicked',this.value,"Control",_discription );
					
					// resumes the onclick event (saved in variable)
					if (this["onclickf"] !=undefined) this["onclickf"]();
				}
			}
			// trace the onchange event when it's a textbox
			if (__element.type == "text" || __element.type == "radio" || __element.type == "select-one")
			{
				if (String(__element.onchange).indexOf("ArofexNoTrace") == -1)
				{
					// copy the onchange event to a variable
					__element["onchangef"] = __element.onchange;
					__element.onchange = function() 
					{ 
						var _bann = this["arofexTracer"];
						// sends the action information to the tracer (_ControlID,_EntityType, _ActionName,_Value,_Entity)
						_bann.SendPageAction(this,_bann.GetObjName(this.form)+"."+_bann.GetObjName(this),this.type,'Changed',this.value,"Control");
						
						// resumes the onchange event (saved in variable)
						if (this["onchangef"] !=undefined) this["onchangef"]();
					}
				}
				else
				{
					//alert ("element "+__element.onchange);
				}
			}
		}
	}
	
	// get the links from the html page
	var _links = new Array();
	
	// regular links
	var hrefAr = document.getElementsByTagName("A");

	// image area links
	var areaAr = document.getElementsByTagName("area");
	
	for (i=0;i<hrefAr.length;i++){_links.push(hrefAr[i]);}
	for (i=0;i<areaAr.length;i++){_links.push(areaAr[i]);}
	for (j=0;j<_links.length;j++)
	{
		var __element = _links[j];
		if (String(__element.onclick).indexOf("ArofexNoTrace") == -1)
		{
		    if (String(__element.href).indexOf("javascript:TracerScript()") == -1)
		    {
			    __element["hreff"] = __element.href;
				//alert (__element["hreff"]);
			    if (__element["target"] == "" || __element["target"] == "_self")
				{
					__element.href ="javascript:NullF('"+__element["hreff"].replace(/"/g,"'").replace(/'/g,"\\'")+"');";

				}
			    
			    __element["arofexTracer"] = this;
			    // copy the onclick event to a variable
			    __element["onclickf"] = __element.onclick;
			    if (__element["target"] == "" || __element["target"] == "_self")
				{
				    __element.onclick = function()	
			        {
				        var _bann = this["arofexTracer"];        				
				        // sends the action information
					    _bann.SendActionAndNavigateTo("link",this);
					    // resumes the onclick event (saved in variable)
				        if (this["onclickf"] !=undefined) this["onclickf"]();
				        return;
			        }
				}
				else
				{
			        __element.onclick = function()	
			        {
				        var _bann = this["arofexTracer"];        				
				        // sends the action information
					    _bann.SendPageAction(this, this["hreff"],"href","Clicked",this["hreff"],"Control",this["target"]); 
    					// resumes the onclick event (saved in variable)
				        if (this["onclickf"] !=undefined) this["onclickf"]();
				        return;
			        }
			    }
			}
			else
			{
			    __element.href ="javascript:NullF();";
			    __element["arofexTracer"] = this;
			    // copy the onclick event to a variable
			    __element["onclickf"] = __element.onclick;
			    __element.onclick = function()	
			    {
				    var _bann = this["arofexTracer"];
    				
				    // sends the action information
				    // sends the action information to the tracer (_ControlID,_EntityType, _ActionName,_Value,_Entity)
						_bann.SendPageAction(this,_bann.GetObjName(this),'Button','Clicked',this.value,'Control');
    				
				    // resumes the onclick event (saved in variable)
				    if (this["onclickf"] !=undefined) this["onclickf"]();
			    }
			}
		}
	}
}
Bannerania.prototype.GetLabelName = function(_node )
{
	if (_node==undefined) return;
	var _parNode = _node.parentNode;
	if (_parNode == null) return;
	if (_parNode.nodeName != "TD")
	{
		// div label?
		if (_parNode.nodeName == "DIV" ) 
		{
		    if (_parNode.previousSibling == null) return;
			if (_parNode.previousSibling.nodeName == "DIV")
			{
				if (_parNode.previousSibling.firstChild != null) return _parNode.previousSibling.firstChild.nodeValue;
			}
			else if (_parNode.previousSibling.nodeName == "#text")
			{
				if (_parNode.previousSibling.previousSibling == null) return;
			    if (_parNode.previousSibling.previousSibling.nodeName == "DIV")
				{
					if (_parNode.previousSibling.previousSibling.firstChild != null) return _parNode.previousSibling.previousSibling.firstChild.nodeValue;
				}
			}
			//
		}
		_parNode = _parNode.parentNode;
		if (_parNode.nodeName != "TD") return "";
	}
	var _labelNode =_parNode.previousSibling;
	if( _labelNode != null)
	{
	    if (_labelNode.nodeName != "TD")
	    {
		    _labelNode = _labelNode.previousSibling;
		    if (_labelNode == null) return;
		    if (_labelNode.nodeName != "TD") return;
	    }
	    var _LabelNodeText = _labelNode.firstChild;
	    var _LabelText = _LabelNodeText.nodeValue;
	    if (_LabelNodeText.firstChild != null && _LabelNodeText.firstChild != undefined)
	    {
		    _LabelText = _LabelNodeText.firstChild.nodeValue;
	    }
	    if (_LabelText == null || _LabelText == undefined) return "";
	    return _LabelText;
	}
	else return "";
}
Bannerania.prototype.SendClickAction = function(_Sender)
{
	this.SendAction(_Sender,this.GetObjName(_Sender),_Sender.type,"Clicked",_Sender.value,"Control");
}
Bannerania.prototype.SendChangeAction = function(_Sender)
{
	this.SendAction(_Sender,this.GetObjName(_Sender),_Sender.type,"Changed",_Sender.value,"Control");
}
Bannerania.prototype.SendHrefAction = function(_Sender, _Href)
{
	this.SendAction(_Sender,this.GetObjName(_Sender),_Sender.type,"Clicked",_Sender.value,"Control");
}
/**
* 
**/	
Bannerania.prototype.SendPageAction = function(_Sender,_ControlID,_EntityType, _ActionName,_Value,_Entity,_Description )
{
	this.SendAction(_Sender,_ControlID,_EntityType, _ActionName,_Value,"Page",_Entity ,_Description);
	//if (this.PrgrmIsLoaded)   this.myPlayerObj.SetVariable("PageUserAction", functionData);	
}

/**
* 
**/	
Bannerania.prototype.SendAction = function(_Sender,_ControlID,_EntityType, _ActionName,_Value,_PlayerName ,_Entity,_Description)
{
    var functionData = escape(_ControlID)+":::"+escape(_EntityType)+":::"+escape(_ActionName)+":::"+escape(_Value)+":::Browser:::"+escape(_Entity)+":::"+escape(_Description)+":::"+escape(document.location);
	if (this.PrgrmIsLoaded && _PlayerName=="Page") this.myPlayerObj.SetVariable("SendBrowserAction", functionData); 

	if(this.enableTracer == true)
    {
	    var _Urll = this.myUserActionExternalPage+"?"
	        + "UserHash="+this.myUserHash
	        + "&SessionID="+this.mySessionID
	        + "&PlayerID="+_PlayerName
	        + "&PageName="+escape(document.location)
	        + "&ControlID="+escape(_ControlID)
	        + "&Entity="+escape(_Entity)
	        + "&ActionName="+escape(_ActionName)
	        + "&EntityType="+escape(_EntityType)
	        + "&Description="+escape(_Description)
	        + "&cashBuster="+Math.random(100000)
	        + "&Value="+escape(String(_Value));
    	 
	    this.myLastAction = new Object();
	    this.myLastAction.Sender = _Sender;
	    this.myLastAction.Value = _Value;
	    this.myLastAction.ControlID = _ControlID;
	    this.myLastAction.Entity = _Entity;
	    this.myLastAction.ActionName = _ActionName;
	    this.myLastAction.Description = _Description;
	    this.myLastAction.EntityType = _EntityType;
	    this.myLastAction.PageName = document.location;
	    this.myLastAction.PlayerID = _PlayerName;
	    this.myLastAction.SessionID = this.mySessionID;
	    this.myLastAction.UserHash = this.myUserHash;
    	
	    this.myToSendActions.push(_Urll);
	    if (this.myIsSending == true) return;
	    this.UpdateActionsList();
	}
}

/**
* 
**/	
Bannerania.prototype.frameloaded = function()
{
	var _playerObj = this["arofexTracer"];
	var _stateee = String(this.readyState);
	if (_stateee != undefined&& document.all )
	{//IE bug
		if (_stateee != "complete") return;
	}
	
	if (_playerObj == undefined) return;
	_playerObj.myIsSending = false;

	if (_playerObj.myLastAction !=undefined && _playerObj.myLastAction !=null)
	{
		if (_playerObj.myLastAction.EntityType == "href")
		{
			_playerObj.myLastNavObj = _playerObj.myLastAction.Sender;
			if(_playerObj.myLastNavObj.Description == "" || _playerObj.myLastNavObj.Description == "self") _playerObj.doNavigate();
			return;
		}
	}
	
	if (_playerObj.myToSendActions.length == 0) return;
	//history.go(-1);
	
	_playerObj.UpdateActionsList();
	return;
}

Bannerania.prototype.FlashActionSend = function(_ControlID,_ActionName)
{
	this.myIsSending = false;
	this.UpdateActionsList();
}
/**
* 
**/	
Bannerania.prototype.UpdateActionsList = function()
{
	if (this.myToSendActions.length == 0) return;
	if (this.myIsSending == true) return;
	if (this.PrgrmIsLoaded != true) return;
	this.myIsSending = true;
	var _Urll = this.myToSendActions.shift();
	//if (this.PrgrmIsLoaded) this.myPlayerObj.SetVariable("SendBrowserAction", _Urll[1]); 
	this.myCommunicatorIframe.src = _Urll;
}


/**
* 
**/	
Bannerania.prototype.SendActionAndNavigateTo = function(_ControlID, _objjj)
{
	var _description = "";
	if (_objjj == undefined) _objjj = null;
	if (_objjj.firstChild != null) _description =_objjj.firstChild.nodeValue;
	
	this.myLastActionNavigate = true;
	var _navigateURL = _objjj["hreff"];
	this.myLastNavObj = _objjj;
	
	// check if its an javascript
	if (_navigateURL.indexOf("java") == -1)	
	{
		this.SendPageAction(_objjj, _ControlID,"href","Clicked",_navigateURL,"Control",_description); 
		setTimeout(this.myThisName+".doNavigate()",this.myMaxTimeToSendButtonAction);
	}
	else
	{
		// javascript
		this.SendPageAction(_objjj,_ControlID,"Javascript","Clicked",_navigateURL,"Control",_description); 
		eval(_navigateURL);
	}
}


/**
* Navigates to a new page
**/	
Bannerania.prototype.doNavigate = function(_navigateURL,_target,_props)
{
	//if (this.hasNavigated) return;
	if (this.myLastNavObj == undefined) return;
	var _navigateURL = this.myLastNavObj["hreff"];
	var _target = this.myLastNavObj.target;
	if (_target == "") _target = "_self";
	
	window.open(_navigateURL,_target,_props)
}

/**
* Returns the name of an object (checks for name,id and href)
**/	
Bannerania.prototype.GetObjName = function(_Obj)
{
	if (_Obj ==undefined) return "";
	if (_Obj.name !="") return _Obj.name;
	if (_Obj.id !="") return _Obj.id;
	if (_Obj.href !="") return _Obj.href;
	return "";
}

/**
* 
**/	
Bannerania.prototype.OpenUrl  = function(Name,query,target,method)
{
	if (method.toLowerCase()=="post")
	{
		// get all variables
		var items;
		items= Array();
		items = query.split("&");
		document.write('<form method="post" action="'+Name+'" name="MyMenuFormke">');
		for (i=0;i<items.length;i++)
		{
			document.write('<input type="hidden" name="'+items[i].split("=")[0]+'" value="'+items[i].split("=")[1]+'">');
		}
		document.write('</form>');
		document.all["MyMenuFormke"].submit();
	}
	else
	{
		var items;
		var parameters;
		items= Array();
		parameters = query.split("&").join(",");
		if (target=="") { target ="_self"; }
		//document.write("Name = "+Name+" !!Quer="+query+" !!target="+target+" !!Param ="+parameters);
		if (Name == "?") { Name = ""; }
		window.open(Name+"?"+query,target,"'"+parameters+"'");
	}
}

Bannerania.prototype.InitDebuggerr  = function()
{
	document.write("<div style='position:absolute;top:0px;left:0px;height:150px;width:150px;overflow:auto;' id='arofexDebugger' ></div>");
}
Bannerania.prototype.Debug = function(_Data)
{
	var _objj = GetElement('arofexDebugger');
	_objj.innerHTML = _objj.innerHTML+_Data+"<br>";
}
/**
* Gets html element for different browsers
**/	    
function GetElement(elementid)
{
    if(document.all && !document.getElementById){
		    //"ie"
		    if (document.all[elementid]) return document.all[elementid]; 
    }
    if(document.getElementById){
		    //"NN6";
	    if (document.getElementById(elementid ))  return document.getElementById(elementid);                 
	}
    if(document.layers){
		    //"NN4";
	    if (document.layers[elementid]) return document.layers[elementid]; 
    }
    
}
function NullF()	{}
function ArofexNoTrace() {}
function TracerScript() {}

/**
* Sends an action coming from a control
* _Sender = object from who sends the action
* _ControlID = the ID or Name of that control
* _Controltype = checkbox, button, textfield , ...
* _ActionName = Clicked, changed, show
* _Value = the value
* _Description = description of that action
**/	
Bannerania.prototype.SendCAction = function(_Sender,_ControlID,_Controltype, _ActionName,_Value,_Description )
{
	this.SendPageAction(_Sender,_ControlID,_Controltype, _ActionName,_Value,"Control",_Description )
}

function displayLinkBlock(isVisible)
{
    if(isVisible)
    { 
        //alert("visible");
        //GetElement("linkBlock").setAttribute("visible","true");
        GetElement("linkBlock").style.visibility = "visible";
        GetElement("linkBlock").style.position = "relative";
    }
    else 
    {
        //alert("hidden");
        GetElement("linkBlock").style.visibility = "hidden";
        GetElement("linkBlock").style.position = "absolute";
    }
}
