var fullMonthsArray_lt    = [ "sausio" , "vasario" , "kovo" , "balandþio" , "geguþës", "Birþelio", "Liepos", "rugpjûèio", "rugsëjo" , "spalio", "lapkrièio", "gruodþio" ];
var abrMonthsArray_lt    = [ "sausio" , "vasario" , "kovo" , "balandþio" , "geguþës", "Birþelio", "Liepos", "rugpjûèio", "rugsëjo" , "spalio", "lapkrièio", "gruodþio" ];
var abrDaysArray_lt    = [ "S" , "P" , "A" , "T" , "K", "P"  , "Ð" ];
var fullDaysArray_lt    = [ "Sekamdienis" , "Pirmadienis" , "Antradienis" , "Treèiadienis" , "Ketvirtadienis" , "Penktadienis", "Ðeðtadienis"];

var fullMonthsArray_ru    = [ "ÿíóàð", "ôåâðàë", "Ìàðò", "Àëðèë", "Ìàé", "Þíè", "Þëè", "Àâãóñò", "Ñåïòåìâðè", "Îêòîìâðè", "Íîåìâðè", "Äåêåìâðè"];
var abrMonthsArray_ru    = [ "ÿíó", "ôåâ", "Ìàð", "Àëð", "Ìàé", "Þíè", "Þëè", "Àâã", "Ñåï", "Îêò", "Íîå", "Äåê"];
var fullDaysArray_ru= ["Íåäåëÿ" ,"Ïîíåäåëíèê" ,"Âòîðíèê","Ñðÿäà","×åòâúðòúê","Ïÿòíèê","Ñîáîòà"];
var abrDaysArray_ru    = [ "Í" , "Ï" , "Â" , "Ñ" , "×", "Ï"  , "Ñ" ];

var abrMonthsArray_uk    = [ "Jan" , "Feb" , "Mar" , "Apr" , "May", "Jun", "Jul", "Aug", "Sep" , "Oct", "Nov", "Dec" ];
var fullMonthsArray_uk    = [ "January" , "February" , "March" , "April" , "May", "June", "July", "August", "September" , "October", "November", "December" ];
var abrDaysArray_uk    = [ "Sun" , "Mon" , "Tue" , "Wed" , "Thu", "Fri"  , "Sat" ];
var fullDaysArray_uk    = [ "Sunday" , "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday", "Saturday"];
var titles_uk = [ 'This Morning','Today' , 'This Evening', 'Tm.night' , 'Tm. Morn' , 'Tm. Day' ];
var titles_lt = [ 'Ði Ryt','Ðiandien' , 'Ði vakar','Ðia nakt.' , 'Rytoj Ryt' , 'Rytoj diena.' ];
var titles_ru = [ 'Óòðî','Äåíü' , 'Âå÷åð' ,'Íî÷ü' , 'çâ. Äåíü' , 'çâ. Íî÷ü' ];

var titles = titles_uk;



var hit_online_now;
var hit_total_unq;
var hit_total_vstrs;

var subMenuObj;
var isMSIE;
var mx;
var my;
var dx;
var dy;
var lastMenuIdx=null;
var mouseIsDown;
var global_xoffset = 0;
 var hCursor = "pointer";

var x=document.getElementsByTagName("meta")[2];
try{
    if( x.content.indexOf( "windows-1257" ) != -1 ){
        currentCountry = "lt";
        }
    if( x.content.indexOf(  "windows-1251") != -1 ){
        currentCountry = "ru";
        }
    if( x.content.indexOf(  "windows-1252") != -1 ){
        currentCountry = "uk";
        }
    }
    catch(er){}
                        
if (window.ActiveXObject){
        var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
        var xmlLibDoc=new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.async=false;
    xmlLibDoc.async=false;
    isMSIE=true;
        }
      else if (document.implementation && document.implementation.createDocument){
          isMSIE=false;
         xmlDoc=document.implementation.createDocument("","",null)
         xmlLibDoc=document.implementation.createDocument("","",null)
          }
          

downloadFiles = function(file_names,zip_name ){

    tmpScriptFrame0=document.getElementById("dataFrame");
    if((typeof zip_name)!='undefined'){

        tmpScriptFrame0.src='home/zip_down.php?files='+file_names+'&zip=' + zip_name;        
        }
        else{
            tmpScriptFrame0.src='home/download_mgr.php?file='+file_names;                
            }
    }

function getInnerText(o){
    var txt='';
    for(var i=0; i<o.childNodes.length; i++){
        switch(o.childNodes[i].nodeType){
            case 1 : txt +=getInnerText(o.childNodes[i]); break
            case 3 : txt +=o.childNodes[i].nodeValue; break
            case 8 : txt +="\n"; break
            }
        }
    return txt;
    }
counterRefresh = function(){

    var hit_cntr_data  = getInnerText( frames[ "counterFrame" ].document.documentElement );    

    var tmpAr = hit_cntr_data.split(":");
    
    hit_online_now=tmpAr[0];
    hit_total_unq=tmpAr[1];
    hit_total_vstrs=tmpAr[2];

    }
    

