/***************************************************************************
 *                            Dolphin Web Community Software
 *                              -------------------
 *     begin                : Mon Mar 23 2006
 *     copyright            : (C) 2007 BoonEx Group
 *     website              : http://www.boonex.com
 *
 *
 *
 ****************************************************************************/

/***************************************************************************
 *
 *   This is a free software; you can modify it under the terms of BoonEx
 *   Product License Agreement published on BoonEx site at http://www.boonex.com/downloads/license.pdf
 *   You may not however distribute it for free or/and a fee.
 *   This notice may not be removed from the source code. You may not also remove any other visible
 *   reference and links to BoonEx Group as provided in source code.
 *
 ***************************************************************************/

/**
 * Checks/unchecks all tables
 *
 * @param   string   the form name
 * @param   boolean  whether to check or to uncheck the element
 *
 * @return  boolean  always true
 */
function setCheckboxes(the_form, do_check)
{
     var elts  = document.forms[the_form].getElementsByTagName('input');
    var elts_cnt  = elts.length;

    for ( i = 0; i < elts_cnt; i++)
    {
        elts[i].checked = do_check;
          if ( elts[i].type == "submit" )
               elts[i].disabled = !do_check;
    }
}

function trim(inputString) {
    if (typeof inputString != "string") { return inputString; }
    var retValue = inputString;
    var ch = retValue.substring (0, 1);
    while (ch == " ") { 
    retValue = retValue.substring(1, retValue.length);
    ch = retValue.substring(0, 1);
    }
    ch = retValue.substring (retValue.length-1, retValue.length);
    while (ch == " ") { 
    retValue = retValue.substring(0, retValue.length-1);
    ch = retValue.substring(retValue.length-1 , retValue.length);
    }
    while (retValue.indexOf("  ") != -1) { 
    retValue = retValue.substring(0, retValue.indexOf ("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
    }
    return retValue; 
} 

function setCheckValues(the_form)
{
     var k=0;
     var elts  = document.forms[the_form].getElementsByTagName('input');
    var elts_cnt  = elts.length;

    for ( i = 0; i < elts_cnt; i++)
    {
       if (elts[i].type == "checkbox" && elts[i].checked == true)
        k++;    
          
    }
          
     for ( i = 0; i < elts_cnt; i++)
    {
    
        if(k==0)
        {
               if ( elts[i].type == "submit" )
               elts[i].disabled = true;
        }
        else
        {
               if ( elts[i].type == "submit" )
               elts[i].disabled = false;
        
        } 
          
    }
          
          

}


function UpdateSubmit(the_form) {
     var elts  = document.forms[the_form].getElementsByTagName('input');
     var elts_cnt  = elts.length;
     var bChecked = false;

     for ( i = 0; i < elts_cnt; i++) {
          if (elts[i].type == "checkbox" && elts[i].checked == true) {
               bChecked = true;
          }
          if ( elts[i].type == "submit" ) {
               elts[i].disabled = true;
          }
     }
     for ( i = 0; i < elts_cnt; i++) {
          if ( elts[i].type == "submit" ) {
               if (bChecked == true) {
                    elts[i].disabled = false;
               } else {
                    elts[i].disabled = true;
               }
          }
     }
}

function setCheckbox(the_form)
{
    var elts      = document.forms[the_form].getElementsByTagName('input');
    var elts_cnt  = elts.length;

    var allUnchecked = true;

    for (var i = 0; i < elts_cnt; i++)
        if(elts[i].checked)
               allUnchecked = false;

    for (var i = 0; i < elts_cnt; i++)
        if( elts[i].type == "submit" )
               elts[i].disabled = allUnchecked;
}


var win = 'width=500,height=600,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes';

function get_gallery( id_prof ) {
   window.open('photos_gallery.php?ID='+id_prof,'gallery',win);
}

function launchTellFriend(val) {
     //alert(val);
    var win = 'width=300,height=300,left=200,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no';
    return !window.open(val+'tellfriend.php','tellfriend',win);
}

function launchTellFriendProfile( sID ) {
    var win = "width=300,height=300,left=200,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no";
    return !window.open('tellfriend.php?ID='+sID,'tellfriendprofile',win);
}

function BxShowBlock( id )
{

     var el;
     el = document.getElementById( id );

     if( el.style.display == 'none' )
     {
          el.style.display = 'block'
     }
     else
     {
          el.style.display = 'none'
     }

     return false;
}

function ShowShowHide ( show_name, show_name2, hide_name )
{
    if (hide_name) hide_name.style.display = 'none';
    if (show_name) show_name.style.display = 'inline';
    if (show_name2) show_name2.style.display = 'inline';
}

function ShowHideHide ( show_name, hide_name, hide_name2 )
{
    if (hide_name) hide_name.style.display = 'none';
    if (hide_name2) hide_name2.style.display = 'none';
    if (show_name) show_name.style.display = 'inline';
}

function charCounter(field,maxLength,countTarget)
{

     field = document.getElementById(field);
     countTarget = document.getElementById(countTarget);
     var inputLength=field.value.length;

     if(inputLength >= maxLength)
     {
          field.value=field.value.substring(0,maxLength);

     }
     countTarget.innerHTML=maxLength-field.value.length;


}



/**
 * change images onHover mouse action
 */
function show(FileName,jpg1Name)
{
     document.images[FileName].src = jpg1Name;
}

/**
 * set status of the browser window to 's'
 */
function ss(s)
{
     window.status = s;
     return true;
}

/**
 * set status of the browser window to empty
 */
function ce()
{
     window.status='';
}


/**
 * insert emotion item
 */
function emoticon( txtarea, text ) {

     text = ' ' + text + ' ';
     if (txtarea.createTextRange && txtarea.caretPos) {
          var caretPos = txtarea.caretPos;
          caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
          txtarea.focus();
     } else {
          txtarea.value  += text;
          txtarea.focus();
     }
}

function launchAddToIM (id)
{
    var win = "width=600,height=160,left=100,top=100,copyhistory=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes";
    window.open("explanation.php?explain=imadd&ID="+id,'add_to_im',win);
    return false;
}

function docOpen(text)
{
     newWindow=window.open('','','toolbar=no,resizable=yes,scrollbars=yes,width=400,height=300');
     newWindow.document.open("text/html");
     newWindow.document.write(unescape(text));
     newWindow.document.close();
}

function get_data( container, url, siteUrl )
{
     if ( container )
     {
          var container = document.getElementById( container );
          container.innerHTML = "loading ... ";
     }

     var XMLHttpRequestObject = createXmlHttpObj();

     if( !XMLHttpRequestObject )
          return false;

     var data_source = siteUrl + 'xml/menu.php' + url + '&_t=' + Math.random();
     XMLHttpRequestObject.open( "GET", data_source );
     XMLHttpRequestObject.onreadystatechange = function()
     {
          if ( XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200 )
          {
               var xmlDocument = XMLHttpRequestObject.responseXML;
               delete XMLHttpRequestObject;
               XMLHttpRequestObject = null;
               
               names = xmlDocument.getElementsByTagName("name");
               links = xmlDocument.getElementsByTagName("link");
               
               list_sublinks(names, links);
          }
     }
     XMLHttpRequestObject.send( null );

     //container.innerHTML = '';

     function list_sublinks(names, links)
     {
          var loopIndex, name, link, maxIndex = names.length;

          container.innerHTML = '';
          for ( loopIndex = 0; loopIndex < maxIndex; loopIndex++ )
          {
               //if ( values[loopIndex].firstChild.nodeName=="name")
               name = names[loopIndex].firstChild.nodeValue;
               
               //if ( values[loopIndex].childNodes[1].nodeName=="link")
               link = links[loopIndex].firstChild.nodeValue;
               
               container.innerHTML += '<div class="innerSubmenuDiv"><a href="' + link + '">' + name + '</a></div>';
          }
     }
}


function createNamedElement( type, name )
{

    var element;

    try
    {
        element = document.createElement('<'+type+' name="'+name+'">');
    } catch (e) { }

    if (!element || !element.name) // Cool, this is not IE !!
    {
        element = document.createElement(type)
        element.name = name;
    }

    return element;
}

function display_node(node, siteUrl)
{

    var nn = document.getElementById( node );

     var sub_name = node.split('_')[1];
    if ( 'none' == nn.style.display )
    {
     nn.style.display='block';
     if ( '' == nn.innerHTML )
         get_data( node, '?action=menu&ID=' + sub_name, siteUrl);
    }
    else
    {
          nn.style.display='none';
    }

}

function stripSlashes(str)
{
     return str.replace(/\\/g, '');
}

function createXmlHttpObj()
{
     if ( window.XMLHttpRequest )
          return new XMLHttpRequest();
     else if ( window.ActiveXObject )
          return new ActiveXObject("Microsoft.XMLHTTP");
     else
     {
          alert( 'Please upgrade your browser' );
          return false;
     }
}
function toggle(elementID,imgID){

var target1 = document.getElementById(elementID);
var target2 = document.getElementById(imgID);


if (target1.style.display == 'none') {
target1.style.display = 'block';
target2.innerHTML='<img src="/community/templates/tmpl_lipid/images/mini_butt.gif" width="15" height="14" border="0" alt="Hide" title="Hide" onclick="toggle(\''+elementID+'\',\''+imgID+'\');" style="cursor:pointer;" />';
} else {
target1.style.display = 'none';
target2.innerHTML='<img src="/community/templates/tmpl_lipid/images/mini_butt_down.gif" width="15" height="14" border="0" alt="Show" title="Show" onclick="toggle(\''+elementID+'\',\''+imgID+'\');" style="cursor:pointer;" />';
}
} 
function closeWidget(elementID)
{
var target1 = document.getElementById(elementID);
target1.style.display = 'none';
}
function getHtmlData( elemID, url )
{
     var elem = document.getElementById( elemID );
     
     if( !elem || !url )
          return false;
     
     var url = url + '&r=' + Math.random();
     
     
     var oXMLHttpReq = createXmlHttpObj();
     
     if( !oXMLHttpReq )
          return false;
     
     elem.innerHTML = '<div class="loading"><img src="'+urlIconLoading+'"></div>';
     
     oXMLHttpReq.open( "GET", url );
     oXMLHttpReq.onreadystatechange = function()
     {
          if ( oXMLHttpReq.readyState == 4 && oXMLHttpReq.status == 200 )
          {
               sNewText = oXMLHttpReq.responseText;
               elem.innerHTML = sNewText;
               
               // parse javascripts and run them
               aScrMatches = sNewText.match(/<script[^>]*javascript[^>]*>([^<]*)<\/script>/ig);
               if( aScrMatches )
               {
                    for( ind = 0; ind < aScrMatches.length; ind ++ )
                    {
                         sScr = aScrMatches[ind];
                         iOffset = sScr.match(/<script[^>]*javascript[^>]*>/i)[0].length;
                         sScript = sScr.substring( iOffset, sScr.length - 9 );
                         
                         eval( sScript );
                    }
               }
          }
     }
     oXMLHttpReq.send( null );
}


/* 
     Show the Floating Description for any element.
     
     usage:
     <element
          onmouseover="showFloatDesc( 'your html description here...' );"
          onmousemove="moveFloatDesc( event );"
          onmouseout="hideFloatDesc();">
     
     Your document must contain in the root of body following content:
          <div id="FloatDesc" style="position:absolute;display:none;"></div>
     and specific stylesheet for it.
*/
function showFloatDesc( text )
{
     descDiv = document.getElementById( 'FloatDesc' );
     if ( descDiv )
     {
          descDiv.innerHTML = text;
          descDiv.style.display = 'block';
     }
}

function hideFloatDesc()
{
     descDiv = document.getElementById( 'FloatDesc' );
     if ( descDiv )
          descDiv.style.display = 'none';
}

function moveFloatDesc( ev )
{
     descDiv = document.getElementById( 'FloatDesc' );
     if ( descDiv )
     {
          showPos = getPositionData( descDiv, ev );
          descDiv.style.left = showPos['posX'] + 'px';
          descDiv.style.top = showPos['posY'] + 'px';
     }
}

/*
     Core of the Floating Description
*/
function getPositionData(obj, showEvent)
{
     if ( !showEvent )
          showEvent = window.event;
     
     var pos_X = 0, pos_Y = 0;
     if ( showEvent )
     {
          if ( typeof(showEvent.pageX) == 'number' )
          {
               pos_X = showEvent.pageX;
               pos_Y = showEvent.pageY;
          }
          else if ( typeof(showEvent.clientX) == 'number' )
          {
               pos_X = showEvent.clientX; pos_Y = showEvent.clientY;
               if ( document.body && 
                    ( document.body.scrollTop || document.body.scrollLeft ) && 
                    !( window.opera || window.debug || navigator.vendor == 'KDE' ) )
               {
                    pos_X += document.body.scrollLeft;
                    pos_Y += document.body.scrollTop;
               }
               else if ( document.documentElement &&
                    ( document.documentElement.scrollTop ||
                    document.documentElement.scrollLeft ) &&
                    !( window.opera || window.debug || navigator.vendor == 'KDE' ) )
               {
                    pos_X += document.documentElement.scrollLeft;
                    pos_Y += document.documentElement.scrollTop;
               }
          }
     }
     
     var scroll_X = 0, scroll_Y = 0;
     if ( document.body &&
          ( document.body.scrollTop || document.body.scrollLeft ) &&
          !( window.debug || navigator.vendor == 'KDE' ) )
     {
          scroll_X = document.body.scrollLeft;
          scroll_Y = document.body.scrollTop;
     }
     else if ( document.documentElement &&
          ( document.documentElement.scrollTop ||
          document.documentElement.scrollLeft ) &&
          !( window.debug || navigator.vendor == 'KDE' ) )
     {
          scroll_X = document.documentElement.scrollLeft;
          scroll_Y = document.documentElement.scrollTop;
     }
     
     var win_size_X = 0, win_size_Y = 0;
     if (window.innerWidth && window.innerHeight)
     {
          win_size_X = window.innerWidth;
          win_size_Y = window.innerHeight;
     }
     else if ( document.documentElement &&
          document.documentElement.clientWidth &&
          document.documentElement.clientHeight )
     {
          win_size_X = document.documentElement.clientWidth;
          win_size_Y = document.documentElement.clientHeight;
     }
     else if (document.body && document.body.clientWidth && document.body.clientHeight)
     {
          win_size_X = document.body.clientWidth;
          win_size_Y = document.body.clientHeight;
     }
     
     pos_X += 15;
     pos_Y += 20;
     
     if (obj.offsetWidth && obj.offsetHeight)
     {
          if (pos_X - scroll_X + obj.offsetWidth + 5 > win_size_X)
               pos_X -= (obj.offsetWidth + 25);
          if (pos_Y - scroll_Y + obj.offsetHeight + 5 > win_size_Y)
               pos_Y -= (obj.offsetHeight + 20);
     }
     
     var res = new Array;
     res['posX'] = pos_X;
     res['posY'] = pos_Y;
     res['scrollX'] = scroll_X;
     res['scrollY'] = scroll_Y;
     res['winSizeX'] = win_size_X;
     res['winSizeY'] = win_size_Y;
     
     return res;
}

function addBookmark( title, url )
{
     if (title == undefined)
          title = document.title;

     if (url == undefined)
          url = top.location.href;
          
     if (window.sidebar) // firefox
          window.sidebar.addPanel(title, url, '');
     else if(window.opera && window.print) // opera
     {
          var elem = document.createElement('a');
          elem.setAttribute('href',url);
          elem.setAttribute('title',title);
          elem.setAttribute('rel','sidebar');
          elem.click();
     } 
     else if(document.all) // ie
          window.external.AddFavorite(url, title);
     else if (navigator.appName=="Netscape") //Netscape
          alert( 'To bookmark this site press "Ctrl+D".' );
     else
          alert( 'Your browser doesn\'t support this feature' );
}

function AddFilesFields(sDeleteCapt) {

     if ($("#browse_file_div").children( '[class="file_field"]' ).length >= 5) {
          alert('5 files maximum');
          return;
     }

     var el = $('<div style="margin-top:10px;" class="file_field"><input name="userfile[]" type="file" style="" />&nbsp;&nbsp;&nbsp;<a href="#">' + sDeleteCapt + '</a></div>');
     $("#browse_file_div").append(el);

     el.children('a').click( function(){
       $(this).parent().remove();
       return false;
     } );
}

function changeBigPicTo(newBigImageName, newBigImageHref) {
     var el;
     el = document.getElementById('AdvBigImg');
     el.style.backgroundImage = 'url(' + newBigImageName + ')';
     el = document.getElementById('AdvBigImgFullSize');
     el.href = newBigImageHref;
}

function moveScrollRightAuto( el_id, b ) {
     if (b)
          scrollTimerId = setInterval ("moveScrollRight('"+el_id+"')", 100);
     else
          clearInterval (scrollTimerId);
}

function moveScrollLeftAuto( el_id, b ) {
     if (b)
          scrollTimerId = setInterval ("moveScrollLeft('"+el_id+"')", 100);
     else
          clearInterval (scrollTimerId);
}

function moveScrollRight( el_id ) {
     var step = 5;
     var e = document.getElementById( el_id );
     var left  = e.style.left ? parseInt( e.style.left ) : 0;

     minLeft = e.parentNode.clientWidth - parseInt( e.clientWidth );

     if ( (left-step) > minLeft ) {
          e.style.left = left - step + "px";
     }
     else {
          e.style.left = minLeft + "px";
          moveScrollRightAuto ( el_id, false);
     }
}

function moveScrollLeft( el_id ) {
     var step = 5;
     var e = document.getElementById( el_id );
     var left = parseInt(e.style.left ? e.style.left : 0);

     if (left + step < 0 ) {
          e.style.left = left + step + "px";
     }
     else {
          e.style.left = "0px";
          moveScrollLeftAuto (false);
     }
}

function addEvent( obj, evt, func )
{
     if( !obj || !evt || !func )
          return false;
     
     if( obj.addEventListener )
          obj.addEventListener( evt, func, false );
     else if( obj.attachEvent )
          obj.attachEvent( 'on' + evt, func );
}

function checkAll( formName, _pref, doCheck ) {
     _form = document.forms[formName];
     
     if( !_form )
          return false;
     
     for( ind = 0; ind < _form.length; ind ++ ) {
          _elem = _form[ind];

          if( _elem.type != 'checkbox' )
               continue;

          if( _elem.name.substr( 0, _pref.length ) != _pref )
               continue;

          _elem.checked = doCheck;
     }
}

function emailCheck( str )
{

 if (str.search( /^[a-z0-9_\-]+(\.[_a-z0-9\-]+)*@([_a-z0-9\-]+\.)+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)$/i ) == -1 )
     return false;
 else
     return true;
}

function getBoonexId( formFrom, formTo )
{
     if( !formFrom || !formTo )
          return false;
     
     var ID = formFrom.ID;
     var Password = formFrom.Password;
     
     if( !ID || !Password )
          return false;
     
     var oXMLHttpReq = createXmlHttpObj();
     
     if( !oXMLHttpReq )
          return false;
     
     if( !ID.value.length )
     {
          alert( 'Please enter BoonEx ID' );
          ID.focus();
          return false;
     }

     if( !Password.value.length )
     {
          alert( 'Please enter Password' );
          Password.focus();
          return false;
     }
     
     formFrom.Submit.disabled = true;
     formFrom.Submit.value = 'Wait...';
     
     var sUrl = 'get_boonex_id.php?ID=' + encodeURIComponent(ID.value) + '&Password=' + encodeURIComponent(Password.value) + '&r=' + Math.random();
     
     oXMLHttpReq.open( "GET", sUrl );
     oXMLHttpReq.onreadystatechange = function()
     {
          if ( oXMLHttpReq.readyState == 4 && oXMLHttpReq.status == 200 )
          {
               var oXML = oXMLHttpReq.responseXML;
               
               if( !oXML.getElementsByTagName( 'ID' ).length )
               {
                    alert( 'Authorization failed. Try again.' );
                    return false;
               }
               
               var aFields = new Array();
               aFields['Username'] = 'NickName[0]';
               aFields['Email']    = 'Email[0]';
               aFields['Password'] = 'Password[0],Password_confirm[0]';
               aFields['Realname'] = 'Realname[0]';
               aFields['DateOfBirth'] = 'DateOfBirth[0]';
               aFields['Sex']      = 'Sex[0]';
               aFields['Country']  = 'Country[0]';
               aFields['City']     = 'City[0]';
               aFields['ZIP']      = 'zip[0]';
               aFields['Headline'] = 'Headline[0]';
               aFields['DescriptionMe'] = 'DescriptionMe[0]';
               aFields['tags']     = 'Tags';
               
               for( var fieldFrom in aFields )
               {
                    if( !oXML.getElementsByTagName( fieldFrom ).length )
                         continue;
                    
                    var eFieldFrom = oXML.getElementsByTagName( fieldFrom )[0];
                    var sValue = eFieldFrom.firstChild.data;
                    
                    if( fieldFrom == 'DateOfBirth' ) { //convert date
                         var aDate = sValue.split( '-' );
                         sValue = parseInt( aDate[2], 10 ) + '/' + parseInt( aDate[1], 10 ) + '/' + parseInt( aDate[0], 10 );
                    }
                    
                    var aFieldsTo = aFields[fieldFrom].split( ',' );
                    
                    for( var i in aFieldsTo )
                    {
                         fieldTo = aFieldsTo[i];
                         if( formTo[fieldTo] )
                         {
                              eFieldTo = formTo[fieldTo];
                              
                              switch( eFieldTo.type )
                              {
                                   case 'text':
                                   case 'textarea':
                                   case 'password':
                                   case 'select-one':
                                        eFieldTo.value = sValue;
                                        break;
                                   default:
                                        if( typeof eFieldTo == 'object' ) //radio
                                             for( n = 0; n < eFieldTo.length; n++ )
                                                  if( eFieldTo[n].value == sValue )
                                                       eFieldTo[n].checked = true;
                              }
                         }
                    }
               }
          }
     }
     oXMLHttpReq.send( null );

     formFrom.Submit.disabled = false;
     formFrom.Submit.value = 'Import';
}

function loadDynamicBlock( iBlockID, sUrl ) {
     if( $ == undefined )
          return false;
     
//-------------------------------------- DolphinZzz.com changes (Drag&Drop)--------------------------------------[Start]
     //var $block = $( '#page_block_' + iBlockID );
     var $block = $( '#block_zzz_' + iBlockID );
     setTimeout(reloadDragZzz, 3000);
//-------------------------------------- DolphinZzz.com changes (Drag&Drop)--------------------------------------[End]
     
     $( '.boxContent', $block ).html(
          '<div style="text-align: center;"><img src="' + urlIconLoading + '" alt="Loading..." /></div>'
     );
     
     $block.load( sUrl + '&pageBlock=' + iBlockID );
     return true;
}

function showItemEditForm( element_id )
{
     var editFormWrap = document.getElementById( element_id );
     
     editFormWrap.style.width   = document.body.clientWidth + 30 + "px";
     editFormWrap.style.height  = (window.innerHeight ? (window.innerHeight + 30) : screen.height) + "px";
     editFormWrap.style.left    = getHorizScroll1() - 30 + "px";
     editFormWrap.style.top     = getVertScroll1() - 30 + "px";
     editFormWrap.style.display = 'block';
}

function showItemSettingsForm( element_id )
{
     document.getElementById( element_id ).style.display='block';
}

function showItemSettingsFormShow( element_id )
{
     document.getElementById( element_id ).style.display='none';
}

function getHorizScroll1()
{
     if (navigator.appName == "Microsoft Internet Explorer")
          return document.documentElement.scrollLeft;
     else
          return window.pageXOffset;
}

function getVertScroll1()
{
     if (navigator.appName == "Microsoft Internet Explorer")
          return document.documentElement.scrollTop;
     else
          return window.pageYOffset;
}


//-------------------------------------- DolphinZzz.com changes (Drag&Drop)--------------------------------------[Start]
function removeBlockZzz(block_id) {_gel('block_zzz_' + block_id).style.display = 'none';e_column_del[block_id] = block_id;try{_gel('deletedBlock_' + block_id).checked = true;e_column_del_str = serializeZzz(e_column_del);SetCookieZzz( "e_column_delete_" + page_name_zzz, e_column_del_str, expDate);checkPresentDeletedBlocksOnPage();}catch(e){};}

function showBlockZzz(block_id) {_gel('block_zzz_' + block_id).style.display = 'block';e_column_del[block_id] = '';try{_gel('deletedBlock_' + block_id).checked = false;e_column_del_str = serializeZzz(e_column_del);SetCookieZzz( "e_column_delete_" + page_name_zzz, e_column_del_str, expDate);checkPresentDeletedBlocksOnPage();}catch(e){};}

function checkPresentDeletedBlocksOnPage() {var e_column_del_real = new Array();for (block_id in e_column_del) {if (e_column_del[block_id] != '')e_column_del_real.push(block_id);}if (e_column_del_real.length)_gel('block_zzz_0').style.display = 'block';else_gel('block_zzz_0').style.display = 'none';}

function updateCheckedDeletedBlocksOnPage() {try {for (block_id in e_column_all) {try {if (e_column_del[e_column_all[block_id]] >0)_gel('deletedBlock_' + e_column_all[block_id]).checked = true;else_gel('deletedBlock_' + e_column_all[block_id]).checked = false;}catch(e){}}}catch (e){}}

function checkAllPresentBlocksOnPage() {try {for (i in e_column_all) {try {if (_gel('page_block_' + e_column_all[i]) != null)_gel('deletedBlockZzz_' + e_column_all[i]).style.display = 'block';}catch (e){}}}catch (e){}}

function checkRemoveOrShowBlockZzz(block_id) 
{if (_gel('deletedBlock_' + block_id).checked)removeBlockZzz(block_id);elseshowBlockZzz(block_id);}

function SetCookieZzz(name,value,expires,path,domain,secure)
     
     {
          //alert(value);
          document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + new Date( new Date().getTime()+expires ).toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
          validate_setting(value);
     }


function serializeZzz( inp ) {
     
     var getType = function( inp ) {var type = typeof inp, match;if(type == 'object' && !inp){return 'null';}if (type == "object") {if(!inp.constructor){return 'object';}var cons = inp.constructor.toString();if (match = cons.match(/(\w+)\(/)) {cons = match[1].toLowerCase();}var types = ["boolean", "number", "string", "array"];for (key in types) {if (cons == types[key]) {type = types[key];break;}}}return type;};var type = getType(inp);var val;switch (type) {case "undefined":val = "N";break;case "boolean":val = "b:" + (inp ? "1" : "0");break;case "number":val = (Math.round(inp) == inp ? "i" : "d") + ":" + inp;break;case "string":val = "s:" + inp.length + ":\"" + inp + "\"";break;case "array":val = "a";case "object":if (type == "object") {var objname = inp.constructor.toString().match(/(\w+)\(\)/);if (objname == undefined) {return;}objname[1] = serializeZzz(objname[1]);val = "O" + objname[1].substring(1, objname[1].length - 1);}var count = 0;var vals = "";var okey;for (key in inp) {okey = (key.match(/^[0-9]+$/) ? parseInt(key) : key);vals += serializeZzz(okey) +serializeZzz(inp[key]);count++;}val += ":" + count + ":{" + vals + "}";break;}if (type != "object" && type != "array") val += ";";return val;}


function onLoadPageZzz(){_table=_gel("dragdrop");_pl=true;_upc();checkAllPresentBlocksOnPage(); }



function dz_a(a,b){var c=function(){};c.prototype=a.prototype;b.prototype=new c}


function _gel(a){return document.getElementById?document.getElementById(a):null}


function _gelstn(a){if(a=="*"&&document.all)return document.all;return document.getElementsByTagName?document.getElementsByTagName(a):[]}


function _gelsbyregex(a,b){var c=_gelstn(a),d=[];for(var e=0;e<c.length;e++){if(b.test(c[e].id)){d.push(c[e])}}return d}


function _esc(a){return window.encodeURIComponent?encodeURIComponent(a):escape(a)}var dz_aa=function(a){return window.decodeURIComponent?decodeURIComponent(a):unescape(a)}, _unesc=dz_aa;var dz_ba=0;function _uid(){return"obj"+dz_ba++}function _min(a,b){return a<b?a:b}function _max(a,b){return a>b?a:b}function _uhc(a,b,c){var d="m_"+a+"_"+b,e=_gel(d);if(!e){e=document.createElement("INPUT");e.type="hidden";e.disabled=true;e.name=d;_gel("m_"+a+"_form").appendChild(e)}e.value=c;e.disabled=false}function dz_b(){var a=null;if(window.ActiveXObject){a=new ActiveXObject("Msxml2.XMLHTTP");if(!a){a=new ActiveXObject("Microsoft.XMLHTTP")}}else if(window.XMLHttpRequest){a=new XMLHttpRequest}return a}function dz_e(a,b,c){var d=document.createElement("input");d.type="hidden";d.name=b;d.value=c;a.appendChild(d)}function dz_f(){var a;{var b=document.location.href,c=b.indexOf("?"),d=b.indexOf("#");if(d==-1){a=b.substr(c+1)}else{a=b.substr(c+1,d-c-1)+"&"+b.substr(d+1)}}return a.split("&")}function _args(){var a={},b=dz_f();for(var c=0;c<b.length;c++){var d=b[c].indexOf("=");if(d==-1) continue;var e=b[c].substring(0,d),f=b[c].substring(d+1);f=f.replace(/\+/g," ");a[e]=_unesc(f)}return a}function dz_g(){var a={pid:1,host:1,gl:1,hl:1},b=_args(),c="?";for(var d in b){if(a[d]){c+=d+"="+_esc(b[d])+"&"}}return c}function dz_j(){dz_ob(dz_.A,"div","dragdropbox");try {e_column_str = serializeZzz(e_column);


SetCookieZzz( "e_column_" + page_name_zzz, e_column_str, expDate);

}catch(e){};}function dz_k(){_DZ_TriggerDelayedEvent("xsetpdone");dz_j()}function _xsetp(a){dz_j()}function dz_ca(a){var b=_gelstn("*");for(var c=0;c<b.length;c++){for(var d=0;d<a.length;d++){if(b[c].className==a[d][0]){b[c].style[a[d][1]]=a[d][2]}}}}function _upc(){var a=[];if(!_cbp){a[a.length]=["medit","display",_uli?"":"none"]}a[a.length]=["panelo","display",_pnlo?"":"none"];a[a.length]=["panelc","display",_pnlo?"none":""];if(_mod){a[a.length]=["unmod","display","none"];a[a.length]=["mod","display",""]}else{a[a.length]=["mod","display","none"];a[a.length]=["unmod","display",""]}dz_ca(a);if(_pl){if(_cbp||_uli){if(!dz_q&&!_mpnlo){_DZ_TriggerCustomEvent("initdrag",_table,_tabs);dz_q=true}}}}function dz_ma(a){var b="dz_event_hashcode_";if(a.hasOwnProperty&&a.hasOwnProperty(b)){return a[b]}if(!a[b]){a[b]=++dz_y.Ja}return a[b]}function dz_na(a){return"builtin_"+a}function dz_oa(a,b){if(a.indexOf&&a.indexOf("m_")==0){a=a.substring(2)}return"builtin_m"+a+"_"+b}function dz_pa(a,b){return"builtin_"+dz_y.Fa(a)+"_"+b}function dz_qa(a){return"custom_"+a}function dz_ra(){for(var a in dz_y.b){for(var b=0;b<dz_y.b[a].length;b++){dz_y.b[a][b]=null}if(a in dz_y.B){var c=dz_y.B[a],d=c[0],e=c[1],f=c[2];if(d.removeEventListener){d.removeEventListener(e,f,false)}else if(d.detachEvent){d.detachEvent("on"+e,f)}dz_y.B[a]=null}}}function dz_sa(a,b,c){for(var d=c;d<b.length;d++){a[a.length]=b[d]}return a}function dz_ta(a,b){if(a in dz_y.b){for(var c=0;c<dz_y.b[a].length;c++){if(dz_y.b[a][c]===b){dz_y.b[a][c]=null;return true}}}return false}function dz_ua(a,b){if(a in dz_y.b){for(var c=0;c<dz_y.b[a].length;c++){if(dz_y.b[a][c]){var d=[];for(var e=1;e<arguments.length;e++){d[d.length]=arguments[e]}dz_y.b[a][c].apply(this,d)}}}}function dz_va(a,b){try{if(!(a in dz_y.Ta)){throw Error("Unsupported event type: "+a);}var c=dz_y.N(a);if(!(c in dz_y.b)){dz_y.b[c]=[]}dz_y.b[c][dz_y.b[c].length]=b}catch(e){}}function dz_wa(a,b,c){if(!(b in dz_y.Ua)){throw Error("Unsupported module event type: "+b);}var d=dz_y.O(a,b);if(!(d in dz_y.b)){dz_y.b[d]=[]}dz_y.b[d][dz_y.b[d].length]=c}function dz_xa(a,b,c){var d=dz_y.fa(a,b);if(!(d in dz_y.b)){dz_y.b[d]=[];var e=function(g){if(!g)g=window.event;dz_y.I.apply(a,[d,g])};if(a.addEventListener){a.addEventListener(b,e,false)}else if(a.attachEvent){a.attachEvent("on"+b,e)}else{throw Error("Object {"+a+"} does not support DOM events.");}dz_y.B[d]=[a,b,e]}var f=dz_y.b[d].length;if(a===window&&b=="unload"&&f>0){dz_y.b[d][f]=dz_y.b[d][f-1];dz_y.b[d][f-1]=c}else{dz_y.b[d][f]=c}}function dz_ya(a,b){var c=dz_y.M(a);if(!(c in dz_y.b)){dz_y.b[c]=[]}dz_y.b[c][dz_y.b[c].length]=b}function dz_za(a,b){var c=dz_y.N(a);return dz_y.G(c,b)}function dz_Aa(a,b,c){var d=dz_y.O(a,b);return dz_y.G(d,c)}function dz_Ba(a,b,c){var d=dz_y.fa(a,b);return dz_y.G(d,c)}function dz_Ca(a,b){var c=dz_y.M(a);return dz_y.G(c,b)}function dz_Da(a,b){var c=dz_y.t([dz_y.N(a)],arguments,1);dz_y.I.apply(window,c)}function dz_Ea(a,b){var c=dz_y.t([],arguments,0);setTimeout(function(){dz_y.triggerEvent.apply(window,c)},0)}function dz_Fa(a,b,c){var d=dz_y.t([dz_y.O(a,b)],arguments,2);dz_y.I.apply(window,d)}function dz_Ga(a,b,c){var d=dz_y.t([],arguments,0);setTimeout(function(){dz_y.triggerModuleEvent.apply(window,d)},0)}function dz_Ha(a,b){var c=dz_y.t([dz_y.M(a)],arguments,1);dz_y.I.apply(window,c)}function dz_Ia(a,b){var c=dz_y.t([],arguments,0);setTimeout(function(){dz_y.triggerCustomEvent.apply(window,c)},0)}var dz_y={Ja:0,b:{},B:{},Ta:dz_ka,Ua:dz_la,Fa:dz_ma,N:dz_na,O:dz_oa,fa:dz_pa,M:dz_qa,Ca:dz_ra,t:dz_sa,G:dz_ta,I:dz_ua,addEventHandler:dz_va,addModuleEventHandler:dz_wa,addDOMEventHandler:dz_xa,addCustomEventHandler:dz_ya,removeEventHandler:dz_za,removeModuleEventHandler:dz_Aa,removeDOMEventHandler:dz_Ba,removeCustomEventHandler:dz_Ca,triggerEvent:dz_Da,triggerModuleEvent:dz_Fa,triggerCustomEvent:dz_Ha,triggerDelayedEvent:dz_Ea,triggerDelayedModuleEvent:dz_Ga,triggerDelayedCustomEvent:dz_Ia},_DZ_AddEventHandler=dz_y.addEventHandler,_DZ_AddModuleEventHandler=dz_y.addModuleEventHandler,_DZ_AddGadgetEventHandler=dz_y.addModuleEventHandler,_DZ_AddDOMEventHandler=dz_y.addDOMEventHandler,_DZ_AddCustomEventHandler=dz_y.addCustomEventHandler,_DZ_RemoveEventHandler=dz_y.removeEventHandler,_DZ_RemoveModuleEventHandler=dz_y.removeModuleEventHandler,_DZ_RemoveGadgetEventHandler=dz_y.removeModuleEventHandler,_DZ_RemoveDOMEventHandler=dz_y.removeDOMEventHandler,_DZ_RemoveCustomEventHandler=dz_y.removeCustomEventHandler,_DZ_TriggerEvent=dz_y.triggerEvent,_DZ_TriggerModuleEvent=dz_y.triggerModuleEvent,_DZ_TriggerGadgetEvent=dz_y.triggerModuleEvent,_DZ_TriggerCustomEvent=dz_y.triggerCustomEvent,_DZ_TriggerDelayedEvent=dz_y.triggerDelayedEvent,_DZ_TriggerDelayedModuleEvent=dz_y.triggerDelayedModuleEvent,_DZ_TriggerDelayedGadgetEvent=dz_y.triggerDelayedModuleEvent,_DZ_TriggerDelayedCustomEvent=dz_y.triggerDelayedCustomEvent;_DZ_AddDOMEventHandler(window,"unload",dz_y.Ca);var dz_7={obj:null,init:function(a,b){a.onmousedown=dz_7.start;a.obj=b;if(isNaN(parseInt(b.style.left,10)))b.style.left="0px";if(isNaN(parseInt(b.style.top,10)))b.style.top="0px";b.onDragStart=new Function;b.onDragEnd=new Function;b.onDrag=new Function},uninit:function(a,b){window.clearInterval(b.qa);a.onmousedown=null;a.obj=null;b.onDragStart=null;b.onDragEnd=null;b.onDrag=null},start:function(a){var b=dz_7.obj=this.obj;a=dz_7.fixE(a);if(a.which!=1){return true}b.onDragStart(a);var c=a.clientY;if(!dz_.la){c+=document.body.scrollTop}b.lastMouseX=a.clientX;b.lastMouseY=c;b.offsetMouseX=parseInt(b.style.left,10)-a.clientX;b.offsetMouseY=parseInt(b.style.top,10)-c;b.qa=window.setInterval(dz_mb(b,dz_nb()),10);document.onmouseup=dz_7.end;document.onmousemove=dz_7.drag;return false},drag:function(a){a=dz_7.fixE(a);if(a.which==0){return dz_7.end()}var b=dz_7.obj,c=a.clientY;if(!dz_.la){c+=document.body.scrollTop}var d=a.clientX;if(b.lastMouseX==d&&b.lastMouseY==c){return false}var e=d+b.offsetMouseX,f=c+b.offsetMouseY;b.style.left=e+"px";b.style.top=f+"px";b.lastMouseX=d;b.lastMouseY=c;b.onDrag(e,f);return false},end:function(a){a=dz_7.fixE(a);document.onmousemove=null;document.onmouseup=null;window.clearInterval(dz_7.obj.qa);var b=dz_7.obj.onDragEnd();dz_7.obj=null;return b},fixE:function(a){if(typeof a=="undefined")a=window.event;if(typeof a.layerX=="undefined")a.layerX=a.offsetX;if(typeof a.layerY=="undefined")a.layerY=a.offsetY;if(typeof a.which=="undefined")a.which=a.button;return a}};function dz_ob(a,b,c){if(!a){return[]}var d=b=="*"&&a.all?a.all:a.getElementsByTagName(b),e=[];c=c.replace(/\-/g,"\\-");var f=new RegExp("(^|\\s)"+c+"(\\s|$)"),g;var f2=new RegExp("page_column");var f3=new RegExp("block_zzz_(\\d+)$");var f4=new RegExp("dragdropbox_(\\d+)$");var columnIndex = 0;var block_id;for(var h=0;h<d.length;h++){g=d[h];if(f.test(g.className)){e.push(g)}if(f2.test(g.id)){columnIndex++;e_column[columnIndex] = new Array()}if(f3.test(g.id)){f3.exec(g.id);block_id = RegExp.$1;e_column[columnIndex].push(block_id)}}return e}var _DZ_initDrag=function(a,b){dz_.A=a;dz_.u=b;dz_.o=dz_ob(dz_.A,"div","dragdropbox");if(_old_html){dz_.pa=dz_.A.tBodies[0].rows[0];dz_.o=dz_.pa.cells}dz_.g=[];var c=0;for(var d=0;d<dz_.o.length;d++){var e=dz_.o[d];if(e.className.indexOf("dz_dnd_fixed_col")!=-1||e.style.display=="none"){continue}for(var f=0;f<e.childNodes.length;f++){var g=e.childNodes[f];if(g.tagName=="DIV"){dz_.g[c]=g.className!="dm"?new dz_pb(g):new dz_qb(g);c++}}}_DZ_AddEventHandler("unload",dz_8)};function dz_8(){for(var a=0;a<dz_.g.length;a++){dz_.g[a].ga();dz_.g[a]=null}dz_.g=null;dz_.o=null;if(_old_html){dz_.pa=null}dz_.A=null}var expDate= 24*60*60*100000;var e_column= new Array();var e_column_del = new Array();var _et="",_brand="",_bmod="",_source="",_pid="",_authpath="",_prefid="";var _old_html=false,_use_old_feed_styles=true,dz_c=null,dz_d=null;var _uli,_pnlo,_mpnlo,_pl,_mod,_cbp=true,dz_q=false;var _table=null,_tabs=null;var dz_ka={domload:1,xsetpdone:1,moduledragstart:1,moduledragend:1,moduletitleclick:1,moduleedit:1,modulecanceledit:1,moduledelete:1,moduleundelete:1,modulezip:1,moduleunzip:1,modulemaximize:1,moduleunmaximize:1,load:1,unload:1,resize:1},dz_la={dragstart:1,dragend:1,titleclick:1,edit:1,canceledit:1,"delete":1,undelete:1,zip:1,unzip:1,maximize:1,unmaximize:1};var dz_$,dz_Cb=100,dz_Db=dz_Cb+1;var dz_={};function reloadDragZzz(){dz_8();initDragZzz();onLoadPageZzz();}function initDragZzz(){_et="",_brand="",_bmod="",_source="",_pid="",_authpath="",_prefid="";_old_html=false,_use_old_feed_styles=true,dz_c=null,dz_d=null;_uli,_pnlo,_mpnlo,_pl,_mod,_cbp=true,dz_q=false;_table=null,_tabs=null;dz_ka={domload:1,xsetpdone:1,moduledragstart:1,moduledragend:1,moduletitleclick:1,moduleedit:1,modulecanceledit:1,moduledelete:1,moduleundelete:1,modulezip:1,moduleunzip:1,modulemaximize:1,moduleunmaximize:1,load:1,unload:1,resize:1},dz_la={dragstart:1,dragend:1,titleclick:1,edit:1,canceledit:1,"delete":1,undelete:1,zip:1,unzip:1,maximize:1,unmaximize:1};dz_$,dz_Cb=100,dz_Db=dz_Cb+1;dz_.Z=navigator.userAgent;dz_.La=dz_.Z.indexOf("Gecko")!=-1;dz_.ka=dz_.Z.indexOf("Opera")!=-1;dz_.la=dz_.Z.indexOf("Safari")!=-1;dz_.ca="DZ_pageDivMaskId";dz_.ba="DZ_moduleDivMaskId";dz_.Wa=function(){dz_.A.style.display="none"};dz_.Xa=function(){dz_.A.style.display=""};dz_.l=null;dz_.C=function(){if(!dz_.l){dz_.l=document.createElement("DIV");dz_.l.className="modbox";dz_.l.backgroundColor="";dz_.l.style.border="2px dashed #aaa";dz_.l.innerHTML="&nbsp;"}return dz_.l};dz_.n=function(a,b){return function(){return a[b].apply(a,arguments)}};dz_.xa=function(){if(dz_.u){var a=dz_.u.getElementsByTagName("LI");if(_old_html){a=dz_.u.tBodies[0].rows[0].cells}for(var b=0;b<a.length;b++){var c=a[b];if(c.className.indexOf("unselectedtab")<0)continue;if(c.style.display=="none")continue;c.isDraggableTo=true;c.pagePosLeft=dz_.q(c,true);c.pagePosRight=c.pagePosLeft+c.offsetWidth;c.pagePosTop=dz_.q(c,false);c.pagePosBottom=c.pagePosTop+c.offsetHeight}}};dz_.wa=function(a){for(var b=0;b<dz_.g.length;b++){var c=dz_.g[b];c.a.pagePosLeft=dz_.q(c.a,true);c.a.pagePosTop=dz_.q(c.a,false)}var d=a.a.nextSibling;while(d){d.pagePosTop-=a.a.offsetHeight;d=d.nextSibling}};dz_.q=function(a,b){var c=0,d=0;if(a&&a.offsetParent&&a.offsetParent.id){if(!b){var e=a.offsetParent.getElementsByTagName(a.tagName);if(e&&e[0]){d=e[0].offsetTop}}}while(a){c+=a["offset"+(b?"Left":"Top")];a=a.offsetParent}return c-d};dz_.va=function(a){dz_.oa();var b=document.createElement("DIV");b.id=dz_.ca;b.innerHTML="&nbsp;";b.style.position="absolute";b.style.width="100%";b.style.height=document.body.offsetHeight+"px";b.style.left="0px";b.style.top="0px";b.style.zIndex="9999";document.body.appendChild(b);if(a.Ia){b=b.cloneNode(true);b.id=dz_.ba;b.style.height=a.a.offsetHeight-a.h.offsetHeight+"px";b.style.top=a.h.offsetHeight+"px";a.a.appendChild(b)}};dz_.oa=function(){var a=[dz_.ba,dz_.ca];for(var b=0;b<a.length;b++){var c=_gel(a[b]);if(c){c.parentNode.removeChild(c);c=null}}};dz_.Sa=function(){var a="";for(var b=0;b<dz_.o.length;b++){var c=dz_.o[b];for(var d=0;d<c.childNodes.length-1;d++){var e=c.childNodes[d];if(e.tagName=="DIV"){a+=a!=""?":":"";a+=e.id.substring(2)+"_"+c.id.substring(2)}}}_xsetp("mp="+_esc(a))};}function dz_qb(a){this.ga=dz_rb;this.a=a;this.a.innerHTML="<br />"}function dz_rb(){this.a=null}function dz_pb(a){this._urlMouseUp=dz_sb;this._urlMouseDown=dz_tb;this._urlClick=dz_ub;this._dragStart=dz_vb;this._drag=dz_wb;this._dragEnd=dz_xb;this.Da=dz_yb;this.J=dz_zb;this.ga=dz_Ab;this.v=false;this.a=a;this.h=_gel(a.id+"_h");this.d=_gel(a.id+"_url");this.Ia=this.a.getElementsByTagName("IFRAME").length>0;this.a.DND_Module=this;if(this.h){this.h.style.cursor="move";dz_7.init(this.h,this.a);this.a.onDragStart=dz_.n(this,"_dragStart");this.a.onDrag=dz_.n(this,"_drag");this.a.onDragEnd=dz_.n(this,"_dragEnd");if(this.d){this.d.style.cursor="pointer";if(dz_.La){this.d.onmousedown=dz_.n(this,"_urlMouseDown");this.d.onclick=dz_.n(this,"_urlClick")}else{this.d.onmouseup=dz_.n(this,"_urlMouseUp")}}}}function dz_Ab(){if(this.h){if(this.d){this.d.onclick=null;this.d.onmouseup=null;this.d=null}dz_7.uninit(this.h,this.a);this.a.onDragStart=null;this.a.onDrag=null;this.a.onDragEnd=null;this.h=null}this.a=null}function dz_sb(a){a=dz_7.fixE(a);if(this.v||!this.d||!this.d.href||a.which!=1){return true}this.J("titleclick");if(this.d.target||a.shiftKey){window.open(this.d.href,this.d.target)}else{document.location=this.d.href}return false}function dz_tb(a){a=dz_7.fixE(a);a.stopPropagation();return true}function dz_ub(a){if(!this.v&&this.d&&this.d.href){this.J("titleclick");return true}return false}function dz_vb(a){dz_.wa(this);dz_.xa();this.origNextSibling=this.a.nextSibling;var b=dz_.C(),c=this.a.offsetHeight;c-=parseInt(b.style.borderTopWidth,10)*2;var d=this.a.offsetWidth,e=dz_.q(this.a,true),f=dz_.q(this.a,false);this.a.style.width=d+"px";b.style.height=c+"px";this.a.parentNode.insertBefore(b,this.a.nextSibling);this.a.style.position="absolute";this.a.style.zIndex=10000;this.a.style.left=e+"px";this.a.style.top=f+"px";dz_.va(this);this.v=false;return false}function dz_9(){var a=0,b=0;if(typeof window.pageYOffset=="number"){a=window.pageXOffset;b=window.pageYOffset}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){a=document.body.scrollLeft;b=document.body.scrollTop}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){a=document.documentElement.scrollLeft;b=document.documentElement.scrollTop}return[a,b]}function dz_wb(a,b){if(!this.v){this.a.style.filter="alpha(opacity=50)";this.a.style.opacity=0.5;this.v=true;this.J("dragstart")}var c=null,d=100000000;for(var e=0;e<dz_.g.length;e++){var f=dz_.g[e],g=a;if(document.body.dir=="rtl"&&f.a.offsetWidth==1){g+=this.a.offsetWidth}var h=Math.sqrt(Math.pow(g-f.a.pagePosLeft,2)+Math.pow(b-f.a.pagePosTop,2));if(f==this)continue;if(isNaN(h))continue;if(h<d){d=h;c=f}}this.j=null;if(dz_.u){var i=dz_.u.getElementsByTagName("LI");if(_old_html){i=dz_.u.tBodies[0].rows[0].cells}for(var e=0;e<i.length;e++){var f=i[e];if(!f.isDraggableTo)continue;var j=dz_9();if(this.a.lastMouseX>=f.pagePosLeft&&this.a.lastMouseX<=f.pagePosRight&&this.a.lastMouseY+j[1]>=f.pagePosTop&&this.a.lastMouseY+j[1]<=f.pagePosBottom){this.j=f;var k=dz_.C();if(k.parentNode!=null){k.parentNode.removeChild(k)}break}}for(var e=0;e<i.length;e++){var f=i[e];if(f.id.indexOf("view")>=0){if(f==this.j){if(f.className.indexOf(" tab_hover")<0){f.className+=" tab_hover"}}else{f.className=f.className.replace(/ tab_hover/g,"")}}}}var k=dz_.C();if(this.j==null&&c!=null&&k.nextSibling!=c.a){enable_insert = true;try {for (drd in dragdropbox_disabled){if (c.a.parentNode.id == dragdropbox_disabled[drd])enable_insert = false;}} catch (e) {}if (enable_insert)c.a.parentNode.insertBefore(k,c.a);if(dz_.ka){document.body.style.display="none";document.body.style.display=""}}}function dz_xb(){dz_.oa();if(this.Da()){dz_.Sa()}if(this.j){var a=this.j.id.match(/tab(\d+)_/)[1],b=this.a.id.match(/m_(\d+)/)[1];_xsetp("mt="+b+":"+a);this.a.style.display="none";this.j.className=this.j.className.replace(/ tab_hover/g,"")}_hideNewUserTip();if(this.v){this.J("dragend")}updateCheckedDeletedBlocksOnPage();return true}function _hideNewUserTip(){var a=_gel("new_user_tip");if(a){a.style.display="none"}var b=_gel("new_user_save");if(b){b.style.display="block"}}function dz_yb(){var a=false;this.a.style.position="";this.a.style.width="";this.a.style.zIndex="";this.a.style.filter="";this.a.style.opacity="";window.scrollBy(0,0);var b=dz_.C();if(b.parentNode!=null){if(b.nextSibling!=this.origNextSibling){b.parentNode.insertBefore(this.a,b.nextSibling);a=true}b.parentNode.removeChild(b)}if(dz_.ka){document.body.style.display="none";document.body.style.display=""}return a}function dz_zb(a){switch(a){case "titleclick":_DZ_TriggerModuleEvent(this.a.id,a,this.d.href);_DZ_TriggerEvent("module"+a,this.a.id,this.d.href);break;case "dragstart":case "dragend":_DZ_TriggerDelayedModuleEvent(this.a.id,a);_DZ_TriggerDelayedEvent("module"+a,this.a.id);break}}function dz_mb(a,b){return function(){var c=dz_Bb(),d=dz_9(),e=d[1],f=4,g=0.05*c,h=e,i=a.offsetTop;if(a.lastMouseY<=g){i=a.offsetTop-f;h=e-f}else if(a.lastMouseY>=c-g){i=Math.min(b-a.offsetHeight,a.offsetTop+f);h=Math.min(b-c,e+f)}var j=h-e;if(j!=0){window.scrollBy(0,j);a.style.top=i+"px"}}}function dz_Bb(){var a;if(window.innerHeight){a=window.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientHeight}else{a=document.body.offsetHeight}if(a<document.body.clientHeight){return a}return document.body.clientHeight}function dz_nb(){if(document.body.scrollHeight>document.documentElement.clientHeight){return document.body.scrollHeight}else{return document.documentElement.clientHeight}}initDragZzz();_DZ_AddCustomEventHandler("initdrag",function(a,b){_DZ_initDrag(a,b)});if (window.attachEvent) {window.attachEvent("onload", function() {onLoadPageZzz();});} else {window.addEventListener("load", function() {onLoadPageZzz();}, false);}
//-------------------------------------- DolphinZzz.com changes (Drag&Drop)--------------------------------------[End]




