function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function actFloatLayer(Margin, slideTime, layerName, Type, browser)
{  
   //===== initial the properties ===== begin =====
   
   switch(browser)
   {
      case (1):
                  find = (Type < 3) ? document.body.clientHeight : document.body.clientWidth;
                  current = (Type < 3) ? eval(layerName + ".style.pixelTop") : eval(layerName + ".style.pixelLeft");
                  scrollAt = (Type < 3) ? document.body.scrollTop : document.body.scrollLeft;
                  break;

      case (2): 
                  find = (Type < 3) ? window.innerHeight : window.innerWidth;
                  current = (Type < 3) ? eval("document." + layerName + ".top") : eval("document." + layerName + ".left");
                  scrollAt = (Type < 3) ? window.pageYOffset : window.pageXOffset;
                  break;

      case (3): 
                  find = (Type < 3) ? window.innerHeight : window.innerWidth;
                  current = (Type < 3) ? parseInt(eval("document.getElementById('" + layerName + "').style.top")) : parseInt(eval("document.getElementById('" + layerName + "').style.left")); 
                  scrollAt = (Type < 3) ? window.scrollY : window.scrollX;
                  break;
   }

   //===== initial the properties ===== end =====
 

   //========== Main Trigger ========== begin =====
   
   switch(Type)
   {
      case (1): case (3): //Type : top and left
         newTarget = scrollAt + Margin;
         break;
      case (2): case (4): //Type : bottom and right
         newTarget = scrollAt + find - Margin;
         break;
   }
   
   if ( current != newTarget ) 
   {        
      if (newTarget !=  this.target ) 
      { 
         //========== Start Float ========== begin =====

         target = newTarget;

         now = new Date();
         Mul = target - current;
         Wave = Math.PI / ( 2 * slideTime );
         Pass = now.getTime();

         if (Math.abs(Mul) > find) 
         { 
            
            Dis = (Mul > 0) ? target - find : target + find ;
            Mul = (Mul > 0) ? find : -find ;
         }
   
         else 	 
            Dis = current 

         //========== Start Float ========== end =====
      } 
      
      //========== Animator ========== begin =====

      now = new Date();
      newPosition = Mul * Math.sin( Wave * ( now.getTime() - Pass ) ) + Dis;

      newPosition = Math.round(newPosition);

      if (( Mul > 0 && newPosition > current ) || ( Mul < 0 && newPosition < current )) 
      { 
         switch(browser)
         {
            case (1):
                        (Type < 3) ? eval(layerName + ".style.pixelTop = newPosition;") : eval(layerName + ".style.pixelLeft = newPosition;");
                        break;
            case (2):
                        (Type < 3) ? eval("document." + layerName + ".top = newPosition;") : eval("document." + layerName + ".left = newPosition;");
                        break;
            case (3):
                        (Type < 3) ? eval("document.getElementById('" + layerName + "').style.top = newPosition + 'px';") : eval("document.getElementById('" + layerName + "').style.left = newPosition + 'px';");
                        break;
         }         
      }       

      //========== Animator ========== end =====
   } 

   //========== Main Trigger ========== end =====
}

function startFloatLayer(layerName, x, Margin, slideTime, Type) 
{
	
   //===== verify the Type ===== begin =====
   var browser;

   if (document.all)
      browser = 1;  //ie4

   if (document.layers)
      browser = 2;  //ns4

   if (!document.all && document.getElementById)
      browser = 3 ; //ns6
   
	//making layer visible (FOR PRINTING IT SHOULD BE INVISIBLE)
	/*
	switch(browser)	{
		case (1):
								eval(layerName + ".style.visibility = 'visible';");
								break;
		case (2):
								eval("document." + layerName + ".visibility = 'visible';");
								break;
		case (3):
								eval("document.getElementById('" + layerName + "').style.visibility = 'visible';");
								break;
	}
	*/
	 
	 //moving the thing up and down	 
   setInterval("actFloatLayer(" + Margin + ", " + slideTime + ", '" + layerName + "', " + Type + ", " + browser + ")", 1); //10
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function neonixToggle(itemID,linkID){// Neonix Toggle Ver 3.0.0 - www.neonix.net/dw.mv
	if (document.getElementById && navigator.userAgent.indexOf('Opera') == -1){
		var itemEL = document.getElementById(itemID);
		var linkEL = document.getElementById(linkID);
		itemEL.className = itemEL.className == 'TG_visible' ? 'TG_hidden' : 'TG_visible';
		linkEL.innerHTML = itemEL.className == 'TG_hidden' ? 'more &gt;&gt;' : '&lt;&lt; less';
	}
}

function toggleNews(box) {
	if (document.getElementById(box + "Content").style.display != "block") {
		document.getElementById(box + "Content").style.display = "block";
		document.getElementById(box + "Title").className = "mainContentDark";
	} else {
		document.getElementById(box + "Content").style.display = "none";
		document.getElementById(box + "Title").className = "mainContentDark";
	}
}