init = function(){
if ($.browser.msie && $.browser.version < 6.9999) {

    hCursor = "hand";         
}
    
$('#navigationPage').css({display:"block"})               
$('.main_content').css({display:"block"})  
                       
 
var tmp_page_name = page_name;   
 
var pgTag = 'span';
if(  $('#currentFormInstance').attr('pageName') != null ){
    tmp_page_name = 'currentFormInstance';  
    
    }
var vOffs = 0;
try{
    vOffs = Number( $('#' + tmp_page_name).children().get(1).getAttribute("_y")) - 35 ;          
    }
    catch(er){}
 
        
        if( $('#' + page_name).attr('pg_fullscreen') == "TRUE" ){

            var bgH = screen.availHeight;
            var bgW = screen.availWidth;
            if( bgW <= 1300 ){
            
               // bgH = document.body.scrollHeight + vOffs; 
                bgW = null; 
                }
            $('#background_' + page_name + '_0').find('#bgDiv').css({height: bgH + "px"});
            if(bgW != null ){
                $('#background_' + page_name + '_0').find('#bgDiv').css({width:bgW + "px"});
                }       
            $('#background_' + page_name + '_0').css({display:"block"}).appendTo('body');  //height:document.body.scrollHeight
           
            }       
        
           else if( $('#' + overlay_name).attr('pg_fullscreen') == "TRUE" ){

                var bgH = screen.availHeight;
                var bgW = screen.availWidth;
                if( bgW <= 1300 ){
                
                   // bgH = document.body.scrollHeight + vOffs; 
                    bgW = null; 
                    }
                $('#background_' + overlay_name + '_0').find('#bgDiv').css({height: bgH + "px"});
                if(bgW != null ){
                    $('#background_' + overlay_name + '_0').find('#bgDiv').css({width:bgW + "px"});
                    }       
                $('#background_' + overlay_name + '_0').css({display:"block"}).appendTo('body');  //height:document.body.scrollHeight
               
                } 
                        
                else{
     
                    $('#background_' + page_name + '_0').css({display:"block"} ); //,left:"50%",marginLeft:"-" + 0.5*( Number($('#'  + tmp_page_name).attr('originalWidth') ) + 22 ) + "px"}); //.appendTo('body');
                    }
 

        
     var bgLeft = (parseInt($('div[isBg="yes"]').css("left"))  );
     if( isNaN(bgLeft ))   {
        bgLeft = 0;
        } 
     if(mainAlign == "CENTER"){
    
        $('#footerDivElement').css({display:"block",top:$('.footerDivElement:last').css('top'),left:(bgLeft -33) + "px"}); 
        $('div[isBg="yes"]').css({display:"block",left:parseInt($('div[isBg="yes"]').css("left"))  });
         
        if($('#' + tmp_page_name).attr('pg_fullscreen') == "FALSE"){
            $('#' + tmp_page_name).css({display:"block",left:"50%",marginLeft:"-" + 0.5*Number(screenWidth)  + "px"}); //.appendTo('body');    
            }
            else{
                $('#' + tmp_page_name).css({display:"block",top:"-" + vOffs + "px",left:"50%",marginLeft: 0.5*(Number($('#'  + tmp_page_name).attr('extremeLeft') ) + Number(screenWidth) - 2*(Number($('#'  + tmp_page_name).attr('extremeRight') )-Number($('#'  + tmp_page_name).attr('extremeLeft') )))+ "px"}).appendTo('body');      
                }
        
        $('#navigationPage').css({display:"block",left:"50%",marginLeft:"-" + 0.5*Number(screenWidth )  + "px"}).appendTo('body').appendTo('body');    
                  
        // $(pgTag + '#background_' + page_name + '_0').remove();
        }
        else{
            var footerPos = $('#'+overlay_name).find('.footerDivElement:last').css('top');
            if(footerPos==null){
                footerPos = $('#'+page_name).find('.footerDivElement:last').css('top');     
               }
            
            if($('#' +  overlay_name).next().css('top') != null && (footerPos == null || footerPos == "auto" || footerPos == "") && $('#' +  overlay_name).next().css('top') != "auto"){
                footerPos =  $('#' + overlay_name).next().css('top');
                }
            if(footerPos==null){
                footerPos =  $('.lastDiv:last').css('top');
             
               
                var tp = parseInt($('#background_' + page_name + '_0').next().next().css('top'));
                if(tp!=null && isNaN(tp)==false){
                   footerPos = ( parseInt(footerPos) + tp ) + "px";
                    }
                }       
     
            $('#footerDivElement').css({display:"block",top:footerPos,left:(bgLeft ) + "px"});  
               
            $('#' + page_name).css({display:"block"});      
            $('#' + tmp_page_name).css({display:"block"});
            $('#' + overlay_name).css({display:"block"});      
            }
    var m_m = document.getElementById("main_menu");
    mlm = 0
 
    switch(menu_effect){ 
        case "FOLLOW":
            
          $("#main_menu").menufx({
            fx: "backout",
            rightmargin: ( 0.5 * Number(mainSpacing) + Number( mlm )  ),
            padding:   0.5 * Number(mainSpacing) ,
            speed: 700,
            bgimage:  menu_effect_img,
            imageheight:  menu_effect_height,
            click: function(event, menuItem) {
                return false;
            }
             });
             
        break;
            
       }
if(isMSIE){
    m_m.style.marginLeft = "3px";
    $('#main_menu').appendTo($('#navigationPage' )) ;
   
    $('div[isBg="yes"]').css({left:(parseInt($('div[isBg="yes"]').css("left")) -3) + "px"}).appendTo($('#' + tmp_page_name));
    $('#navigationPage').find('div[isBg="yes"]').remove();
    }
    
var objects = new Object();
var alltags=document.body.innerHTML;
var obsAr = alltags.split(' id=');
for(var j=1; j<obsAr.length;j++){
    var nm_end = obsAr[j].indexOf(' ');
    var id_name = obsAr[j].substr(0,nm_end);
    var nm_end2 = id_name.indexOf('>');
    if(nm_end2!=-1){
        nm_end=nm_end2;
        id_name = obsAr[j].substr(0,nm_end);
        }

    id_name=id_name.split('"').join('');

    var lst_str=obsAr[j-1].lastIndexOf("<");
    var lst_end=obsAr[j].indexOf("<");    
    var attrib_str = obsAr[j-1].substr(lst_str,obsAr[j-1].length)+ ' id="' + id_name + '" ' + obsAr[j].substring(nm_end,lst_end);
    attrib_str = attrib_str.split('; ').join(';');
    attrib_str = attrib_str.split(': ').join(':');
    attrib_str = attrib_str.split("( '").join("('");
    var tmpAr = attrib_str.split(' ');
    objects[id_name] = new Object();

    for(var k=1; k<tmpAr.length;k++){
        if( tmpAr[k].length>1 ){

            var tmpAr2 = tmpAr[k].split('="');
            if((typeof tmpAr2[1])!='undefined'){
                var tmpAr3=tmpAr2[1].split('"')
                objects[id_name][tmpAr2[0]] = tmpAr3[0];
                }
            }        
        }
    }


for( var j = 0; j <  m_m.childNodes.length  ; j++){
    
    try{
        var mm = document.getElementById("mainMenu" + j);
    
    
        for( var t in objects["mainMenu" + j] ){
            
            //alert(t);
            var t1 = String(t);
            if( t1 != "style" ){
                mm[t1] = objects["mainMenu" + j][t1];
                }
            }

    mm["mainRolloverFontColor"] = toValidColor(mm["mainrolloverfontcolor"]);
    
    mm["menuBarFontColor"] = toValidColor(mm["menubarfontcolor"]);
    mm["background_color"] = toValidColor(mm["background_color"]);
    mm["highlight_color"] = toValidColor(mm["highlight_color"]);
     if(mm.default_image != null ){
        mm.style.backgroundImage = "url(" + mm.default_image + ")";
        }
    mm.onmouseover=function(){    
 
         if(this.hover_image != null ){
            this.style.backgroundImage = "url(" + this.hover_image + ")";
            }    
        if(    this.mainRolloverFontColor != undefined && this.mainRolloverFontColor != "NaN"){
            this.style.color= this.mainRolloverFontColor;
            }        

        if( this.unhilite == 1 ){
            try{    
                if(    this.menuBarFontColor !=undefined && this.menuBarFontColor !="NaN"){
                    eval(lastMenuItem).style.color= this.menuBarFontColor;
                    }    
                if( this.background_color!=undefined && this.background_color !="NaN"){
                    eval(lastMenuItem).style.backgroundColor=this.background_color;
                    }
                    else{
                        eval(lastMenuItem).style.backgroundColor='transparent';
                        }
                }catch(er){
                    if(    this.mainRolloverFontColor !=undefined && this.mainRolloverFontColor !="NaN"){
                        this.style.color= this.mainRolloverFontColor;
                        }
                    }
                }

        if( this.highlight_color !="NaN"){
            this.style.backgroundColor=this.highlight_color;
            }
            else{
    
                this.style.backgroundColor='transparent';
                }
            

        if(this.linktype=="subMenu"){

/*
            hideBaseMenu();
            var t_pos=parseInt(this.style.top);
            var l_pos=parseInt(this.style.left);
            if(menu_alignment.toUpperCase()=="VERTICAL"){
                l_pos=parseInt(this.style.left)  + parseInt(this.style.width);
                t_pos=parseInt(this.style.top)  - parseInt(this.style.height);
                }
                */
            drawSubMenu(this.indx ,   this.cntry ,    this.l_pos  ,  this.t_pos);
            }
            else{
                    hideSubMenu();
                    hideBaseMenu();
                    }                    
        try{    
            if(lastMenuItem.substr(0,8)==  "mainMenu"){
                var idx=Number(lastMenuItem.substr(8,lastMenuItem.length));
    
                navRoot.children[0].children[idx].style.backgroundColor=this.background_color;
                            
                navRoot.children[0].children[idx].style.color= menuBarFontColor;

                }
            }catch(er){}
    
        lastMenuItem = this;

        }
    mm.onmouseout=function(){
        
        if( this.unhilite == null || this.unhilite == 0 ){
             if(this.default_image != null ){
                this.style.backgroundImage = "url(" + this.default_image + ")";
                }
            this.style.color= this.menuBarFontColor;
        
            if( this.background_color!=undefined && this.background_color !="NaN"){
                this.style.backgroundColor=this.background_color;
                }
                else{
                    this.style.backgroundColor='transparent';
                    }
                }
        /*
        if(linktype !="subMenu"){
                hideSubMenu();
                hideBaseMenu();
                }
            */
        }
    mm.onmouseup=function(){        


        this.linklist = this.linklist + htmlExtension;
        hideSubMenu();
        hideBaseMenu();    
        if(this.linktype=="subMenu"){
            var t_pos=parseInt(this.style.top);
            var l_pos=parseInt(this.style.left);
            if(menu_alignment.toUpperCase()=="VERTICAL"){
                l_pos=parseInt(this.style.left)  + parseInt(this.style.width);
                t_pos=parseInt(this.style.top)  - parseInt(this.style.height);
                }
            drawSubMenu(this.indx , this.cntry , this.l_pos  , this.t_pos);
            }
            else{
                location = this.linklist;
                }
            }        
    mm.onmousedown=function(){    
                     if(this.press_image != null ){
                this.style.backgroundImage = "url(" + this.press_image + ")";
                }
        window.status = "Loading selected page.. Please wait.";
        if ( isMSIE ){
            this.style.cursor = "wait";
            }
            else{
                document.styleSheets[0].cssRules[0].style.cursor = 'wait';
                }
        }
        }
        catch(er){}    
                           
    }
    

    
hideSubMenu=function(){
    try{
        subMenuObj.style.display='none';
        subMenuObj._visible=false;
        }
        catch(er){
            }
    }
    
drawSubMenu=function(idx , country , leftPos, topPos){

    subMenuObj = document.getElementById("sub_menu_" + idx );
    subMenuObj.style.display = 'block';
    var subs = subMenuObj.getElementsByTagName("li");

    for( var j = 0; j <  subs.length  ; j++){
        

        try{
        var sm = subs[j];
        
            if(!isMSIE){
                for( var attrib in sm.attributes ){
                    
                    if(attrib!="style"){
                        try{
                            sm[sm.attributes[attrib].name] = sm.attributes[attrib].value
                            }
                            catch(er){}

                        //alert("sm["+sm.attributes[attrib].name+"] =" + sm[sm.attributes[attrib].name]  );
                        }
                    }
                }


            sm["submenu_highlightcolor"] = toValidColor(sm["submenu_highlightcolor"]);
            sm["mainmenurollover"] = toValidColor(sm["mainmenurollover"]);

            sm["submenu_backcolor"] = toValidColor(sm["submenu_backcolor"]);
            sm["mainmenufontcolor"] = toValidColor(sm["mainmenufontcolor"]);
        
            sm.onclick=function(){
                if(this.linktype=="subMenu"){
                    //drawBaseMenu(indx , cntry , this.style.left  ,   this.style.top);
                    }
                    else{
                        hideSubMenu();
                        //hideBaseMenu();
                        location =  this.linklist + htmlExtension;
                        }
                }
            sm.onmouseover=function(){

                if(this.submenu_highlightcolor.substr(0 , 1)=="#"){
                    this.style.backgroundColor=this.submenu_highlightcolor;
                    this.style.color=toValidColor(this.mainmenurollover);
                    }
                /*
                if(linktype=="subMenu"){
                    drawBaseMenu(indx , cntry , this.style.left  ,  this.style.top);
                    }
                    else{
                            hideBaseMenu();
                            }
                            */
                }
            sm.onmouseout=function(){
                this.style.backgroundColor=this.submenu_backcolor;
                this.style.color=this.mainmenufontcolor;
                }
            }
            catch(er){}    

        }
    }
    
function changeBackground(_width , _height, _backColor , bodyBackString, screenColor){
    
    document.body.style.backgroundColor=screenColor;
    if(bodyBackString !=undefined && bodyBackString.length>0){
 
        globalBackgroundProperties=bodyBackString.split(":");
        globalBackgroundImage=globalBackgroundProperties[0];
        if(globalBackgroundImage==undefined){
            globalBackgroundImage="";
            }
        globalBackgroundLeft=globalBackgroundProperties[1];
        if(globalBackgroundLeft==undefined){
            globalBackgroundLeft=0;
            }
        globalBackgroundTop=globalBackgroundProperties[2];
        if(globalBackgroundTop==undefined){
            globalBackgroundTop=0;
            }
        globalBackgroundTiling=globalBackgroundProperties[3];
        if(globalBackgroundTiling==undefined){
            globalBackgroundTiling="repeat";
            }
        globalBackgroundScrolling=globalBackgroundProperties[4];
        if(globalBackgroundScrolling==undefined){
            globalBackgroundScrolling="scroll";
            }
        globalBackgroundCenter=globalBackgroundProperties[5];
        if(globalBackgroundCenter==null){
            globalBackgroundCenter="false";
            }
        document.body.style.backgroundImage='url(' + globalBackgroundImage   + ')';
        document.body.style.backgroundPosition=globalBackgroundLeft + 'px ' + globalBackgroundTop + 'px';
        document.body.style.backgroundRepeat=globalBackgroundTiling;
        document.body.style.backgroundAttachment=globalBackgroundScrolling;
        if(globalBackgroundCenter=="true"){
            document.body.style.backgroundPosition="top center";
            }
                
        }
    }
        
hideSubMenu=function(){
    try{
        subMenuObj.style.display='none';
        subMenuObj._visible=false;
        }
        catch(er){
            }
    }
hideBaseMenu=function(){
    try{
        baseMenuObj.style.display='none';
        baseMenuObj._visible=false;
        }
        catch(er){
            }
    }
    
// e l e m e n t s
//=========================================================================

    
for( var j = 0 ; j < document.getElementsByTagName('*').length; j++ ){
    var tmpId = String(document.all(j).id);
    
    if((typeof tmpId)!='undefined' && tmpId!='undefined' && tmpId.length > 0 ){
            /* 
            if(document.all(j).innerHTML.indexOf("^pp^")!=-1  ){
                var tmpStr = String(document.all(j).innerHTML );
                tmpStr = String(tmpStr).replace(/\^pp\^/g,"|");
                document.all(j).innerHTML = tmpStr;
                    
                }*/    
     
        if(document.all(j).innerHTML.indexOf("~tv~")!=-1 || document.all(j).innerHTML.indexOf("~uv~")!=-1 || document.all(j).innerHTML.indexOf("~ol~")!=-1 ){
            if((typeof hit_total_vstrs)!='undefined'){
                var tmpStr = String(document.all(j).innerHTML );
                tmpStr =tmpStr.replace(/~tv~/g,hit_total_vstrs);
                tmpStr =tmpStr.replace(/~ol~/g,hit_online_now);
                tmpStr = tmpStr.replace(/~uv~/g,hit_total_unq);
                document.all(j).innerHTML = tmpStr;
                }    
            }
        if(document.all(j).innerHTML.indexOf("~d")!=-1 || document.all(j).innerHTML.indexOf("~m")!=-1 || document.all(j).innerHTML.indexOf("~y")!=-1){    
            var now = new Date();
            if((typeof currentCountry)=='undefined' ){
                currentCountry = "uk";
                }
            var lg = currentCountry.toLowerCase() ;
            if((typeof self[ "fullMonthsArray_" + lg  ]) == 'undefined' ){
                lg = "uk";
                }
        
            var monthFull = self[ "fullMonthsArray_" + lg  ][ ( now.getMonth() ) ];
        
            var monthAbr = self[ "abrMonthsArray_" + lg ][ ( now.getMonth() )  ];
            var dayFull = self[ "fullDaysArray_" + lg ][ ( now.getDay() ) ];
            var dayAbr = self[ "abrDaysArray_" + lg ][ ( now.getDay() )  ];
            var d = now.getDate();
        
            var pf = "th";
            if ( d == 3 || d == 23 ){
                pf = "rd";
                }
            if ( d == 1 || d == 21 ){
                pf = "st";
                }
            if ( d == 2 || d == 22 ){
                pf = "nd";
                }
            var tmpStr = String(document.all(j).innerHTML );

            tmpStr = tmpStr.replace(/~d~/g,d);    
        
            tmpStr = tmpStr.replace(/~m~/g,(now.getMonth() + 1 ));
            tmpStr = tmpStr.replace(/~yy~/g,now.getFullYear());

            tmpStr = tmpStr.replace(/~y~/g, String( now.getFullYear()).substr( 2 , 2 ));
            tmpStr = tmpStr.replace(/~mm~/g,monthAbr);
            tmpStr = tmpStr.replace(/~mmm~/g,monthFull);
            tmpStr = tmpStr.replace(/~dd~/g,dayAbr);
            tmpStr = tmpStr.replace(/~ddd~/g,dayFull);
        
            tmpStr = String(tmpStr).replace(/~pf~/g,pf);    

            document.all(j).innerHTML = tmpStr;
            
            }
        // t a b l e s 
        if( tmpId.substr(0,10)=='tablecell_' ){

                

            var tt = document.getElementById(tmpId);
            /*

                */
                

            tt.id = tmpId
            if(!isMSIE){
    
                for( var attrib in tt.attributes ){
                    if(attrib!="style"){
                        try{
                            tt[tt.attributes[attrib].name] = tt.attributes[attrib].value
                            }
                            catch(er){}

                        //alert("tt["+tt.attributes[attrib].name+"] =" + tt[tt.attributes[attrib].name]  );
                        }
                    }



                }
                else{
                    for( var t in objects[tmpId] ){
                        var t1 = String(t);
            
                        if( t1 != "style" ){
                            tt[t1] = objects[tmpId][t1];
                            }
                        }
                    }

            tt.onmouseover=function(force){

                this.row=Number(this.row);
                this.col=Number(this.col);
                if((typeof rolloverClear)=='undefined' || rolloverClear==0 || force == true){
    
                    if( this.rollovertype != 0 ){
                    var col_cnt=this.col + 1;
                    var frst_col=this.col;
                    var row_cnt=this.row + 1;
                    var frst_row=this.row;
                
                    if(this.rolloverextent==1){
                        col_cnt=this.cols;
                        frst_col=0;
                        }
                    if(this.rolloverextent==2){
                        row_cnt=this.rows;
                        frst_row=0;
                        }

                    if(isMSIE){
                        var cvr=document.getElementById("cell_" + this.pageobj + "_" +  this.clr_id + "_"+ this.row + "_" + this.col);                        
                        }else{
                            var cvr=document.getElementById("txt_" + this.pageobj + "_" + this.clr_id + "_"+ this.row + "_" + this.col);                        
                            }    
                    try{
                    if((typeof cvr)=='undefined'&&(typeof cvr._tempHTML_text)=='undefined'){
                        cvr._tempHTML_text = cvr.innerHTML;
                        }    
                        }catch(er){}        
                    var clr_id = this.clr_id;                
                    if(lastRollId!=-1&&lastRollId!=this.clr_id){
                        clr_id=this.lastRollId;
                        }    
                    lastRollId = this.clr_id;    
    
                    for(var c=0; c<this.cols; c++){
                        for(var d=0; d<this.rows; d++){
                            //alert("base_" +  this.pageobj + "_" +  clr_id + "_" + d + "_" + c);
                            var bse=document.getElementById("base_" + this.pageobj + "_" +  clr_id + "_" + d + "_" + c);

                            try{
                                var tmp_txt=document.getElementById("txt_" + this.pageobj + "_" +  clr_id + "_"+ d + "_" + c);
                                if((typeof bse.originalBgColor)!='undefined'){//&&tmp_txt.innerText.length>0 ){    

                                     bse.style.backgroundColor=bse.originalBgColor;
                                     }
                             }
                             catch( er ){ }    
                             //alert("back_" + this.pageobj + "_" +  clr_id + "_"+ d + "_" + c);
                             var tmp_bak=document.getElementById("back_" + this.pageobj + "_" +  clr_id + "_"+ d + "_" + c);                 
                             if(isMSIE){
                                var tmp_cvr=document.getElementById("cell_" + this.pageobj + "_" +  clr_id + "_"+ d + "_" + c);
                                }else{
                                    var tmp_cvr=document.getElementById("txt_" + this.pageobj + "_" +  clr_id + "_"+ d + "_" + c);                        
                                    }    
                            try{            
        
                                 if((typeof tmp_cvr)!='undefined'&&tmp_cvr._tempHTML_text!=undefined&&tmp_cvr._tempHTML_text.length>0&&tmp_cvr.innerHTML!=tmp_cvr._tempHTML_text ){
                                     tmp_cvr.innerHTML= tmp_cvr._tempHTML_text 
                                     //tmp_cvr.style.backgroundColor = bse.originalBgColor;                                 
                                     }
                                 }catch(er){}
                             if((typeof bse)!='undefined'&&(typeof bse.originalBgColor)!='undefined'){
                                 tmp_bak.style.backgroundColor = bse.originalBgColor;
                                 }
                             }                                     
                         }
                     if((typeof rollovercolor)!='undefined'&& rollovercolor.toUpperCase() != "NONE" && rollovercolor.toUpperCase() != "UNDEFINED"){
                         //cvr.style.backgroundColor = rollovercolor;                     
                         }
                     
                    for(var c=frst_col; c<col_cnt; c++){
                        for(var d=frst_row; d<row_cnt; d++){
                            if(isMSIE){
                                var tmp_cvr=document.getElementById("cell_" + this.pageobj + "_" +  this.clr_id + "_"+ d + "_" + c);
                                }

                            if(isMSIE==false||(tmp_cvr!=null&&tmp_cvr.innerText.length>0)){            
                                var bak=document.getElementById("back_" + this.pageobj + "_" +  this.clr_id + "_"+ d + "_" + c);                            
                                 bak.style.backgroundColor = this.rollovercolor;
                                 }
                             }
                         }        
                         
                    if( (typeof rollFontColor)!='undefined'&& rollFontColor.toUpperCase() != "NONE" && rollFontColor.toUpperCase() != "UNDEFINED"){
                        if(isMSIE){
                            var tmpAr = cvr._tempHTML_text.split("COLOR:");
                            }
                            else if(isOpera){
                                var tmpAr = cvr._tempHTML_text.split("color:");
                                }
                                else{
                                    var tmpAr = cvr._tempHTML_text.split("rgb");
                                    }
                        for( var h = 0 ; h < tmpAr.length;h++ ){
                            if( tmpAr[ h ].substr( 0 , 2 )==' #'){
                                tmpAr[ h ] =  rollFontColor + tmpAr[ h ].substring( 8 , tmpAr[ h ].length )
                                }
                                else if( tmpAr[ h ].substr( 0 , 1 )=='#'){
                                    tmpAr[ h ]=rollFontColor + tmpAr[ h ].substring( 7 , tmpAr[ h ].length )
                                    }
                                    else if( tmpAr[ h ].substr( 0 , 1 )=='('){
                                        var endIdx = tmpAr[ h ].indexOf(";");
                                        tmpAr[ h ] =  rollFontColor + tmpAr[ h ].substring( endIdx , tmpAr[ h ].length )
                                        }
                            }
                        if(isMSIE||isOpera){
                            var hiliteText = tmpAr.join("COLOR:")
                            }
                            else{
                                var hiliteText = tmpAr.join("")
                                }
                        cvr.innerHTML=hiliteText;
                        }

                    for(var c=frst_col;c<col_cnt;c++){
                        for(var d=frst_row;d<row_cnt;d++){
                            if(this.rollovertype==1){
                                var bse=document.getElementById("base_" + this.pageobj + "_" +  this.clr_id + "_" + d + "_" + c);
                                    if(bse!=null){
                                        if((typeof bse.originalBgColor)=='undefined'){
                                            bse.originalBgColor=this.bgc;                                    
                                            if(bse.originalBgColor.length==0){
                                                bse.originalBgColor='transparent';
                                                }
                                            }
                                        bse.style.backgroundColor=this.rollovercolor;
                                        }
                                }        
                            if(this.rollovertype==2){
                                var cvr=document.getElementById("cover_" + this.pageobj + "_" +  this.clr_id + "_" + d + "_" + c);
                                if((typeof cvr.originalBgColor)=='undefined'){
                                    cvr.originalBgColor=cvr.style.backgroundColor;
                                    }
                                cvr.style.backgroundColor=rollovercolor;
                                cvr.style.cursor="pointer";
                                if ( isMSIE == true ){
                                    cvr.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=' + rolloverAlpha + ')';
                                    }
                                    else{
                                        cvr.style.opacity = Number( rolloverAlpha ) / 100;
                                        }
                                }
                            
                            }
                        }

                    //    var tmp_tbl=document.getElementById("table_" + this.pageobj + "_" +  this.clr_id  );                
                    //    tmp_tbl.style.width=tmp_tbl.totalTableWidth+"px";    
    
                    }    
                }
          }
      tt.onmouseout=function(){
                 if(this.rollovertype!= 0){
     
                    var col_cnt=this.col + 1;
                    var frst_col=this.col;
                    var row_cnt=this.row + 1;
                    var frst_row=this.row;
                    if(this.rolloverextent==1){
                        col_cnt=this.cols;
                        frst_col=0;
                        }
                    if(this.rolloverextent==2){
                        row_cnt=this.rows;
                        frst_row=0;
                        }
                    
                    for(var c=frst_col; c<col_cnt; c++){
                        for(var d=frst_row; d<row_cnt; d++){
                             if(this.rollovertype==2){

                                var cvr=document.getElementById("cell_" + this.pageobj + "_" + this.clr_id + "_"+ d + "_" + c);
                                cvr.style.backgroundColor=cvr.originalBgColor;
                                var cvr=document.getElementById("cover_" + this.pageobj + "_" +  this.clr_id + "_" + d + "_" + c);
                                if ( isMSIE == true ){
                                    cvr.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=0)';
                                    }
                                    else{
                                        cvr.style.opacity = 0;
                                        }
                                }

                            }
                        }
                    } 
          }
            tt.onmousedown=function(){

                lastLinkPressed=this;
                var cvr=document.getElementById("cover_" + this.pageobj + "_" + this.clr_id + "_" + this.row + "_" + this.col);
                cvr.style.cursor="wait";
                window.status = "Loading selected page..Please wait.";
                
                var bse=document.getElementById("base_" + this.pageobj + "_" +  this.clr_id + "_" + this.row + "_" + this.col);
                bse.style.cursor="wait";
                this.isClicked=true;
                this.onmouseout();
                this.onmouseover(true);
                var cAction=this.clickaction;

                var cmd=cAction.getNDL(0, "~~");
                                    
                var target=cAction.getNDL(1, "~~");
                if(cmd.indexOf("'")==-1){

                    if(target.toUpperCase()=="_BLANK"){
                            newWin=window.open(cmd);
                            }        
                            else{
                                window.location = cmd;
                                }                    
                    }
                    else{
                        var tmpAr=cmd.split("'");
                        var pgName = this.pageName
                        if(tmpAr[7]==undefined){
                            tmpAr[7]="N";
                            }
                        var pgId = this.id;
                        
                        if ( (typeof tmpAr[5]) != 'undefined' && tmpAr[5].toUpperCase() == "POPUP" ){
                            target = undefined;
                            pgName = undefined;
                            tmpAr[7]= undefined;
                            pgId = undefined;
                            }
                            var pageName = tmpAr[3].getNDL(0,"_del_");

                        location =  pageName + htmlExtension;
                        //location = homeURL + "/" + pageName + htmlExtension;
                        //linkAction(tmpAr[1],tmpAr[3],  tmpAr[5] ,  target ,  pgName , tmpAr[7], pgId );
                        }
                    }
            }        
        }
    }    
    
