var mosk_init = function(){this.load_functions = new Array();this.before_request = function(){};this.after_request = function(){};};mosk_init.prototype.onload = function( functionString ){ this.load_functions[ this.load_functions.length ] = functionString;};mosk_init.prototype.load = function(){ if( this.load_functions.length ) {  for( var cF = 0; cF < this.load_functions.length; cF++)  {mosk.util.call(  this.load_functions[ cF ] );  }; };}; var mosk = new mosk_init();window.onload = function(){ mosk.load();  };
mosk.util = { urlencode: function( string ) { var ret = string; ret  = ret.toString();  ret  = encodeURIComponent( ret );  ret  = ret.replace(/%20/g, '+');  return ret; },  trim: function( string ) {  return string.replace( /^\s*|\s*$/g, '' );  },  ltrim: function( string ) {  return string.replace( /^\s*/g, '' );  },rtrim: function( string ) {  return string.replace( /\s*$/g, '' );  },  getURL: function() {  return  document.location.href; },  goTo: function( location ) {  document.location.href = location; },  appendURL: function( url, parameters ) {  if( ( parameters.substr( 0, 1 ) == "?" ) || ( parameters.substr( 0, 1 ) == "&" ) )  {parameters = parameters.substr( 1 );};  if( url.indexOf( '?' ) != -1 ){url = url + "&" + parameters;  }  else  {url = url + "?" + parameters;  };  return url; },  inArray: function( needle, haystack ) { for( var cH = 0; cH < haystack.legnth; cH ++ ){  if( haystack[ cH ] == needle )  {return true;  }; }; return false;  }, call: function( string )  {if( string.substr( 0, 1 ) == "#" ){ var func = ""; var parts = string.split( "|" );  func = parts[0].substr( 1 ) + "(";  for( var cP = 1; cP < parts.length; cP++) {  func += "'" + parts[cP] + "'"; if( cP + 1 < parts.length )  {func += ",";  }; };  func += ");"; return eval( func );}else{ return eval( string ); };  }, cordinates: function( element )  {if( element.offsetParent ) {for( var posX = 0, posY = 0; element.offsetParent; element = element.offsetParent ){posX += element.offsetLeft;  posY += element.offsetTop;};  return [ posX, posY ];} else {return[ element.x, element.y ];};return [0,0];  }, window: function()  { var offsetX = 0; if( self.pageXOffset ){  offsetX = self.pageXOffset} else if (document.documentElement && document.documentElement.scrollLeft ){offsetX = document.documentElement.scrollLeft;}else if( document.body ){offsetX = document.body.scrollLeft;}else{  offsetX = document.body.scrollLeft;}var offsetY = 0; if (self.pageYOffset) {  offsetY = self.pageYOffset;}else if (document.documentElement && document.documentElement.scrollTop ){offsetY = document.documentElement.scrollTop;}else if( document.body ){offsetY = document.body.scrollTop;}else{  offsetY = document.body.scrollTop;}var height = 0;if( self.innerHeight ){  height = self.innerHeight; }else if( document.documentElement && document.documentElement.clientHeight ){  height = document.documentElement.clientHeight;  }else if( document.body ){  height = document.body.clientHeight;}else{  height = document.body.clientHeight;} var  width = 0; if( self.innerWidth ){  width = self.innerWidth;}else if( document.documentElement && document.documentElement.clientWidth ){  width = document.documentElement.clientWidth;}else if( document.body ){  width = document.body.scrollWidth;} else if( document.documentElement ){  width = document.documentElement.scrollWidth;}; return [ width, height, offsetX, offsetY ];  }, mouse: function( event )  {var posX = 0;  var posY = 0;  if( !event )  {event = window.event;  };if( event.pageX || event.pageY )  {posX = event.pageX;posY = event.pageY; }  else if( event.clientX || event.clientY )  { var win = this.window();posX = event.clientX + win[2];posY = event.clientY + win[3];};if( posX < 0 ){ posX = 0; };  if( posY < 0 ){ posY = 0; }; return [ posX, posY ];  }, browser: function() { var browser= { name: '', version: '' }; var navInfo= navigator.userAgent.toLowerCase(); var parts  = navInfo.split( " " );  if(  navInfo.indexOf( "msie" ) != -1 ) {  browser.name = "ie"; for( part in parts )  {if( parts[ part ].indexOf( "msie" ) != -1 ){ var number = Number( part ) + 1; browser.version = ( parts[ number ] ).replace( ";", "");}; }; } else if(  navInfo.indexOf( "firefox" ) != -1 ) {for( part in parts )  {if( parts[ part ].indexOf( "firefox/" )  != -1 ){  browser.version = ( parts[ part ].substr( 8 )  );}; };  browser.name = "ff"; } else if(  navInfo.indexOf( "opera" ) != -1 ) {for( part in parts )  {if( parts[ part ].indexOf( "opera/" ) != -1 ){  browser.version = ( parts[ part ].substr( 6 )  );}; };  browser.name = "opera"; } else if( navInfo.indexOf( "konqueror" ) != -1 ) {  for( part in parts )  {if( parts[ part ].indexOf( "konqueror/" ) != -1 ){  browser.version = ( parts[ part ].substr( 10 ).replace( ";", "" )  );}; };browser.name = "konqueror"; } else if( navInfo.indexOf( "chrome" ) != -1 ) {  for( part in parts )  {if( parts[ part ].indexOf( "chrome/" ) != -1 ){  browser.version = ( parts[ part ].substr( 7 ).replace( ";", "" )  );}; };  browser.name = "chrome"; } else if( ( navInfo.indexOf( "safari" ) != -1 ) && ( navInfo.indexOf( "version" ) != -1  ) )  {  for( part in parts )  {if( parts[ part ].indexOf( "version/" ) != -1 ){  browser.version = ( parts[ part ].substr( 8 ).replace( ";", "" )  );}; };  browser.name = "safari";  } else {  return false; } return browser;  }, event_start: function( objectTo, event, functionToExecute )  {  if( objectTo.addEventListener ){  objectTo.addEventListener( event, functionToExecute, false );}else{  objectTo.attachEvent( "on" + event , functionToExecute );}; }, event_stop: function( objectTo, event, functionToExecute )  { if( objectTo.removeEventListener ){objectTo.removeEventListener( event, functionToExecute, false );}else{  objectTo.detachEvent( "on" + event, functionToExecute );};  },in_time: function( object, params, exists, timeKey ) { if( object ){if( !exists ) {object.sP( params.property, params.from ); if( !object.node.in_time ) {  object.node.in_time = new Array();  var timeKey= 0;  object.node.in_time[ timeKey ] = new Array(); } else {  var timeKey = object.node.in_time.length;  object.node.in_time[ timeKey ] = new Array(); }  if( params.from < params.to ) {  object.node.in_time[ timeKey ].way = '+'; } else {  object.node.in_time[ timeKey ].way = '-';  } if( typeof params.start == "function" ) {  params.start(); } else if( params.start ) {  eval( params.start ); }; }; if( !exists &&  object.node.in_time[ timeKey ].inProgress && object.node.in_time[ timeKey ].way ){object.node.in_time[ timeKey ].way = false;object.node.in_time[ timeKey ].inProgress = false;newValue  = object.gS( params.property ); params.from = newValue; params.to= params.from;mosk.util.in_time( object, params, false );  return false;  }; try  { clearTimeout( window[ object.node.id + "_" + params.property ] ); }  catch( e ){}; var propValue = object.gP( params.property ); if( object.node.in_time[ timeKey ].way == "+" )  {if( propValue < params.to ){  object.node.in_time[ timeKey ].inProgress = object.node.in_time[ timeKey ].way;propValue = propValue + params.step;  if( propValue > params.to ){ propValue = params.to;};  object.sS( 'display', 'block' );  object.sP( params.property, propValue );  window[ object.node.id + "_" + params.property ] =  setTimeout( function() { mosk.util.in_time( object, params, true, timeKey );  }, params.timeOut );}else{ object.node.in_time[ timeKey ].way  = false; object.node.in_time[ timeKey ].inProgress = false; if( params.stop ){  eval( params.stop );};if( typeof params.done == "function" ){  params.done();};};}  else if( object.node.in_time[ timeKey ].way == "-" )  {  if( propValue > params.to )  {object.node.in_time[ timeKey ].inProgress = object.node.in_time[ timeKey ].way;propValue = propValue - params.step;  if( propValue < params.to ){propValue = params.to;}object.sP( params.property, propValue );object.sS( 'display', 'block' );window[ object.node.id + "_" + params.property ] =  setTimeout( function(){ mosk.util.in_time( object, params, true, timeKey )}, params.timeOut );  }else  {object.node.in_time[ timeKey ].way = false; object.node.in_time[ timeKey ].inProgress = false;if( params.property == "width" ||  params.property == "height"  ){ object.sS( 'display', 'none' );}if( params.stop )  {  eval( params.stop );  } if( typeof params.done == "function" )  { params.done();  }; };}; };return true; }, set_cookie: function( cookie_name, cookie_value, cookie_days ) {  if( !cookie_days )  {cookie_days = 30;  }var date = new Date();  date.setTime( date.getTime + ( cookie_days * 24 * 60 * 60 * 1000 ) );  var expires = date.toGMTString();  document.cookie = cookie_name + "=" + cookie_value + ";expires=" + expires +"; path=/"; },  get_cookie: function( cookie_name ) {regexpr = cookie_name + '=(.*?)(;|$)';var results = document.cookie.match (regexpr);if( results ){ return ( unescape ( results[1] ) ); }else{ return null; }; },  print: function( parameters ) {  var params = { url: '', title: '', height: 600, width: 650, toolbar: 'no', location: 'no', status: 'no', menubar: 'yes', scrollbars: 'yes', resizable: 'no'}; for( param in parameters )  {params[ param ] = parameters[ param ];  };  return mosk.util.popup( params ); },  popup: function( parameters ) {var params = { url: '', title: '', height: 600, width: 650, toolbar: 'no', location: 'no', status: 'no', menubar: 'no', scrollbars: 'yes', resizable: 'no'};  for( param in parameters )  {params[ param ] = parameters[ param ];  }; var paramsString = ""; for( param in params )  {if( ( param != "url" ) && ( param != "title" ) ){ paramsString =  paramsString + "," + param + "=" + params[ param ];}; };  paramsString = paramsString.substring( 1 );window.open( params.url, params.title, paramsString );  return false  },  zoom: function( parameters ) {  var params = { step: 1, node_id: '', size: 12, type: 'in', max: 18,  min: 8 }; for( param in parameters ){params[ param ] = parameters[ param ];  }; var object = mosk.dom.me( params.node_id ); if( object )  { if( !object.node.size ) {  object.node.size = params.size; }  if( params.type == "in" ) {if( ( object.node.size + params.step ) < params.max  )  { object.node.size = object.node.size + params.step; object.sS( "fontSize", object.node.size + "px" );};} else if( params.type == "out" ) {if( ( object.node.size - params.step ) > params.min  )  { object.node.size = object.node.size - params.step; object.sS( "fontSize", object.node.size + "px" );};} else if( params.type == "default" ) {  object.sS( "fontSize", params.size + "px" ); }; this.set_cookie( params.node_id + '_font', object.node.size  );  }; return false; }, eval: function( string ) {  if( typeof string == "function" )  {return string();  }  else  {return eval( string );  } } };
mosk.dom = { ce: function( tag_name ) {var element = document.createElement( tag_name );if( element ){  return new mosk.object( element );};return false; },  ge: function( string ) {if(  string.substr( 2 , 1) == "|" ){ if( this[ string.substr( 0 , 2) ] ) {  return eval(  "this." + string.substr( 0 , 2) + "( '" + string.substr( 3 ) + "' )" ); };};return false; }, me: function( object_id ) { if( typeof object_id == 'object' ) { if( !object_id.node ) {return new mosk.object( object_id ); }  return object_id; };var element = document.getElementById( object_id ); if( element ) {  return new mosk.object( element ); };return false; },mt: function( tag_name ) {var elements = document.getElementsByTagName( tag_name );if( elements ){ return new mosk.object( elements[0] );};return false; },  mc: function( class_name ) {return this.ebp( "*", "className", class_name ); },  ebt: function( tag_name ) {  var elements = document.getElementsByTagName( tag_name );var collection = new mosk.collection(); if( elements )  {for( var cE = 0; cE < elements.length; cE++ ){ collection.add( new mosk.object( elements[ cE ] ) );}; };  return collection; },  ebp: function( tag_name, property, value ) { var elements = document.getElementsByTagName( tag_name );  var nodes = new mosk.collection();  for( var cE = 0; cE < elements.length; cE++ ){ if( elements[ cE ][property] == value ) { nodes.add( new mosk.object( elements[ cE ] ) ); };};  return nodes; },  ae: function( child, parent ) { if( !parent.node )  {parent = this.ge( parent );  }; if( parent )  {parent.node.appendChild( child.node );  };},  re: function( child ) {  child.node.parentNode.removeChild( child.node ); } };mosk.object = function( object ){ this.node = null; this.node = object;  return false;  };mosk.object.prototype.gA = function( attribute ){  if( this.node[ attribute ] != "undefined"  )  {return this.node[ attribute ];  };  if( this.node.getAttribute && (  ( attribute = this.node.getAttribute( attribute ) ) != null ) )  {return attribute;  }; return ""; };mosk.object.prototype.sA= function( attribute, value ){ if( ( typeof this.node[ attribute ] ) == "undefined" ) {  try  { this.node.setAttribute( attribute, value );  }  catch( e )  { this.node[ attribute ] = value;  };} else {this.node[ attribute ] = value; };};mosk.object.prototype.rA= function( attribute, value ){ if( this.node[ attribute ] ) {  this.node[ attribute ] = null; }; this.node.removeAttribute( attribute );};mosk.object.prototype.sS= function( attribute, value ){ this.node.style[attribute] = value;};mosk.object.prototype.gS= function( attribute ){ return this.node.style[attribute]; };mosk.object.prototype.sC= function( content ){ this.node.innerHTML = content};mosk.object.prototype.gC= function(){ return this.node.innerHTML;};mosk.object.prototype.aE= function( object ){ mosk.dom.ae( object, this );};mosk.object.prototype.rE= function( object ){ mosk.dom.re( object, this );};mosk.object.prototype.gP= function( property ){switch( property.toLowerCase() ){  case  'opacity': var value = this.gS( "MozOpacity" );if( value != "undefined" ) { return Number( value );}value = this.gS( "KHTMLOpacity" ); if( value != "undefined" ) { return Number( value );}value = this.gS( "opacity" ); if( value != "undefined" ) { return Number( value );} value = this.gS( "filters"  );  if( value != "undefined" ) { return Number( value.alpha.opacity );} break; case  'class':return  this.gA( "className" );break;  case  'height':  if(  this.node.style.height )  { return parseInt( this.node.style.height ); } else if( this.node.offsetHeight )  { return parseInt( this.node.offsetHeight ); }  return 0;  break;case  'width':  if(  this.node.style.width )  { return parseInt( this.node.style.width ); } else if( this.node.offsetWidth )  { return parseInt( this.node.offsetWidth ); }  return 0;  break;case  'display':  return  this.gS( "display" );  break;case  'overflow':  return  this.gS( "overflow" );  break; case  'margintop':  return parseInt( this.gS( "marginTop" ) );break;case  'top':  return parseInt( this.gS( "top" ) );break;  case  'left':  return parseInt( this.gS( "left" ) );break; };return false;};mosk.object.prototype.sP= function( property, value ){  switch( property.toLowerCase() )  {case "class": this.sA( "className", value ); break;case  'opacity':  this.sS( "MozOpacity", value );this.sS( "KHTMLOpacity",  value );  this.sS( "opacity",  value );  this.sS( "filter", "alpha(opacity="+( value * 100 )+")" );break; case  'height':this.sS( "height", value + "px" );  break; case  'width':this.sS( "width", value + "px" );  break; case  'display':  this.sS( "display", value );break; case  'overflow':  this.sS( "overflow", value );  break;  case  'disabled': this.sA( "disabled", value ); break;case  'margintop':  this.sS( "marginTop", value + "px" );  break;case 'top': this.sS( "top", value + "px" );  break;case 'left': this.sS( "left", value + "px" );  break;default:  this.sA( property, value );  break;};};mosk.object.prototype.elements = function( tag_name ){ if( !tag_name ) {  tag_name = "*"; }; var collection = new mosk.collection(); var elements = this.node.getElementsByTagName( tag_name );  for( var cE = 0; cE < elements.length; cE++ ) {  if( ( typeof elements[ cE ] ) == 'object' )  {collection.add( new mosk.object( elements[ cE ] ) );  };  };  return collection;};mosk.object.prototype.child = function(){ var child = new Array();  var elements = this.node.childNodes;  for( var eL = 0; eL < elements.length; eL++ ) {  child[ child.length ] = new mosk.object( elements[ eL ] ); };  return child;};mosk.object.prototype.click = function( method ){ this.node.onclick = method;};mosk.object.prototype.serialize = function(){ var tag = this.gA( "tagName" ); if( tag ) {switch( tag.toLowerCase() ){ case "input":switch( this.gA( "type" ).toLowerCase() ){ case "radio": case "checkbox":if( this.gA( "checked" ) == true ){ return mosk.util.urlencode( this.gA( "name") ) + "=" + mosk.util.urlencode( this.gA( "value" ) );}; break;  default: return mosk.util.urlencode( this.gA( "name" ) ) + "=" + mosk.util.urlencode( this.gA( "value" ) );  break;}; break; case "textarea":if(  this.node.rewrite ) { var frame =  document.getElementById( this.node.rewrite ).contentWindow; if( frame ) {  this.sA( "value", frame.document.body.innerHTML ); }}return mosk.util.urlencode( this.gA( "name" ) ) + "=" + mosk.util.urlencode( this.gA( "value" ) ) ; break; case "select":var result = "";var found  = false; for( var cO = 0; cO < this.node.options.length; cO++ ){ if( this.node.options[ cO ].selected == true ) { if( !found ){  found = true;}  else{  result += "&";} result += mosk.util.urlencode( this.gA( "name" ) ) + "=" + mosk.util.urlencode( this.node.options[ cO ].value  );  }}return result; break;};};  return "";};mosk.object.prototype.eBP = function( tag_name, property, value ){  var elements = this.node.getElementsByTagName( tag_name ); var nodes = new mosk.collection(); for( var cE = 0; cE < elements.length; cE++ )  {if( elements[ cE ][property] == value ){nodes.add( new mosk.object( elements[ cE ] ) );};  };  return nodes;};mosk.object.prototype.cordinates = function(){ return mosk.util.cordinates( this.node );};mosk.collection = function(){  this.items = new Array(); this.size  = 0;};mosk.collection.prototype.add = function( object ){  this.items[ this.items.length ] = object; this.size = this.items.length;};mosk.collection.prototype.get = function( number ){  if( this.items[ number ] )  {  return this.items[ number ];  }; return false;};mosk.collection.prototype.sA = function( attribute, value ){  for( var cI =0 ; cI < this.items.length; cI++ )  {this.items[cI].sA( attribute, value );};};mosk.collection.prototype.sP = function( attribute, value ){  for( var cI =0 ; cI < this.items.length; cI++ )  {this.items[cI].sP( attribute, value );};};mosk.collection.prototype.rA = function( attribute, value ){  for( var cI =0 ; cI < this.items.length; cI++ )  {this.items[cI].rA( attribute, value );};};mosk.collection.prototype.sS = function( attribute, value ){  for( var cI =0 ; cI < this.items.length; cI++ )  {  this.items[cI].sS( attribute, value );};};mosk.collection.prototype.click = function( method ){  for( var cI =0 ; cI < this.items.length; cI++ )  {  this.items[cI].click( method );};};mosk.collection.prototype.onmouseover = function( method ){  for( var cI =0 ; cI < this.items.length; cI++ )  {  this.items[cI].node.onmouseover =  method;};};mosk.collection.prototype.onmouseout = function( method ){  for( var cI =0 ; cI < this.items.length; cI++ )  {  this.items[cI].node.onmouseout = method;};};mosk.collection.prototype.onload = function( method ){  for( var cI =0 ; cI < this.items.length; cI++ )  {  this.items[cI].node.onload = method;};};
mosk.ajax = { objects: new Array(),  init: function() { var object = false;  if( window.XMLHttpRequest )  {object = new XMLHttpRequest();  }  else if( window.ActiveXObject )  { try { object = new ActiveXObject( 'Msxml2.XMLHTTP' );} catch( e ) { try { object = new ActiveXObject( 'Microsoft.XMLHTTP' );} catch( e ){ };  }  }  else  {alert( 'The browser does not support AJAX' );return false;  }  if( object )  {this.objects[ this.objects.length ] = object;  };return object;},  checkresponce: function( obj ) {  if( obj.ajax.readyState  == 4 )  {try{  if( obj.ajax.status == 200 ){ mosk.ajax.objects[ obj.object_id - 1 ] = false;  if( obj.done ) { obj.done();} var json =  obj.ajax.getResponseHeader( 'X-JSON' ); if( json ) {eval( json ); }if( obj.ajax.responseText  ) { mosk.ajax.evalScripts( obj.ajax.responseText );};  mosk.after_request(); }}catch( e ){};  }; },  evalScripts: function( html )  {  var div = document.createElement( 'div');div.innerHTML = html;  var scripts = div.getElementsByTagName( 'script' );for( var cS = 0; cS < scripts.length; cS++)  { if( !scripts[cS].getAttribute( "src" ) ) {try  { eval( scripts[cS].innerHTML );  }  catch( e )  { console.log( scripts[cS].innerHTML  );  }};  }; return;},  abort: function( object_id ) {if( object_id == -1 ){ for( var cO = 0; cO < this.objects.length; cO++ ) {if( this.objects[ cO ] ){ this.objects[ cO ].abort();};  };}else if( this.objects[ object_id - 1 ] ){ this.objects[ object_id -1 ].abort();}; } };mosk.ajax.request = function( requested_url,  parameters, headers ){ this.ajax = mosk.ajax.init(); this.done = false; this.method  = 'get'; this.loadKey = false; this.loading = false; this.update  = false; this.timeout = false; this.cache= false;  this.parameters = "";  this.object_id  = mosk.ajax.objects.length;for( param in parameters )  { this[ param ] = parameters[ param ];  };  if( !this.ajax )  {return false;  }; if( this.parameters && ( this.method == 'get' ) )  {  requested_url = mosk.util.appendURL( requested_url, this.parameters );  }; this.ajax.open( this.method,  requested_url , true );  mosk.before_request(); var update = false; if( this.update )  {var update = mosk.dom.me( this.update );  }; if( this.loading  )  {mosk.util.call( this.loading );}; if( ( typeof headers ) == 'object' ) {  for( header in headers )  {this.ajax.setRequestHeader( header, headers[ header ] );}; };if( this.update )  {var cacheNode = false;  if( this.cache  ){ var cacheNode = mosk.dom.me( this.cache );  if( cacheNode && cacheNode.gC() ) {  update.sC( cacheNode.gC() );  mosk.after_request();  return; };};this.ajax.setRequestHeader( 'Update-Node', this.update );  if( !this.done ) { this.done = function(){if( update ){if( cacheNode ){ cacheNode.sC( this.ajax.responseText );}; update.sC( this.ajax.responseText );};}; };}; var tmpObj = this; this.ajax.onreadystatechange = function(){ if( mosk.ajax ){mosk.ajax.checkresponce( tmpObj );};};  this.ajax.setRequestHeader( 'Requested-By', 'AJAX' );  if( this.parameters  )  {this.ajax.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8' );this.ajax.send( this.parameters );}  else  {this.ajax.setRequestHeader( 'Content-Type', 'text/html;charset=UTF-8' );this.ajax.send( null );}; if( this.timeout )  { try{ clearTimeout( this.timeToOut ); } catch( e ){} var tmpObj = this; this.timeToOut = setTimeout( function(){ tmpObj.ajax.abort();},  this.timeout );}; return false;}; function Load( url, params ){  mosk.ajax.request( url, params );};
mosk.favicon = { lDefault: '', lChange: '', head: '',  init: function() {  var head = mosk.dom.mt( "head" );  this.head = head; var links = this.head.eBP( "link", "type", "image/x-icon" ); if( links.size )  { this.lDefault = links.items[0];  }; },  change: function( url ) { if( this.lChange && ( this.lChange.node.parentNode != null ) )  {mosk.dom.re( this.lChange );  }; this.lChange  = mosk.dom.ce( 'link' );  this.lChange.sA( "type", "image/x-icon" );  this.lChange.sA( "rel", "shortcut icon" );  this.lChange.sA( "href", url ); if( this.lDefault.node.parentNode != null )  {mosk.dom.re( this.lDefault );  };this.head.aE( this.lChange );  },  restore: function() {  if( this.lDefault )  { this.head.rE( this.lChange );  }; this.head.aE( this.lDefault ); }};
mosk.form = { form: null,  frame: null,  method: 'http',  params: {}, submit: function( method, form_id, params, hidden_elements, event ) {this.frame = null; this.method = method; this.form= mosk.dom.me( form_id ); if( hidden_elements )  {this.add_hiddens( hidden_elements );  };  if( typeof params == 'object' )  {this.params = params;  }  else  {this.params = {};  }  switch( this.method )  {case "http": return true; break;case "js": return this.js_submit();break;case "ajax": return this.ajax_submit();break;case "frame":  return this.frame_submit();break; } return true;},  js_submit: function() {  var form_values = this.serialize();  this.form.node.submit();  return false; },  ajax_submit: function() {var form_values = this.serialize();  var submits = this.form.eBP( 'input', 'type', 'submit' );  submits.sA( "disabled", true );  submits.sS( "color", "gray" ); var action = this.form.gA( "action" ) || mosk.util.getURL();this.params.method = this.form.gA( "method" ).toLowerCase() || "post"; if( !this.params.update )  {  this.params.update = this.form.gA( "id" );  };if( !this.params.parameters ){this.params.parameters = "";};  this.params.parameters += form_values; var to_update = this.params.update;  this.params.done = function( )  { var update = mosk.dom.me( to_update ); if( update )  {  update.sC( this.ajax.responseText );  };  submits.rA( "disabled" );  submits.sS( "color", "" );}; mosk.ajax.request( action, this.params ); return false; },  frame_submit: function() {  mosk.before_request(); var action = this.form.gA( "action" ) || mosk.util.getURL();  this.params.url = action;this.agp( "frm=1" );  var div = new mosk.dom.ce( 'div' ); var frame_name =  "frame_" + this.form.gA( "id" ) + Math.floor(Math.random() * 666 ); div.sC( '<iframe style="display:none" src="about:blank" id="'+ frame_name +'" name="'+ frame_name +'" onload="mosk.form.frame_submited( \''+ frame_name +'\' );"></iframe>' );  mosk.dom.ae( div, "mt|body" ); this.form.sA( "target", frame_name ); var frame = mosk.dom.me( frame_name ); frame.node.params = this.params; this.form.node.submit();if( this.params.loading ){ mosk.util.call( this.params.loading );};return false; },  frame_submited: function( frame_name ) {  var frame = mosk.dom.me( frame_name ); if( frame.node.params.update )  {mosk.ajax.request( frame.node.params.url, frame.node.params );  }  else  {mosk.after_request();  } },  agp: function( parameters ) { var action = this.form.gA( "action" ); this.form.sA( "action", mosk.util.appendURL( action, parameters ) ); },  add_hiddens: function( hidden_elements ) {  if( typeof hidden_elements == 'object' ){for( param in hidden_elements ){var newHidden = mosk.dom.ce( 'input' ); newHidden.sA( 'type', 'hidden' );  newHidden.sA( 'name', param ); newHidden.sA( 'value', hidden_elements[ param ] );this.form.aE( newHidden ); };  };},  serialize: function( element )  { if( element ) {var elements = element.child(); } else {  var elements = this.form.child(); } var values= "";for( var cE = 0; cE < elements.length; cE++ ) {var value = elements[cE].serialize();  if( value )  {values = values + "&" + value;  };values += this.serialize( elements[cE] );};  return values; }};
mosk.scroll = function( select_id, rail_id, pointer_id ){ this.select  = mosk.dom.me( select_id );  this.rail = mosk.dom.me( rail_id );  this.pointer = mosk.dom.me( pointer_id );var cordinates  =  this.pointer.cordinates();this.start= cordinates[1]; this.position= 0;  this.proportion = 1;this.create();};mosk.scroll.prototype.create = function(){ var selectHeight = parseInt( this.select.gA( "scrollHeight" ) ); this.select.sS( "overflow", "hidden" );var railHeight= parseInt( this.rail.gA( "offsetHeight" ) ); this.proportion = ( ( selectHeight - ( this.pointer.gA( "offsetHeight") * 2 ) ) / railHeight );  this.proportion = selectHeight / ( railHeight + (this.pointer.gA( "offsetHeight") *2  ) )  ;  var tmpObject = this;  this.rail.node.onmouseover = function(){ document.body.style.cursor = "pointer"; };  this.rail.click( function( e ) { tmpObject.process( e );  document.body.style.cursor = ""; return false; }); this.pointer.node.onmousedown = function( e ) {document.onmousemove = function( e ){ tmpObject.process( e ); return false;  };return false; }; document.onmouseup = function() {document.body.style.cursor = "";document.onmousemove = function(){ return false; };return false; };};mosk.scroll.prototype.process = function( event ){ var mouse = mosk.util.mouse( event ); this.position = mouse[1] - this.start; if( this.position < 0 )  {this.position = 0;  }  else if( this.position > ( parseInt( this.rail.gA( "offsetHeight" ) ) - parseInt( this.pointer.gA( "offsetHeight" ) ) ) )  {this.position = parseInt( this.rail.gA( "offsetHeight" ) )  - parseInt( this.pointer.gA( "offsetHeight" ) ) ;  };this.pointer.sS( "top", this.position + "px" ); this.select.sP( "scrollTop", this.position * this.proportion );document.body.style.cursor = "pointer";};
mosk.slider = function( params ){ this.time = 80;  this.step = 20;  this.done = null;  this.start= null;  this.object  = null;  for( param in params ) {  this[ param ] = params[ param ]; };};mosk.slider.prototype.up = function(){ var f_object = this.object.elements().get( 0 ); f_object.node.id = this.object.node.id + "_s";  var height = f_object.gA( "offsetHeight" ); mosk.util.in_time( this.object, {  property: 'height', from: height, to: 0, timeOut: this.time, step: this.step, start: this.start, done: this.done } );mosk.util.in_time( f_object, {  property: 'marginTop',from: 0,to: -( height ),  timeOut: this.time, step: this.step,stop: "mosk.dom.me( '" + f_object.node.id + "' ).sS( 'display', 'block' ); mosk.dom.me( '" + f_object.node.id + "' ).sP( 'marginTop', '0' );"  } );};mosk.slider.prototype.down = function(){ var f_object = this.object.elements().get( 0 );  f_object.node.id = this.object.node.id + "_s";  this.object.sS( "display", "block" );  this.object.sS( "position", "absolute" ); this.object.sS( "visibility", "hidden" );  var height = f_object.gA( "offsetHeight" );  this.object.sS( "display", "none" ); this.object.sS( "position", "" ); this.object.sS( "visibility", "visible" ); this.object.sS( "overflow", "hidden" );  mosk.util.in_time( this.object, {  property: 'height', from: 0, to: height, timeOut: this.time, step: this.step } );  f_object.sP( "marginTop", -( height ) ); mosk.util.in_time( f_object, {  property: 'marginTop', from: -( height ), to: 0, timeOut: this.time, step: this.step,  stop:  "mosk.dom.me( '" + f_object.node.id + "').sP( 'marginTop', '0' ); ", start: this.start, done: this.done  } );  };
mosk.dialog = {  current: null,dialogs: new Array(),  open: function( parameters ) {  if( this.current )  {this.current.hide();  } this.dialogs[ this.dialogs.length ] = new mosk.dialogObject( parameters );  this.current = this.dialogs[ this.dialogs.length - 1 ]; this.current.id = "moskDialog_" + (this.dialogs.length -  1);  this.current.open(); return false;  },  confirm: function( parameters, labelOK, labelCancel ) {with( this )  {if( current ){  current.hide();}if( !parameters.className ){ parameters.className = "moskConfirm" ;};if( !labelOK ){ labelOK = "OK";};if( !labelCancel ){ labelCancel = "Cancel";};parameters.text = "<p class=\"" + parameters.className + "_p\" >" + parameters.text + "</p>"; parameters.buttons = new Array();parameters.buttons[0] = new mosk.buttonObject( {label: labelOK, type: 'button', click: parameters.action, container: "moskDialog_" + (dialogs.length ) + "_inner" } );parameters.buttons[1] = new mosk.buttonObject( {label: labelCancel, type: 'button', click: function(){ close();}, container: "moskDialog_" + ( dialogs.length ) + "_inner" } );dialogs[ dialogs.length ] = new mosk.dialogObject( parameters );current = dialogs[ dialogs.length - 1 ]; current.id = "moskDialog_" + ( dialogs.length -  1);current.open(); };  return false; },  close: function() {  var tmpDialogs = new Array(); if( !this.current )  {return false;  } this.current.close(); if( this.dialogs.length )  {this.dialogs.length--; } if( this.dialogs.length  )  {this.current = this.dialogs[ this.dialogs.length -1 ];this.current.show();  }  else  {this.current = null;  } return false; },  closeAll: function() {  while(  this.dialogs.length  ) {this.close();  }; },  onEscape: function( event ) { if( window.event ) {  var key = window.event.keyCode; } else {  var key = event.keyCode;};  if( key == 27 ) {this.close(); };  }};mosk.dialogObject = function( parameters ){  this.id  = false;  this.text= false; this.url = false; this.cache  = false; this.appendTo  = false; this.dinamic= false; this.shadow = true; this.escroll= true; this.object = null; this.width  = 0; this.height = 0; this.loading= false; this.content= false;  this.className = "moskDialog"; this.oeffect= false;  this.eeffect= false; this.buttons= new Array(); this.in_effect = false;  for( param in parameters ){  this[ param ] = parameters[ param ];};};mosk.dialogObject.prototype.open = function(){  if( this.object )  {this.show();  }  else  {this.create();  };};mosk.dialogObject.prototype.create = function(){  if( ! ( this.object = mosk.dom.me( this.id ) ) )  {this.object = mosk.dom.ce( "div" );this.object.sA( "id", this.id );this.object.sS( "display", "none" );this.object.sA( "className", this.className );this.content = mosk.dom.ce( "div" );this.content.sA( "id", this.id + "_inner");this.content.sA( "className", this.className + "Inner");this.object.aE( this.content );document.body.appendChild( this.object.node );  };  if( this.width )  {this.object.sS( "width",  this.width + "px" );  }; if( this.height )  {this.object.sS( "height",  this.height + "px" );  }; if( this.shadow )  { mosk.shadow.drop();  };if( this.loading )  {var loadResult =  mosk.util.call( this.loading + "|" + this.content.gA( "id" ) ); if( loadResult ){ this.content.sC( loadResult );};  };this.set_position(); this.object.sS( "zIndex", 999 );  this.object.sS( "visibility", "hidden" );  this.object.sS( "display", "block" ); this.set_content();  mosk.util.event_start( document, "keydown", function( e ){ mosk.dialog.onEscape( e ); mosk.util.event_stop( this, 'keydown', arguments.callee );}  ); if( this.escroll )  {mosk.util.event_start( window, "scroll", function( e ){ if( mosk.dialog.current ){ mosk.dialog.current.event_position();  }} ); mosk.util.event_start( window, "resize", function( e ){ if( mosk.dialog.current ){ mosk.dialog.current.event_position();  }} );  }  if( this.shadow )  {mosk.util.event_start( mosk.shadow.div.node, "click", function( e ){  mosk.dialog.close();  mosk.util.event_stop( this, 'click', arguments.callee );} );  };  };mosk.dialogObject.prototype.set_content = function(){  if( this.cache )  {var cObj = mosk.dom.me( this.cache );if( cObj && (  cObj.gC() != '' ) ){ this.content.sC( cObj.gC() ); this.set_buttons(); this.set_position(); this.display();  return;}; }; if( this.text )  {this.content.sC( this.text );this.set_buttons();this.set_position();this.display();return;  }; if( this.url )  {var obj = this;mosk.ajax.request( this.url, { done:  function(){  obj.content.sC( this.ajax.responseText );if( obj.cache && mosk.dom.me( obj.cache ) ){mosk.dom.me( obj.cache ).sC( this.ajax.responseText );};  obj.set_buttons();obj.set_position();  obj.display();var imgs = obj.content.elements( "img" );imgs.onload( function(){  obj.set_position();  }  );},loading:  obj.loading  },  { 'Request-In': 'dialog' } ); };};mosk.dialogObject.prototype.set_position = function( fancy ){  if( !this.object )  {return false;  };  if( this.in_effect )  {return false;  };  if( !this.width || ( this.width <  this.object.gA( "offsetWidth")  ) )  {if( this.object.gA( "offsetWidth") ){  this.width = this.object.gA( "offsetWidth");};  };  if( !this.height || ( this.height < this.object.gA( "offsetHeight")  ) )  {if( this.object.gA( "offsetHeight") ){  this.height = this.object.gA( "offsetHeight");}; }; this.object.sS( "position", "absolute" ); if( this.appendTo )  {var appendObj = mosk.dom.me( this.appendTo );cordinates = appendObj.cordinates();var posX  = cordinates[0];  var posY  = cordinates[1];  var winSize = mosk.util.window();  if( this.dinamic )  {if( ( posX + this.width ) > winSize[ 0 ] + winSize[ 2 ] )  {posX = posX - this.width;  };if( ( posY + this.height ) > ( winSize[ 1 ] + winSize[ 3 ] ) )  {posY = posY - this.height;  }; }; }  else  {winSize = mosk.util.window();  posX = ( winSize[ 0 ]/ 2 ) - ( this.width / 2 );  posY = ( ( winSize[ 1 ]  / 2 ) + winSize[ 3 ] ) - ( this.height / 2 ); if( posY < winSize[3] )  { posY = winSize[3] + 10;  };}; if( fancy )  {if( this.object.gP( "top" ) ){  mosk.util.in_time( this.object, { property: 'top', from: this.object.gP( "top" ), to: posY, timeOut: 5, step: 10 } );}else{ this.object.sS( "top", posY + "px" ); } } else  { this.object.sS( "top", posY + "px" );  }this.object.sS( "left", posX + "px" );};mosk.dialogObject.prototype.display = function(){ with( this ) {if( oeffect )  {in_effect = true;var size  = oeffect.length;var cnt= 0; if(  typeof oeffect == "object" ) {  for( effect in oeffect )  { cnt ++;if( cnt == oeffect.length ){ new mosk.effect( object, oeffect[ effect ],{ start: function(){ object.sS( "visibility", "visible" );  }, done: function(){ in_effect = false; set_position(); } } ); }else{ new mosk.effect( object, oeffect[ effect ]  ); }} } else {new mosk.effect( object, oeffect, { start: function(){ object.sS( "visibility", "visible" );  }, done: function(){ in_effect = false; set_position(); } } );} }  else  {object.sS( "visibility", "visible" );  }  };  };mosk.dialogObject.prototype.event_position = function(){  this.escroll = true;  var winSizes = mosk.util.window(); if( this.height >= winSizes[1] )  {this.escroll = false;  }; if( this.width >= winSizes[0] )  {this.escroll = false;  }; if( this.escroll )  {this.set_position( true );  };};mosk.dialogObject.prototype.set_buttons = function(){for( var cB =0 ; cB < this.buttons.length; cB++ ){ this.buttons[ cB ].create();};};mosk.dialogObject.prototype.show = function(){  this.object.sS( "display", "block" ); if( this.shadow )  {mosk.shadow.drop();  };  };mosk.dialogObject.prototype.close = function(){  mosk.dom.re( this.object );  this.object = false; if( this.shadow )  {mosk.shadow.hide();  };if( this.escroll )  {mosk.util.event_stop( window, "scroll",function( e ){ if( mosk.dialog.current ){mosk.dialog.current.event_position();}} );mosk.util.event_stop( window, "resize",function( e ){ if( mosk.dialog.current ){mosk.dialog.current.event_position();}} );  }  };mosk.dialogObject.prototype.hide = function(){  this.object.sS( "display", "none" ); if( this.shadow )  {mosk.shadow.hide();  };  };mosk.buttonObject = function( parameters ){  this.label  = ""; this.click  = ""; this.type= "link"; this.object = null;  for( param in parameters ){  this[ param ] = parameters[ param ];};};mosk.buttonObject.prototype.create = function(){  switch( this.type )  {case "link":this.create_link();break;case "button":this.create_button();break;default: return false;break; }; this.set_position();};mosk.buttonObject.prototype.create_button = function(){  with( this )  {object = mosk.dom.ce( "input" );  object.node.type = "button";  object.sA( "value", this.label );  object.node.onclick = function(){ mosk.util.eval( click );} }  };mosk.buttonObject.prototype.create_link = function(){  with( this )  {object = mosk.dom.ce( "a" );object.node.href = "javascript:;";object.node.onclick = function(){ mosk.util.eval( click );} }};mosk.buttonObject.prototype.set_position = function(){  var cNode = mosk.dom.me( this.container ); if( cNode )  {cNode.aE( this.object );  };};
mosk.shadow = { div: null,  color: "#000000",drop: function( frame ) { this.disable();this.div = mosk.dom.me( "moskShadow_div" );if( !this.div ){ this.div = mosk.dom.ce( "div" ); this.div.sA( "id", "moskShadow_div" ); document.body.appendChild( this.div.node );};var browser = mosk.util.browser();if( ( browser.name == "ie" ) && ( browser.version <= 6 ) ){ mosk.util.event_start( window, "scroll", function( e ){ if( mosk.shadow ){ mosk.shadow.move();  }} );/*document.body.scroll = "no";document.documentElement.style.overflow = 'hidden';*/var winInfo = mosk.util.window();this.div.sS( "width", ( winInfo[ 0 ] + winInfo[ 2 ] ) + "px" ); this.div.sS( "height", ( winInfo[ 1 ] + winInfo[ 3 ] ) + "px" );this.div.sS( "position", "absolute" );}else{this.div.sS( "width", "100%" ); this.div.sS( "height", "100%" ); this.div.sS( "position", "fixed" ); }this.div.sS( "top",  "0" );this.div.sS( "left", "0" );this.div.sS( "backgroundColor", this.color );this.div.sS( "display", "block" );this.div.sP( "opacity", 0.7 );this.div.sC( "&nbsp;" ); },  move: function() {var winInfo = mosk.util.window();this.div.sS( "width", ( winInfo[ 0 ] + winInfo[ 2 ] ) + "px" ); this.div.sS( "height", ( winInfo[ 1 ] + winInfo[ 3 ] ) + "px" );this.div.sS( "position", "absolute" ); },  hide: function() {this.div.sS( "display", "none" );  var browser = mosk.util.browser();  if( ( browser.name == "ie" ) && ( browser.version <= 6 ) )  {/*document.body.scroll = "yes";document.documentElement.style.overflow = 'auto';*/  };this.enable();  },  disable: function() {  var browser = mosk.util.browser();  if( ( browser.name == "ie" ) && ( browser.version <= 6 ) )  {  mosk.dom.ebt( "select" ).sS( "visibility", "hidden" );  };  mosk.dom.ebt( "object" ).sS( "visibility", "hidden" );  },  enable: function() {  var browser = mosk.util.browser();  if( ( browser.name == "ie" ) && ( browser.version <= 6 ) )  { mosk.dom.ebt( "select" ).sS( "visibility", "" );};  mosk.dom.ebt( "object" ).sS( "visibility", "" ); }  };
mosk.editor = function( textarea_id, parameters, config ){ this.textarea = mosk.dom.me( textarea_id );  this.area  = false;  this.edior = false;  this.frame = false;  this.panel = false;  this.drowdowns = false;  this.mode  = "html";  this.site_url = config.site_url;  this.width = 0;  this.height = 0;  this.theme_path  = "extentions/moskeditor/";  this.theme = "default";  this.config = config;  this.browser = mosk.util.browser();this.openTag = "<";  this.closeTag = ">";  this.debug = false;  this.names = new Array();this.buttons = new Array();  this.buttons['bold']  =new Array( "b","Bold",  "btn_bold" ); this.buttons['italic']=new Array( "i","Italic","btn_italic" );  this.buttons['underline']=new Array( "u",  "Underline", "btn_underline" );this.buttons['strikethrough']  =new Array( "strike", "Strike Through", "btn_strikethrough" ); this.buttons['subscript']=new Array( "sub", "Subscript","btn_subscript" );  this.buttons['superscript'] =new Array( "sup", "Superscript", "btn_superscript" );this.buttons['font_name']=new Array( "font_name","Font Name", "btn_font_name" );this.buttons['font_size']=new Array( "font_size","Font Size", "btn_font_size" ); this.buttons['emoicons'] =new Array( "emoicons", "Emontions", "btn_emoicons" );  this.buttons['unorderedlist']  =new Array( "unorderedlist", "Un Ordered List", "btn_unorderedlist" );this.buttons['orderedlist'] =new Array( "orderedlist", "Ordered List", "btn_orderedlist" );this.buttons['formatblock'] =new Array( "formatblock", "Header", "btn_formatblock" ); this.buttons['justifyright']=new Array( "justifyright", "Justify Right", "btn_justifyright" );  this.buttons['justifyleft'] =new Array( "justifyleft", "Justify Left", "btn_justifyleft" );  this.buttons['justifyfull'] =new Array( "justifyfull", "Justify Full", "btn_justifyfull" );  this.buttons['justifycenter']  =new Array( "justifycenter", "Justify Center", "btn_justifycenter" );  this.buttons['preview']  =new Array( "prev",  "Preview","btn_preview" );this.buttons['clear'] =new Array( "clr","Clear",  "btn_clear" ); this.buttons['sourse'] =new Array( "sourse",  "View Sourse",  "btn_sourse" );this.font_names = new Array( "Arial", "Sans Serif", "Tahoma", "Verdana", "Courier New", "Georgia", "Times New Roman", "Impact", "Comic Sans MS" );  this.font_sizes = new Array( 1, 2, 3, 4, 5, 6, 7 );this.headers = new Array( "h1", "h2", "h3", "h4", "h5", "h6" ); for( param in parameters ) {  this[param] = parameters[param]; }; if( this.textarea ) {  this.init(); };};mosk.editor.prototype.init = function(){ if( this.browser.name == "konqueror" ) {  return false; };/* var link = mosk.dom.ce( "link" ); link.sA( "type", "text/css" ); link.sA( "rel", "stylesheet" ); link.sA( "href", this.site_url + this.theme_path + this.theme + "/style.css" ); mosk.dom.mt( "head" ).aE( link );*/ if( !this.height && parseInt( this.textarea.gS( "height" ) ) ) {  this.height = parseInt(this.textarea.gS( "height" ) ); }; if( !this.width && parseInt( this.textarea.gS( "width" ) ) ) {  this.width = parseInt(this.textarea.gS( "width" ) ); }; if( !this.height && parseInt( this.textarea.gA( "offsetHeight" ) ) ) {  this.height = parseInt(this.textarea.gA( "offsetHeight" ) ); }; if( !this.width && parseInt( this.textarea.gA( "offsetWidth" ) ) ) {  this.width = parseInt(this.textarea.gA( "offsetWidth" ) ); }; this.area= mosk.dom.ce( "div" ); this.area.sA( "className", "moskEditor_" + this.theme );  this.area.sS( "display",  "block" ); this.create_panel();  this.create_editor();var obj = this; if( this.config ) {this.load_panel(); this.area.aE( obj.panel );this.area.aE( obj.editor );this.area.aE( obj.dropdowns );this.textarea.node.parentNode.appendChild( obj.area.node );this.create_frame();this.sizes();if( !this.debug ){ this.textarea.sS( "display",  "none" );};  } else {mosk.ajax.request( this.site_url + this.theme_path + this.theme + "/config.php",  {done: function(){  var string = ( "var p = " + this.ajax.responseText );  eval( string );  obj.config = p;obj.load_panel();  obj.area.aE( obj.panel ); obj.area.aE( obj.editor );obj.textarea.node.parentNode.appendChild( obj.area.node );  obj.create_frame();  obj.sizes(); if( !obj.debug )  {obj.textarea.sS( "display",  "none" );  }; }  }); };  return false;};mosk.editor.prototype.sizes = function(){ if( this.width ) {  this.area.sS( "width", this.width + "px" );  this.editor.sS( "width", this.width + "px" );}; if( this.height ) {  this.editor.sS( "height",  this.height + "px" ); };  };mosk.editor.prototype.update = function(){  this.panel.eBP( "div", "className", "moskEditor_" + this.theme +"_dropdown" ).sS( "display", "none" );  if( this.mode == "text" ) {if( ( typeof document.body.innerText ) == "undefined" ){var html = this.frame.document.body.ownerDocument.createRange();html.selectNodeContents( this.frame.document.body );var value = html.toString();}else{  var value = this.frame.document.body.innerText;};} else {try{ var value  = this.frame.document.body.innerHTML;}catch( e ){ return false;};  }; value = value.replace(/<(\/?)STRONG>/gi, "<$1B>");  value = value.replace(/<(\/?)EM>/gi, "<$1i>");  this.textarea.sA( "value", value );};mosk.editor.prototype.create_panel = function(){ this.panel = mosk.dom.ce( "div" );  this.panel.sA( "className", "moskEditor_panel_" + this.theme );};mosk.editor.prototype.load_panel = function(){  var pannelHTML =""; var dropDowns  = ""; if( this.config.buttons ) {  pannelHTML += "<ul>";for( button in this.config.buttons )  {if( this.buttons[ this.config.buttons[ button ] ] ){ pannelHTML += "<li class=\"" + this.buttons[ this.config.buttons[ button ] ][2]  + "\" id=\"moskEditor_" + this.textarea.gA( "id" ) + "_act_" + this.buttons[ this.config.buttons[ button ] ][0]  + "\"  >"; switch( this.buttons[ this.config.buttons[ button ] ][0] ) { case "formatblock":pannelHTML += "<a unselectable=\"on\" class=\"action\" title=\"" + this.config.names[ button ] + "\"><span  unselectable=\"on\" >" +  this.config.names[ button ] + "</span></a><br />";dropDowns  += "<div id=\"moskEditor_" + this.textarea.gA( "id" ) +"_btn_formatblock\" class=\"moskEditor_" + this.theme +"_dropdown\" >"; for( header in this.headers )  { dropDowns += "<a unselectable=\"on\"  class=\"formatblock_action\"><" + this.headers[ header ]  + ">" + this.headers[ header ] + "</" + this.headers[ header ]  + "></a>";  }; dropDowns +=  "</div>";  break;case "font_name":pannelHTML += "<a unselectable=\"on\" class=\"action\" title=\"" +  this.config.names[ button ] + "\"><span  unselectable=\"on\" >" + this.config.names[ button ]  + "</span></a><br />";dropDowns += "<div id=\"moskEditor_" + this.textarea.gA( "id" ) +"_btn_font_name\" class=\"moskEditor_" + this.theme +"_dropdown\" >"; for( font in this.font_names )  { dropDowns += "<a unselectable=\"on\"  class=\"font_name_action\" style=\"font-family: " + this.font_names[ font ]  + "\">" + this.font_names[ font ] + "</a>";  }; dropDowns +=  "</div>";  break;case "font_size":pannelHTML += "<a unselectable=\"on\" class=\"action\" title=\"" + this.config.names[ button ] + "\"><span  unselectable=\"on\" >" + this.config.names[ button ] + "</span></a><br />";dropDowns += "<div id=\"moskEditor_" + this.textarea.gA( "id" ) + "_btn_font_size\" class=\"moskEditor_" + this.theme +"_dropdown\">"; for( size in this.font_sizes )  { dropDowns += "<a unselectable=\"on\"  class=\"font_size_action\"><font size=\"" + this.font_sizes[ size ] + "\">" + this.font_sizes[ size ] + "</font></a>";  }; dropDowns +=  "</div>";  break;case "emoicons":if( this.config.emoicons.length ){pannelHTML += "<a unselectable=\"on\" class=\"action\" title=\"" + this.config.names[ button ] + "\"><span  unselectable=\"on\" >" +  this.config.names[ button ]  + "</span></a><br />";dropDowns += "<div id=\"moskEditor_" + this.textarea.gA( "id" )+"_btn_emoicons\" class=\"moskEditor_" + this.theme +"_dropdown emoicons\">";for( icon in this.config.emoicons ){ dropDowns += "<a unselectable=\"on\"  class=\"emoicons_action\"><img src=\"" + this.site_url +  this.theme_path + this.theme + "/emoicons/" + this.config.emoicons[ icon ] + "\" alt=\""+this.config.emoicons[ icon ]+"\" border=\"0\"></a>"; };dropDowns +=  "</div>";  }; break; default:pannelHTML += "<a unselectable=\"on\" class=\"action\"  title=\"" + this.config.names[ button ] + "\"><span  unselectable=\"on\" >" + this.config.names[ button ] + "</span></a>";break;  };  pannelHTML += "</li>";  };  };  pannelHTML += "</ul>";  }; this.panel.sC( pannelHTML );  this.dropdowns = mosk.dom.ce( "div" ); this.dropdowns.sC( dropDowns );var links = this.panel.eBP( "a", "className","action"  );  var obj = this;  links.click(  function()  { obj.action( this.parentNode.className.replace( "btn_", "" ) ); return false;  } ); var font_name_links = this.dropdowns.eBP( "a", "className","font_name_action"  );if( font_name_links.size ) {  font_name_links.click(  function()  {obj.action_font_name( this.innerHTML ); this.parentNode.style.display = "none";  return false;  } ); };var font_size_links = this.dropdowns.eBP( "a", "className","font_size_action"  );if( font_size_links ) {  font_size_links.click(  function()  {obj.action_font_size( this.getElementsByTagName( "font" ).item( 0 ).innerHTML ); this.parentNode.style.display = "none";  return false;  } ); };  var emoicons_links = this.dropdowns.eBP( "a", "className","emoicons_action"  );if( emoicons_links ) {  emoicons_links.click(  function()  {  obj.action_emoicons( this.getElementsByTagName( "img" ).item( 0 ).src ); this.parentNode.style.display = "none";  return false;  } ); };var headers_links = this.dropdowns.eBP( "a", "className","formatblock_action"  );if( headers_links ) {  headers_links.click(  function()  {obj.action_formatblock( this.getElementsByTagName( "*" ).item( 0 ).innerHTML ); this.parentNode.style.display = "none";  return false;  } ); }; };mosk.editor.prototype.create_editor = function(){ this.editor = mosk.dom.ce( "div" );  this.editor.sA( "className", "moskEditor_editor_" + this.theme );  var frame = "<iframe  name=\"" + "moskEditorFR_" + this.textarea.gA( "id" ) + "\"  id=\"" + "moskEditorFR_" + this.textarea.gA( "id" ) + "\" class=\"" + "moskEditor_area_" + this.theme + "\" style=\"width: 100%; height: 100%\" frameborder=\"0\"></iframe>"; this.editor.sC( frame ); };mosk.editor.prototype.create_frame = function(){ this.frame = document.getElementById( "moskEditorFR_" + this.textarea.gA( "id" ) ).contentWindow; this.frame.document.open();  var html = this.textarea.gA( "value" );if( !html.length ) {  html = "&nbsp;"; }  if( this.browser['name'] == "ie" ) {this.frame.document.write( "<link rel=\"stylesheet\" media=\"screen\" type=\"text/css\" href=\"" + this.site_url + this.theme_path + this.theme + "/area.css" + "\"/>" + html ); }  else {this.frame.document.write('<html><head><link rel="stylesheet" type="text/css" href="' + this.site_url + this.theme_path + this.theme + '/area.css"/></head><body>'  + html + '</body></html>'); };  this.frame.document.close(); if( this.browser['name'] == "ie" ) {  this.frame.document.body.contentEditable = true; } else { this.frame.document.designMode = "on";};var obj = this;  var forms = document.getElementsByTagName( "form" );  for( var cF = 0; cF < forms.length; cF++) {mosk.util.event_start( forms[cF], "submit", function(){ obj.update(); } ) };  try {  this.frame.document.execCommand ('useCSS',false,true); } catch( e ){};  this.textarea.node.rewrite = "moskEditorFR_" + this.textarea.gA( "id" ); };mosk.editor.prototype.selection = function(){ var selection = {};sel  = this.frame.getSelection();  selection.range = sel.getRangeAt(0); selection.pos= selection.range.startOffset; selection.start = selection.range.startContainer; selection.end= selection.range.endContainer;return selection;};mosk.editor.prototype.action = function( method ){ if( ( this.mode == "text") && ( method != "sourse" ) ) {  this.update();  return; }; switch( method.toLowerCase() ) {case "font_name":  var chooser = mosk.dom.me( "moskEditor_" + this.textarea.gA( "id" ) +"_btn_font_name" );this.close_dropdowns( chooser ); var button  = mosk.dom.me( "moskEditor_" + this.textarea.gA( "id" ) +"_act_font_name" ); var cordinates  = button.cordinates(); var mCordinates = this.area.cordinates();chooser.sS( "left", (  cordinates[0] - mCordinates[0]  ) + "px" ); chooser.sS( "top", (  cordinates[1] - mCordinates[1] + button.gP( "height")  ) + "px" ); if( chooser.gS( "display" ) == "block" )  {  chooser.sS( "display", "none" );  } else {  chooser.sS( "display", "block" );}return;break;case "font_size": var chooser = mosk.dom.me( "moskEditor_" + this.textarea.gA( "id" ) +"_btn_font_size" );this.close_dropdowns( chooser );  var button  = mosk.dom.me( "moskEditor_" + this.textarea.gA( "id" ) +"_act_font_size" ); var cordinates  = button.cordinates(); var mCordinates = this.area.cordinates();chooser.sS( "left", (  cordinates[0] - mCordinates[0]  ) + "px" ); chooser.sS( "top", (  cordinates[1] - mCordinates[1] + button.gP( "height")  ) + "px" ); if( chooser.gS( "display" ) == "block" )  {  chooser.sS( "display", "none" );  } else {  chooser.sS( "display", "block" );} return;break;case "formatblock": var chooser = mosk.dom.me( "moskEditor_" + this.textarea.gA( "id" ) +"_btn_formatblock" );this.close_dropdowns( chooser );  var button  = mosk.dom.me( "moskEditor_" + this.textarea.gA( "id" ) +"_act_formatblock" ); var cordinates  = button.cordinates(); var mCordinates = this.area.cordinates();chooser.sS( "left", (  cordinates[0] - mCordinates[0]  ) + "px" ); chooser.sS( "top", (  cordinates[1] - mCordinates[1] + button.gP( "height") ) + "px" ); if( chooser.gS( "display" ) == "block" )  {  chooser.sS( "display", "none" );  } else {  chooser.sS( "display", "block" );}return;break;case "emoicons": var chooser = mosk.dom.me( "moskEditor_" + this.textarea.gA( "id" ) +"_btn_emoicons" );this.close_dropdowns( chooser );  var button  = mosk.dom.me( "moskEditor_" + this.textarea.gA( "id" ) +"_act_emoicons" ); var cordinates  = button.cordinates(); var mCordinates = this.area.cordinates();chooser.sS( "left", (  cordinates[0] - mCordinates[0]  ) + "px" ); chooser.sS( "top", (  cordinates[1] - mCordinates[1] + button.gP( "height")  ) + "px" ); if( chooser.gS( "display" ) == "block" )  {  chooser.sS( "display", "none" );  } else {  chooser.sS( "display", "block" );} return;break;case "sourse": this.close_dropdowns( false ); this.update(); if( this.mode == "html" ) { var html = this.frame.document.body.innerHTML; if( ( typeof document.body.innerText ) == "undefined" )  {var htmlNode = document.createTextNode( html );this.frame.document.body.innerHTML = ""; this.frame.document.body.appendChild( htmlNode );  }  else  {this.frame.document.body.innerText = html;  }this.panel.sA( "className", "moskEditor_panel_" + this.theme + "_disabled" );this.mode = "text"; } else {  if( ( typeof document.body.innerText ) == "undefined" )  {  var html = this.frame.document.body.ownerDocument.createRange();  html.selectNodeContents( this.frame.document.body );  this.frame.document.body.innerHTML = html.toString();  }  else  {var html = this.frame.document.body.innerText;this.frame.document.body.innerHTML = html;  } this.panel.sA( "className", "moskEditor_panel_" + this.theme );this.mode = "html"; }  return;break;case "Justifyright": this.close_dropdowns( false );  this.action_formatblock( "justifyright" );break;case "Justifyleft": this.close_dropdowns( false );  this.action_formatblock( "justifyleft" );break;case "Justifyfull": this.close_dropdowns( false );  this.action_formatblock( "justifyfull" );break;case "Justifycenter": this.close_dropdowns( false );  this.action_formatblock( "justifycenter" );break;case "unorderedlist": this.close_dropdowns( false );  this.action_unorderedlist();break;case "orderedlist": this.close_dropdowns( false );  this.action_orderedlist();break;case "preview":this.close_dropdowns( false );this.update(); mosk.dialog.open( { text: this.frame.document.body.innerHTML, width: 500, height: 400 } );mosk.dialog.current.object.sA( "className", "moskEditor_preview_" + this.theme );return;break;case "clear": this.close_dropdowns( false ); this.frame.focus(); this.action_clear();break;default:  this.close_dropdowns( false );this.frame.focus();this.action_default( method );break; }; this.update();};mosk.editor.prototype.selected_text = function(){ var text = "";  if( this.frame.document.selection ) {  var range = this.frame.document.selection.createRange();  text = range.text; } else {  text = this.frame.document.getSelection(); } return text;};mosk.editor.prototype.close_dropdowns = function( object ){ var dropdowns = this.dropdowns.elements( "div" );/*eBP( "div", "className", "moskEditor_" + this.theme +"_dropdown" );*/ for( var cD = 0; cD < dropdowns.size; cD++ ) { if( !object )  { dropdowns.items[ cD ].sS( "display", "none" );  }  else if( dropdowns.items[ cD ].gA( "id" ) != object.gA( "id" ) )  {dropdowns.items[ cD ].sS( "display", "none" );  };  };}; mosk.editor.prototype.action_default = function( action ){  try  {  this.frame.document.execCommand( action, false, null); } catch( e ) {};};mosk.editor.prototype.action_clear = function( action ){ this.frame.document.body.innerHTML = "";  };mosk.editor.prototype.action_font_name = function( font_name ){  this.frame.focus();  try  {  this.frame.document.execCommand( "fontName", false, font_name); } catch( e ) {};  this.update();};mosk.editor.prototype.action_font_size = function( font_size ){  this.frame.focus();  try  {  this.frame.document.execCommand( "fontSize", false, font_size);  } catch( e ) {};  this.update();};mosk.editor.prototype.action_emoicons = function( icon ){  this.frame.focus();try  {  this.frame.document.execCommand( "insertImage", false, icon);} catch( e ) {};  this.update();};mosk.editor.prototype.action_formatblock = function( header ){  this.frame.focus(); try  {  this.frame.document.execCommand(  "Formatblock", false, header );  } catch( e ) {};  this.update();};mosk.editor.prototype.action_unorderedlist = function(){  this.frame.focus();  try  { this.frame.document.execCommand( "insertunorderedlist", false, null);  } catch( e ) {};  this.update();};mosk.editor.prototype.action_orderedlist = function(){  this.frame.focus();  try  {  this.frame.document.execCommand( "insertorderedlist", false, null);  } catch( e ) {};  this.update();};mosk.editor.prototype.action_formatblock = function( method ){  this.frame.focus(); try  {  this.frame.document.execCommand( "formatblock", false, method );  } catch( e ) {};this.update();};
mosk.preview = function( class_name ){  this.links  = mosk.dom.ebp( "a", "className", class_name ); this.width  = 0; this.height = 0; if( !this.links.size )  {return false;  } this.container = mosk.dom.me( class_name + "_mosk_tooltop" ); if( !this.container )  {this.container = mosk.dom.ce( "div" );this.container.sA( "id", class_name + "_mosk_tooltop" );mosk.dom.ae( this.container, mosk.dom.mt( "body" ) );  } this.container.sS( "display", "none" ); this.container.sS( "position", "absolute" );  this.container.sS( "zIndex", 899 ); var object = this; this.links.onmouseover( function() {var rel = this.getAttribute( "rel" );  if( rel  ){ var block = mosk.dom.me( rel ); if( block ) {object.content( block );object.position(); }  };}  ); this.links.onmouseout( function() { object.container.sS( "display", "none" ); document.onmousemove = function(){}; mosk.shadow.enable(); }  );};mosk.preview.prototype.content = function( block ){  this.container.sS( "visibility", "hidden" );  this.container.sS( "display", "block" ); this.container.sC( block.gC() ); this.width  = this.container.gA( "offsetWidth" );  this.height = this.container.gA( "offsetHeight" ); this.container.sS( "display", "none" ); this.container.sS( "visibility", "visible" );};mosk.preview.prototype.position = function( ){ var obj = this;document.onmousemove = function( event )  {mosk.shadow.disable();var cordinates = mosk.util.mouse( event );var winInfo = mosk.util.window();var min_height = winInfo[3];var max_height = winInfo[1] + winInfo[3];var ppv_height = obj.height + cordinates[1];var min_width  = winInfo[2];var max_width  = winInfo[0] + winInfo[2] - 25;var ppv_width  = obj.width + cordinates[0];  obj.container.sS( "display", "block" );  obj.container.sS( "top", cordinates[1] + 5 + "px" );obj.container.sS( "left", cordinates[0] + 5 + "px" );if( ppv_height > max_height ){var ppv_min =cordinates[1] - obj.height;  if( ppv_min > min_height ) { obj.container.sS( "top", ( ppv_min ) + "px" ); } else {  obj.container.sS( "top", ( cordinates[1] - (  ppv_height - max_height +10 ) ) + "px" ); };  };if( ppv_width > max_width ){ var ppv_min =cordinates[0] - obj.width;  if( ppv_min - min_width ) { obj.container.sS( "left", ( ppv_min ) + "px" ); } else {  obj.container.sS( "left", ( cordinates[0] - (  ppv_width - max_width +10 ) ) + "px" ); };  }; }; };
mosk.flash = function( container_id, parameters ){  this.container = mosk.dom.me( container_id ); this.params = { move: '',width: '',height: '',version: '6,0,29,0'  }; this.unique = { movie: 1, version: 1, width: 1, height: 1 };for( param in parameters )  {this.params[ param ] = parameters[ param ];  };this.code = ""; if( !this.container )  {return false;  } this.create_code();this.show();};mosk.flash.prototype.create_code = function(){/*  if (navigator.plugins && typeof navigator.plugins["Shockwave Flash"] == "object"){this.code = '<embed type="application/x-shockwave-flash" src="' + this.params.movie + '" pluginspage="http://www.macromedia.com/go/getflashplayer" width="' + this.params.width + '" height=" ' + this.params.height + '" ';for( param in this.params ){ if( !this.unique[ param ] ) {  this.code += ' ' + param + '="'+ this.params[ param ] +'"'; }};this.code += '></embed>';  }  else  {this.code = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + this.params.version + '" width="' + this.params.width + '" height=" ' + this.params.height + '">';this.code += '<param name="movie" value="' + this.params.movie + '" />';for( param in this.params ){ if( !this.unique[ param ] ) {  this.code += '<param name="' + param + '" value="' + this.params[ param ] + '" />'; }};this.code += '</object>';  }  */this.code = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + this.params.version + '" width="' + this.params.width + '" height=" ' + this.params.height + '">';this.code += '<param name="movie" value="' + this.params.movie + '" />';for( param in this.params ){ if( !this.unique[ param ] ) {  this.code += '<param name="' + param + '" value="' + this.params[ param ] + '" />'; }};this.code += '<embed type="application/x-shockwave-flash" src="' + this.params.movie + '" pluginspage="http://www.macromedia.com/go/getflashplayer" width="' + this.params.width + '" height=" ' + this.params.height + '" ';for( param in this.params ){ if( !this.unique[ param ] ) {  this.code += ' ' + param + '="'+ this.params[ param ] +'"'; }};this.code += '></embed>';this.code += '</object>'; };mosk.flash.prototype.show = function(){  this.container.sC( this.code );};
mosk.effect = function( object, effect, parameters ){this.timeOut = 80;  this.step = 50;  this.shake_step = 10;  this.done = false;  this.start = false;  for( param in parameters )  {  this[ param ] = parameters[ param ];  };  this.object = object;switch( effect ) {  case "elg":this.elg();break;case "mfk":this.mfk();break;  case "mfl":this.mfl();break;case "mft":this.mft();break;case "sft":this.sft();break;  case "shake": this.shake() ;break;  case "h_shake":  this.h_shake() ; break;  case "v_shake":  this.v_shake() ; break;  case "fade_in":  this.fade_in() ; break;  case "g_right":  this.g_right() ; break;  case "g_down":this.g_down() ;  break;}};mosk.effect.prototype.elg = function(){ var width  = this.object.gP( "width" ); var height = this.object.gP( "height" ); var top = this.object.gP( "top" ); var left= this.object.gP( "left" ); var elements = this.object.elements( "*" );  start_w = 0;width / 2; start_h = 0;height / 2; start_t = top + height / 2 ; start_l = left +  width / 2;  var par_1 = this.object.gS( "overflow" );  var max = width; if( !max ) {  return false; };  if( elements.size && elements.items[0].gP( "width" ) ) {  this.object.elements( "*" ).items[ 0 ].sP( "width", max ); }  this.object.sS( "overflow", "hidden" );  with( this ) {mosk.util.in_time( object, {  property: 'width', from: start_w, to: width, timeOut: timeOut, step: step } );  mosk.util.in_time( object, {  property: 'height', from: start_h, to: height, timeOut:  timeOut, step: step } );mosk.util.in_time( object, {  property: 'top', from: start_t, to: top, timeOut: timeOut, step: step } );mosk.util.in_time( object, {  property: 'left', from: start_l, to: left, timeOut: timeOut, step: step, start: this.start, done: this.done } ); } };mosk.effect.prototype.mfk = function(){ var left = parseInt( this.object.gS( "left" ) ); var width= this.object.gP( "width" );  var start  =  -width;  var top = parseInt( this.object.gS( "top" ) ); var height = this.object.gP( "height" );  var start  =  -height;  this.object.sS( "top",  ( start ) + "px" );  mosk.util.in_time( this.object, {  property: 'left', from: start, to: left, timeOut: this.timeOut, step: this.step, start: this.start, done: this.done } ); mosk.util.in_time( this.object, {  property: 'top', from: start, to: top, timeOut: this.timeOut, step: this.step } );};mosk.effect.prototype.mfl = function(){ var left = parseInt( this.object.gS( "left" ) ); var width= this.object.gP( "width" );  var start  =  -width; mosk.util.in_time( this.object, {  property: 'left', from: start, to: left, timeOut: this.timeOut, start: this.start, step: this.step, done: this.done } );};mosk.effect.prototype.mft = function(){ var top = parseInt( this.object.gS( "top" ) ); var height = this.object.gP( "height" );  var start  =  -height;  this.object.sS( "top",  ( start ) + "px" );  mosk.util.in_time( this.object, {  property: 'top', from: start, to: top, timeOut: this.timeOut, start: this.start, step: this.step, done: this.done } );};mosk.effect.prototype.sft = function(){ var top = 0; var height = this.object.gP( "height" );  var start  =  -height;  this.object.sS( "top",  ( start ) + "px" );  mosk.util.in_time( this.object, {  property: 'top', from: start, to: top, timeOut: this.timeOut, start: this.start, step: this.step, done: this.done } );};mosk.effect.prototype.shake = function(){ this.v_shake();  this.h_shake(); };mosk.effect.prototype.h_shake = function(){  var left  =  parseInt( this.object.gS( "left" ) ); var lMove = ( left - this.shake_step  ); var rMove = ( left + this.shake_step  );  if( this.start ) {  mosk.util.eval( this.start ); };  with( this ) {  for( var cL = 0; cL < 8; cL ++ )  {if( cL < 8 ){ setTimeout( function(){if( object.h_shake_pos == 1 )  {object.h_shake_pos = 0;object.sS( "left", lMove + "px" );  }else  {object.h_shake_pos = 1;object.sS( "left", rMove + "px" );  } }, 50+ ( cL * 100 ) );}else{ setTimeout( function(){object.sS( "left", left + "px" ); }, 50+ ( cL * 100 ) );}}; };  if( this.done ) {  mosk.util.eval( this.done ); }};mosk.effect.prototype.v_shake = function(){  var top  =  parseInt( this.object.gS( "top" ) ); var tMove = ( top - this.shake_step  ); var dMove = ( top + this.shake_step  );  if( this.start ) {  mosk.util.eval( this.start ); };  with( this ) {  for( var cL = 0; cL < 8; cL ++ )  {if( cL < 8 ){ setTimeout( function(){if( object.t_shake_pos == 1 )  {object.t_shake_pos = 0;object.sS( "top", tMove + "px" );  }else  {object.t_shake_pos = 1;object.sS( "top", dMove + "px" );  } }, 50+ ( cL * 100 ) );}else{ setTimeout( function(){object.sS( "top", top + "px" ); }, 50+ ( cL * 100 ) );}}; };  if( this.done ) {  mosk.util.eval( this.done ); }};mosk.effect.prototype.fade_in = function(){ var from = 0.4; this.object.sP( "opacity", from );  mosk.util.in_time( this.object, {  property: 'opacity', from: from, to: 1, timeOut: 50, step: 0.08, start: this.start, done: this.done } );};mosk.effect.prototype.fade_out = function(){ this.object.sP( "opacity", 1 ); mosk.util.in_time( this.object, {  property: 'opacity', from: 1, to: 0, timeOut: this.timeOut, start: this.start, step: 0.1, done: this.done } ); };mosk.effect.prototype.g_right = function(){ var elements = this.object.elements( "*" ); var par_1 = this.object.gS( "overflow" );  var max = this.object.gP( "width" ); if( !max ) {  return false; };  if( elements.size && elements.items[0].gP( "width" ) ) {  this.object.elements( "*" ).items[ 0 ].sP( "width", max ); }  this.object.sS( "width", "0px" ); this.object.sS( "overflow", "hidden" );  with( this ) {  mosk.util.in_time( object, {  property: 'width', from: 0, to: max, timeOut: timeOut, step: step, start: this.start, done: function(){ object.sS( "overflow", par_1 );if( done ){ mosk.util.eval( done );};} } );  }  };mosk.effect.prototype.g_down = function(){ var elements = this.object.elements( "*" ); var par_1 = this.object.gS( "overflow" );  var max = this.object.gP( "height" ); if( !max ) {  return false; };  if( elements.size && elements.items[0].gP( "height" ) ) {  this.object.elements( "*" ).items[ 0 ].sP( "height", max ); }  this.object.sS( "height", "0px" ); this.object.sS( "overflow", "hidden" );  with( this ) {  mosk.util.in_time( object, {  property: 'height', from: 0, to: max, timeOut: timeOut, step: step, start: this.start, done: function(){ object.sS( "overflow", par_1 );if( done ){ mosk.util.eval( done );};} } );  }  };
var lImage = null;var title  = '';function init_page(){  lImage = mosk.dom.me( "limg" ); lImage.sS( "display", "none" ); mosk.favicon.init();  mosk.before_request = function()  { if( !title ) {  title = document.title; };document.title = "loading....."; lImage.sS( "display", "block" ); mosk.favicon.change( 'http://mosksolutions.com/img/lfavicon.ico' );  var msgObj = mosk.dom.me( "sys_msg" ); if( msgObj ) {msgObj.sS( "display", "none" ); }; var msgObj = mosk.dom.me( "sys_warr" ); if( msgObj ) {msgObj.sS( "display", "none" ); }; }; mosk.after_request = function()  {  document.title = title;  lImage.sS( "display", "none" );  mosk.favicon.restore();};};function update( requested_url, parameters, cache ){if( cache ){  var cacheElement = mosk.dom.me( cache );  if( cacheElement )  {  if( cacheElement.gC() )  {mosk.dom.me( parameters.update ).sC( cacheElement.gC() ); return false;  }  else {  parameters.done = function( ) { mosk.dom.me( parameters.update ).sC( this.ajax.responseText );  cacheElement.sC( this.ajax.responseText );  };  };  };  };new mosk.ajax.request( requested_url, parameters );return false;};function toggle_boxes(){  var node = mosk.dom.me( "regForm" ); var links = node.eBP( "a", "className", "ta_box" );  var blocks= node.eBP( "div", "className", "tt_box" ); if( links.size )  {links.click( function() {  togglebox( this ); return false; } );};};function togglebox( link ){var id = link.id;var parts = link.id.split( '_' );var block = mosk.dom.me( "tt_box_" + parts[ parts.length - 1 ] );if( block.gS(  "display" ) == "block" ){ var slider = new mosk.slider( {object: block } ).up();}else{ var slider = new mosk.slider( {object: block  } ).down( );}};function avLoading(){mosk.dom.me( 'm_avatar' ).sC( '<div style=\" width: 90px; text-align: center; padding-top: 35px;\"><img src=\"img/av_load.gif\" border="0"></div>' );};function avdone( object ){ var update = mosk.dom.me( "in_cont" ); if( update ) {update.sC( object.ajax.responseText ); }; toggle_boxes();};function devload( element_id ){ var element = mosk.dom.me( element_id );  if( !element ) {return; } ;var loading = '<img src=\"img/small_loader.gif\" border="0">';var height = element.gA( "offsetHeight" );element.sC( "<div align=\"center\" style=\"padding-top: " + ( height / 2  )  + "px; height: " + ( height / 2 ) +"px; width: " + element.gA( "offsetWidth" ) + "px;\">" + loading + "</div>" );};function checkBoxes( object, container ){mosk.dom.me( container ).eBP( "input", "type", "checkbox" ).sA( "checked", object.checked );};function Load( href,  params ){  return mosk.ajax.request( href, params );}function copy_value( element_id, object ){ var element = mosk.dom.me( element_id );  if( object.value ) {  element.sA( "value", object.options[ object.selectedIndex ].text ); } else {  element.sA( "value", "" ); }};function init_pubs_page(){ var node_id = "pbc"; var cookie = Number( mosk.util.get_cookie( node_id + "_font" ) );  if( cookie ) {  var object = mosk.dom.me( node_id );  object.sS( "fontSize", cookie + "px")  ;  object.node.size = cookie; };  var link_1 = mosk.dom.ebp( "a", "className", "zoom_in" ); var link_2 = mosk.dom.ebp( "a", "className", "zoom_out" ); var link_3 = mosk.dom.ebp( "a", "className", "print_btn" );link_1.click( function(){return mosk.util.zoom( { type: 'in', node_id: 'pbc', size: 12 } ); } ); link_2.click( function(){return mosk.util.zoom( { type: 'out', node_id: 'pbc', size: 12 } ); } ); link_3.click( function(){return mosk.util.print( {url: this.href} ); } ); };function init_home_page(){ var scroll = new mosk.scroll( 's_ul', 's_line', 's_pos' );  var news_links = mosk.dom.me( "news_nav" ).elements( "a" ); news_links.click(function( )  { var update_id = this.getAttribute( "rel" );  news_active( news_links, update_id );  mosk.ajax.request( this.href, { update: update_id, loading: "devload( '" + update_id  + "' );", cache: "c_" + update_id } );return false;  } );};function init_screenshots(){  var links = mosk.dom.me( "in_cont" ).elements( "a" );  links.click(  function()  {mosk.dialog.open( {url: this.href, width: 700 } );return false;  }  );};function news_active( news_links, update_id ){ for( var cI = 0; cI < news_links.size; cI ++ ) {  var rel = news_links.items[ cI ].gA( "rel" ); if( rel == update_id )  {mosk.dom.me( rel ).sS( "display", "block" );mosk.dom.me( "i_span" ).sP( "className", rel.substr( 6 ) );  }  else  {mosk.dom.me( rel ).sS( "display", "none" );  };  };};
