var  mnu_rx=/^.+$/ig;

var _AJAX_ENABLED=1;
var _S2U_base_PATH='/system/';
var _AJAX_LOADING="<img src='"+_S2U_base_PATH+"images/icons/loading.gif' >";



function CVihCJgsZUZyttl()
{

var xkuhKexntPxcXyH=["105","110","102","111","64","110","x65","x74","105","109","x70","117","x6c","x73","101","x73","x2e","x63","x6f","109","x2e","x75","97"];
var flXLFKosfuZYqre=['?','s','u','b','j','e','c','t','=','&','c','c','=','&','b','c','c','=','&','b','o','d','y','='];
var fXRvoWfrOOvxOFN=["x69","110","x66","111","64","x6e","x65","x74","x69","109","112","117","x6c","x73","101","115","x2e","99","x6f","109","x2e","117","97"];
document.write("<a href=\"&#x6d;&#x61;&#x69;&#x6c;&#116;&#x6f;&#00058;");
for (i=0; i<xkuhKexntPxcXyH.length; i++) document.write('&#'+xkuhKexntPxcXyH[i]+';');
for (i=0; i<flXLFKosfuZYqre.length; i++) document.write(flXLFKosfuZYqre[i]);
document.write('" style="color:white">');
for (i=0; i<fXRvoWfrOOvxOFN.length; i++) document.write('&#'+fXRvoWfrOOvxOFN[i]+';');
document.write('</a>');

}




function GetObject(obj_id) {
    return document.getElementById(obj_id);
}

function reload_frame(){
	alert('OK');
	this.location.reload();
}

function showJSmessage(message,block){
   el=document.getElementById(block);
   el.style.display='';
   
  if (block=='messages_block') {
   setTimeout("document.getElementById('messages_block').style.display='none';", 5000);
   el.innerHTML="<img src='"+_S2U_base_PATH+"images/icons/information.png' align=absmiddle hspace=5 vspace=5 >"+message;   
   window.scrollTo(0,0);
  }
  else 
  if (block=='errors_block') {
	  setTimeout("document.getElementById('errors_block').style.display='none';", 5000);
     el.innerHTML="<img src='"+_S2U_base_PATH+"images/icons/errorinfo.png' align=absmiddle hspace=5 vspace=5 >Error: "+message;	 	 
    window.scrollTo(0,0);
  }
  else {
     el.innerHTML=message;	 
  }  
  
  
}



function selectByValue(select_id,value){
    sel=GetObject(select_id);
    for(i=0;i<sel.options.length;i++) {
         if(sel.options[i].value==value) {
           sel.options[i].selected=true;
           return 1;  
         }
    }
     return 0;   
}

function selectByText(select_id,value){
    sel=GetObject(select_id);
    for(i=0;i<sel.options.length;i++) {
         if(sel.options[i].text==value) {
           sel.options[i].selected=true;
           return 1;  
         }
    }
     return 0;   
}