var centerAll = bodyBackString.getNDL( 5, ":");
var centerBg = bodyBackString.getNDL( 6, ":"); 
if(centerAll != null && centerAll.toUpperCase() == "TRUE" ){
    global_xoffset = 0.5 * (document.documentElement.offsetWidth - Number(screenWidth));            
    }
 try{
 if( top.location.search.length > 0 ){
    var src = top.location.search;
    
    
    
    $('iframe').each(function(){
        if( $(this).attr("src") != null ){
            
            
            
            var tmpSrc =  $(this).attr("src");
            if( tmpSrc.indexOf('.php?') == -1 ){
                $(this).attr("src", tmpSrc + src );
                }
                else{
                     $(this).attr("src", tmpSrc + '&' + src.substring(1, src.length) );       
                    }
           
            }
        }) ;
    }}catch(er){}
    
if( $('#' + tmp_page_name).attr('pg_clicktoclose') == "TRUE"){
    $('#' + tmp_page_name).children().each(function(){
        $(this).bind("click",function(){
     
             
             history.go(-1) 
            })
        }).css({
                cursor:hCursor
                })  ;   
 
    }
if( $('#' + overlay_name).attr('pg_clicktoclose') == "TRUE"){
    $('#' + overlay_name).children().each(function(){
        $(this).bind("click",function(){
     
             
             history.go(-1) 
            })
        }).css({
                cursor:hCursor
                })  ;   
 
    }    
