// **********************************
// Please don't remove the copyright note :: alawi Hussain Ba3qeel © http://www.rayaheen.net
// **********************************
// many codes here are added by Saanina [at] gmail.com 
//تم تطوير جميع أكواد هذا الهاك  وإضافة اشياء جديده كلياً....
//  GOLDENBOX ... phpbbarabia.com //  GOLDENBOX ... phpbbarabia.com//  GOLDENBOX ... phpbbarabia.com//  GOLDENBOX ... phpbbarabia.com//  GOLDENBOX ... phpbbarabia.com
//  GOLDENBOX ... phpbbarabia.com//  GOLDENBOX ... phpbbarabia.com//  GOLDENBOX ... phpbbarabia.com//  GOLDENBOX ... phpbbarabia.com//  GOLDENBOX ... phpbbarabia.com
 // ===================== BLINK
setInterval("doBlinkText()", 500);
document.write('<span id="myblinktext" style="display:none"></span>');
function doBlinkText() {
        try {
                for (var i = 1; i < myblinktext.length; i++)
                        if (myblinktext[i].style.visibility == "hidden")
                                myblinktext[i].style.visibility = "visible";
                        else
                                myblinktext[i].style.visibility = "hidden";
        } catch(e) {
        ;
        }
}

// =================== DEVELOPED GLINT
function glint(elementid){ 
	colorarray = Array(		
	'#000000',		
	'#111111', 		
	'#222222',		
	'#333333',		
	'#444444',		
	'#555555',		
	'#666666',	
	'#777777',			
	'#888888',	
	'#999999',		
	'#AAAAAA',	
	'#BBBBBB',			
	'#CCCCCC',		
	'#DDDDDD',	
	'#EEEEEE',		
	'#FFFFFF'
	); 
	i=0; 	
	setInterval ("changecolor('"+elementid+"')",100);}
	

	function changecolor(x) { 
	var x= document.getElementById(x);
	if (x != null){	
	x.style.color = colorarray[i];	
	if (i==14){
	i= 0;	
	colorarray = colorarray.reverse();
	}	
	}	
	i++;
	}
	
//======================ALPHA10
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();

function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){  //do this so I can take a string too
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
        
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;

    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}

//=========================== 

function toSpans(span) {
  var str=span.firstChild.data;
  var a=str.length;
  span.removeChild(span.firstChild);
  for(var i=0; i<a; i++) {
    var theSpan=document.createElement("SPAN");
    theSpan.appendChild(document.createTextNode(str.charAt(i)));
    span.appendChild(theSpan);
  }
}

/*Rainbow Rainbow Rainbow Rainbow Rainbow Rainbow
 */
function RainbowSpan(span, hue, deg, brt, spd, hspd) {
    this.deg=(deg==null?360:Math.abs(deg));
    this.hue=(hue==null?0:Math.abs(hue)%360);
    this.hspd=(hspd==null?3:Math.abs(hspd)%360);
    this.length=span.firstChild.data.length;
    this.span=span;
    this.speed=(spd==null?50:Math.abs(spd));
    this.hInc=this.deg/this.length;
    this.brt=(brt==null?255:Math.abs(brt)%256);
    this.timer=null;
    toSpans(span);
    this.moveRainbow();
}

/*
 * sets the colors of the children of [this] as a hue-rotating rainbow starting at this.hue;
 */
RainbowSpan.prototype.moveRainbow = function() {
  if(this.hue>359) this.hue-=360;
  var color;
  var b=this.brt;
  var a=this.length;
  var h=this.hue;

  for(var i=0; i<a; i++) {

    if(h>359) h-=360;

    if(h<60) { color=Math.floor(((h)/60)*b); red=b;grn=color;blu=0; }
    else if(h<120) { color=Math.floor(((h-60)/60)*b); red=b-color;grn=b;blu=0; }
    else if(h<180) { color=Math.floor(((h-120)/60)*b); red=0;grn=b;blu=color; }
    else if(h<240) { color=Math.floor(((h-180)/60)*b); red=0;grn=b-color;blu=b; }
    else if(h<300) { color=Math.floor(((h-240)/60)*b); red=color;grn=0;blu=b; }
    else { color=Math.floor(((h-300)/60)*b); red=b;grn=0;blu=b-color; }

    h+=this.hInc;

    this.span.childNodes[i].style.color="rgb("+red+", "+grn+", "+blu+")";
  }
  this.hue+=this.hspd;
}
// End -->

//============================ UNDO & REDO =================================
//تم إضافة هذا الكود يوم الخميس 12 جولاي 2007 فجراً
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Turnea Iulian :: http://www.eurografic.ro */
function iObject() {
  this.i;
  return this;
}

var myObject=new iObject();
myObject.i=0;
var myObject2=new iObject();
myObject2.i=0;
store_text=new Array();

//store_text[0] store initial textarea value
store_text[0]="";

function countclik(tag) {
  myObject.i++;
  var y=myObject.i;
  var x=tag.value;
  store_text[y]=x;
}

function undo(tag) {
  if ((myObject2.i)<(myObject.i)) {
    myObject2.i++;
  } else {
    alert("إنتهت خطوات التراجع");
  }
  var z=store_text.length;
  z=z-myObject2.i;
  if (store_text[z]) {
  	tag.value=store_text[z];
  } else {
  	tag.value=store_text[0];
  }
}

function redo(tag) {
  if((myObject2.i)>1) {
    myObject2.i--;
  } else {
    alert("إنتهت خطوات التقدم");
  }
  var z=store_text.length;
  z=z-myObject2.i;
  if (store_text[z]) {
    tag.value=store_text[z];
  } else {
  tag.value=store_text[0];
  }
}
// -->