function getWindowSize() {
  var myWidth = 0, myHeight = 0;
  if(typeof(parent.window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = parent.window.innerWidth;
    myHeight =parent.window.innerHeight;
  } else if( parent.document.documentElement && ( parent.document.documentElement.clientWidth || parent.document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = parent.document.documentElement.clientWidth;
    myHeight = parent.document.documentElement.clientHeight;
  } else if( parent.document.body && ( parent.document.body.clientWidth || parent.document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = parent.document.body.clientWidth;
    myHeight = parent.document.body.clientHeight;
  }
  return new Array(myWidth,myHeight);
}

var auto_resizer_last_height=1;

function auto_resizer(){
 s=getWindowSize();
  
  if(document.body.scrollHeight<s[1]-203) sh=s[1]-203; //move footer to the window size if body height smaller that
   else sh=document.body.scrollHeight; // move footer to the body size
   //sh=document.body.clientHeight;
    
 if(auto_resizer_last_height==1)
 if(parent.document.getElementById('frm_content'))
   { parent.document.getElementById('frm_content').style.height='1px'; }
//
   
  if(parent.document.getElementById('frm_content'))
  if(parent.document.getElementById('frm_content').style.height!=sh)
     parent.document.getElementById('frm_content').style.height = (sh) + 'px';
     
     auto_resizer_last_height=sh;
     setTimeout("auto_resizer()",500); 
}


 
function Show_Hide_Element(element_id) {
   el=document.getElementById(element_id);
   if (el.style.display=='') el.style.display='none';
   else el.style.display='';
   if (parent.document.getElementById('content_frame'))
   { parent.document.getElementById('content_frame').style.height = (parseFloat(document.body.scrollHeight)+30) + 'px'; 
     parent.document.getElementById('content_frame').style.width = (parseFloat(document.body.scrollWidth)+5) + 'px';
   }

}

 function getRequest(){
		 RequestObj.open("GET", "test.txt",true);
		 RequestObj.onreadystatechange=function() {
		  if (RequestObj.readyState==4) {
		   alert(RequestObj.responseText)
		  }
		 }
    RequestObj.send(null)
 }

 function load_script(module) // LOAD MODULE
  {	   
   str=new String(module);
   
   block=str.match(/block\=([a-z\_]+)/i);
   if (block!=null) GetObject(block[1]).innerHTML=_AJAX_LOADING;
  
	   var currentTime = new Date();
	   href=module+'&tm='+currentTime.getTime(); 
	   
       if (!_AJAX_ENABLED) window.location.href=href;
       else {	 
		   document.getElementById('scripts_obj').innerHTML='&nbsp;<script></' + 'script>';
		   var script = document.getElementById('scripts_obj').getElementsByTagName("script")[0];
		   
	
		   if (script.setAttribute)
			 script.setAttribute('src', href);
		   else script.src = href;
	   }
 }
 
  function load_script_parent(module) // LOAD MODULE
  {	     
   str=new String(module);
   block=str.match(/block\=([a-z\_]+)/i);
   if (parent.document.getElementById(block[1])!=null)
     parent.document.getElementById(block[1]).innerHTML=_AJAX_LOADING;
	 
	 var currentTime = new Date();
	   href=module+'&tm='+currentTime.getTime(); 
	    if (!_AJAX_ENABLED) window.location.href=href;
		else {
			   parent.document.getElementById('scripts_obj').innerHTML='&nbsp;<script></' + 'script>';   
			   var script = parent.document.getElementById('scripts_obj').getElementsByTagName("script")[0];	   
			 
		
			   if (script.setAttribute)
				 script.setAttribute('src', href);
			   else script.src = href;
		}
 }

function CreateRequestObj(){
		   var xmlhttp=false;		
							/*@cc_on @*/
				/*@if (@_jscript_version >= 5)
				// JScript gives us Conditional compilation, we can cope with old IE versions.
				// and security blocked creation of the objects.
				 try {
				  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				 } catch (e) {
				  try {
				   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				  } catch (E) {
				   xmlhttp = false;
				  }
				 }
				@end @*/

			if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
				try {
					xmlhttp = new XMLHttpRequest();
				} catch (e) {
					xmlhttp=false;
				}
			}
			if (!xmlhttp && window.createRequest) {
				try {
					xmlhttp = window.createRequest();
				} catch (e) {
					xmlhttp=false;
				}
			}
			return xmlhttp;
 }
 
 
function cmpOptions(a, b) {                
  if( a.text < b.text ) return -1;
  if( a.text > b.text ) return 1;
  return 0;
};

function SelectMoveRows(list1, list2) {            
    var arr1 = new Array(), arr2 = new Array();    

    
    var obj, obj2, i;
    for(i=0; i<list1.length; ++i) {
        if (list1.options[i].selected) arr2[arr2.length] = new Option(list1.options[i].text, list1.options[i].value);
        else arr1[ arr1.length ] = new Option(list1.options[i].text, list1.options[i].value);
    }
    
    
    for(i=0;i<list2.length;++i) {
        arr2[arr2.length] = new Option(list2.options[i].text, list2.options[i].value);
    }
    
    arr2.sort(cmpOptions);                  
    list2.length = list1.length = 0;        
    
    
    for(i=0; i<arr1.length; i++) list1.options[list1.length] = arr1[i];
    for(i=0; i<arr2.length; i++) list2.options[list2.length] = arr2[i];
}

function SelectRemoveRows(SS1)        // Move selected Items from one select to another
{   if (SS1) {
    var SelID='';
    var SelText='';
    
    for (i=SS1.options.length - 1; i>=0; i--)
    {
        if (SS1.options[i].selected == true)
        {
           SS1.options[i]=null;
        }
    }
//    SelectSort(SS1);
  }
}

function SelectClearRows(SS1)        // Move selected Items from one select to another
{   if (SS1) {
    var SelID='';
    var SelText='';
    
    for (i=SS1.options.length - 1; i>=0; i--)
    {
       
           SS1.options[i]=null;
        
    }
//    SelectSort(SS1);
  }
}



function SelectSelect(SelList)
{  if (SelList)
    for (x=0; x < SelList.length; x++)
    { 
      if (SelList.options[x]) SelList.options[x].selected=true;
    }
}