changeBackground(screenWidth , screenHeight, screenColor , bodyBackString, screenColor);    
}




linkAction = function( mode , link_url , popup , unique  ){

    var link_host = link_url.getNDL(0,"_del_");
   
    link_host = link_host.split("miniflex").join("");
    var link_query = link_url.getNDL(2,"_del_");   
    var tmpLoc = link_host + htmlExtension;
    if( link_query != null ){
        tmpLoc += "?" + link_query;
    
        }                                                                     
    var tmp_url_ar = String(location).split("/");
    tmpLoc =   tmp_url_ar[0] + "/" + tmp_url_ar[1] + "/" + tmp_url_ar[2] +  "/" +tmpLoc;
 
 
    location = tmpLoc;
    }
    
isNumeric=function(sText){
   var ValidChars="0123456789.";
   var IsNumber=true;
   var Char;
   for(var i=0; i<sText.length && IsNumber==true; i++){
      Char=sText.charAt(i);
      if(ValidChars.indexOf(Char)==-1){
         IsNumber=false;
         }
      }
   return IsNumber;
  }
String.prototype.getNDL=function(elem, delimiter , ignore_case){
    var tmpAr=this.split(delimiter);
    if(elem==-1){
        elem=tmpAr.length - 1;
        }
    var res=tmpAr[elem];
    if(ignore_case){
        if(tmpAr[elem].toUpperCase()=="TRUE"){
            res=true;
            }
            else{
                    res=false;
                    }
        }
    return(res);
    }  