function validate_setting(val)
{
     //var f = document.frm;

          //alert(val);
          xmlhttpPost_settings(val);
          return false;
     
}

function xmlhttpPost_settings(val) {    
               
     //document.getElementById("error_table").style.display = "block" ;
     //document.getElementById("error_show12").innerHTML = "Logging in...<img src='img/ajax-loader.gif' border='0'>";

     //s = new String(password);
     //password = s.replace("#","***");

     var url ="save_more_ajax.php";
     var posData = "?addtext=" + val ;


     if (window.XMLHttpRequest) { // Mozilla, Safari,...
          http_request = new XMLHttpRequest();
          if (http_request.overrideMimeType) {
               http_request.overrideMimeType('text/xml');
          }
     } else if (window.ActiveXObject) { // IE
          try {
               http_request = new ActiveXObject("Msxml2.XMLHTTP");
          } catch (e) {
               try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
               } catch (e) {}
          }
     }

     http_request.onreadystatechange = function() { checkLogin_setting(http_request); };
     http_request.open('GET', url + posData, true);
     http_request.send(null);
}



function checkLogin_setting(http_request){
     
     if (http_request.readyState == 4) {
            if (http_request.status == 200) 
               {
                    resText = http_request.responseText
                    resText1=resText.split("_");  
                    
                    /*///alert(resText);
                    if(resText1[0]=='0')
                    //document.getElementById("val_"+resText1[1]).innerHTML = '<FONT COLOR="#FF0000">Alreday added</FONT></span>';
                    else
                    //document.getElementById("val_"+resText1[1]).innerHTML = '<FONT COLOR="#00CC33">Added successfully</FONT></span>';
                    */
                    
            } else {
               // document.getElementById("error_show12").innerHTML = 'Error Please try again..';
            }
        }
}