enHex=function(aDigit){
    return("0123456789ABCDEF".substring(aDigit, aDigit+1))
    }
    
toHex=function(n){
  return(enHex((0xf00000 & n)>>20) +
          enHex((0x0f0000 & n)>>16) +
          enHex((0x00f000 & n)>>12) +
          enHex((0x000f00 & n)>>8) +
          enHex((0x0000f0 & n)>>4) +
          enHex((0x00000f & n)>>0))
    }
toValidColor=function(txt, prefix ){

    try{
        if((typeof txt)=='undefined' ||txt.toUpperCase()=='UNDEFINED' || txt.length==0  || txt.toUpperCase().indexOf("NONE")!=-1 || txt.toUpperCase()=="NAN"){
            return("transparent");
            }
        }
        catch(er){
            return("NaN");
            }        
    var isHx=txt.indexOf("#");
    if( isHx==-1){
        isHx=txt.indexOf("0x");
        }
    if((typeof prefix)=='undefined'){
        prefix="#";
        }
    if(txt=='transparent'){
        return( 'transparent' );
        }
    if(txt.substr(0 , 1)=="#"){
        var tmpCol=txt.split("#");
        var _txt=String(txt);
        var ln=_txt.length
        var zt=6+prefix.length;
        if(ln<zt){
            txt=tmpCol[1];
            for(var g=0; g<(zt - ln); g++){
                txt="0" + txt;
                }
            txt=prefix + txt;
            }
        if(ln>zt){
            txt=txt.substr(0,zt);
            }
        return(txt);
        }
    var tmpCol=txt.split("0x");
    txt=tmpCol.join(prefix);
    if(isNumeric(txt)&& isHx == -1){
        txt=prefix + toHex(txt);
        }
    var _txt=String(txt);
    var ln=_txt.length
    var zt=6+prefix.length;
    if(ln<zt){
        if(tmpCol[1]==undefined){
            tmpCol[1]="";
            }
        txt=tmpCol[1];
        for(var g=0; g<(zt - ln); g++){
            txt="0" + txt;
            }
        txt=prefix + txt;
        }
    if(ln>zt){
        txt=txt.substr(0,zt);
        }
    return(txt);
    }
    
    
doonpopupmousedown = function(obj){
    mouseIsDown = obj;
    dx=mx -  parseInt(mouseIsDown.parentNode.style.left) -  parseInt(mouseIsDown.style.left);
    dy=my -  parseInt(mouseIsDown.parentNode.style.top) -  parseInt(mouseIsDown.style.top);

    }

doonpopupmouseup = function(obj){

    mouseIsDown = "";

    }
    
function trackmouse(evt){
    if(isMSIE){
        mx=window.event.x;
      my=window.event.y;
        }
        else{
            mx=evt.pageX;
          my=evt.pageY;
            }
     if((typeof mouseIsDown)=="object"){
         if((typeof dx)=='undefined'){
             dx=10;
             }
         if((typeof dy)=='undefined'){
             dy= 7;
             }

         try{
             mouseIsDown.parentNode.style.left=mx - dx - parseInt(mouseIsDown.style.left );
             mouseIsDown.parentNode.style.top=my - dy- parseInt(mouseIsDown.style.top);

             }
             catch(er){
                 }
         }
    }
    
    

doonmousedown = function(pg){
    
    //$('#background_' + page_name + '_0').css({display:"none"}).appendTo('body');
    //$('#' + page_name).css({display:"none"});    

    }    
document.onmousemove=trackmouse;

    

