
function StartTicker()
{
 var stmp=document.getElementById("Div").style.left;
 stmp=stmp.replace("px","");
 a=document.getElementById("Div");
 a.style.left=1+parseInt(a.style.left);



if( stmp> 700)
	a.style.left = (document.getElementById("table1").offsetWidth)*-1+695;
	b = setTimeout("StartTicker()",20);

}

function BeforMove()
{

		for (i=0; i<window.document.all.length; i++){

        window.document.all(i).unselectable = "on";
        }


document.getElementById("Div").style.left = (document.getElementById("table1").offsetWidth)*-1+350;
}



function ZoomPic(my_var) {
	window.open(my_var,'ZoomPicture','scrollbars=yes,width=700,height=550,resizable=yes');
}


function openFlash(my_var,width,height) {
	window.open(my_var,'NewsFlashWindow','menubar=no,resizable=no,scrollbars=yes,width='+width+',height='+height);
}


function openTerms(my_var,width,height) {
	window.open(my_var,'TermsofUse','menubar=no,resizable=no,scrollbars=yes,width='+width+',height='+height);
}

var confirmMsg  = 'Sind Sie Sicher';
function confirmLink(theLink, theSqlQuery)
{
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
} // end of the 'confirmLink()' function




function ValidateForm()
{
	MessageLength  = document.frmAddTalkBack.comment.value.length;
	errors = "";

		if (document.frmAddTalkBack.sender.value.length<2)
		{
			errors = "يتوجب عليك إدخال اسمك";
		}

		if (document.frmAddTalkBack.subject.value.length<2)
		{
			errors = "يتوجب عليك إدخال موضوع";
		}

	if (errors != "")
	{
		alert(errors);
		return false;
	}
	else
	{

		return true;
	}
}


function setAsHomePage(obj){

    if (confirm("إجعلنا صفحة البداية؟")) {
	   obj.style.behavior='url(#default#homepage)';
	   obj.setHomePage('http://www.al-arabiya.net/');
    }

}

function AddUsToFavorite(obj){
	window.external.AddFavorite('http://www.al-arabiya.net/', 'العربيه للصحافه');
}


// This functions retrieve the Virtual Keyoard
function OpenPopKey (theInputName) {
	document.getElementById('inputName').value=theInputName;
	openPopKeyWindow('/home/EXT/key.html',339,162);
}


function nextField () {
	current = document.getElementById('inputName').value
	var next1 = '';
	switch (current) {
		case 'sender':		next1='mail';
			break
		case 'mail':	next1='city';
			break
		case 'city':	next1='subject';
			break
		case 'subject':		next1='comment';
			break
		case 'comment':	next1='sender';
			break
	}
	document.getElementById('inputName').value = next1
}


//This var is changed onLoad and onUnload from Keyboard to 'true' and 'false' in order to know if the keyboard is open
var KeyExists ;

function openPopKeyWindow(url,width,height) {
	l=(screen.availWidth - width)/2;
	KbRef = window.open(url,'KeyBoard','top=0, left='+l+',width='+width+',height='+height)
}

function CheckVrtKB(Name) {
	if (KeyExists) {
		OpenPopKey(Name)
	}
}

function KeyClose() {
	if (KeyExists && !KbRef.closed) {
		KbRef.DoUnload = false;
		KbRef.close();
	}
	return 1;
}




function sendcomment(URL, newName, newFeatures, orgName) {
 var remote = open(URL, newName, newFeatures);
  if (remote.opener == null)
    remote.opener = window;
  remote.opener.name = orgName;
  return remote;
}


function openSender(URL) {
	Popup = sendcomment(URL, 'replyTalkBack', 'dependent=0,height=490,width=530,screenX=0,left=0,screenY=0,top=0,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0', 'launcher');
}

function openWin(Url, Title,iwidth, iheight){
	window.open(Url, Title, 'width='+iwidth+',height='+iheight+',titlebar=no,resizable=yes,menubar=no,toolbar=no,scrollbars=no ');
}


function DisplayFlash(adname, width, height,IsTrans,style){

		if(style==undefined)
			style = '';

		if (IsTrans == 0) {
	        transparent = 'transparent';
        } else {
        	transparent = '';
        }

		document.write("<OBJECT "+style+" CLASSID='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' ID='"+adname+"_66' WIDTH='"+width+"' HEIGHT='"+height+"'>\n");
		document.write("<PARAM NAME='movie' VALUE='"+adname+"'>");
		document.write("<PARAM NAME=play VALUE=true>");
		document.write("<PARAM NAME=loop VALUE=true>");
		document.write("<PARAM NAME=menu VALUE=false>");
		document.write("<PARAM NAME=wmode VALUE="+transparent+">");
		document.write("<PARAM NAME=quality VALUE=high>");
		document.write("<EMBED wMode='transparent' SRC='"+adname+"' id='"+adname+"_60' type=application/x-shockwave-flash  SWLiveConnect=TRUE play=true loop=false menu=false  WIDTH='"+width+"' HEIGHT='"+height+"' quality=best bgcolor=#ffffff loop=true pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED></OBJECT>");
}

function DisplayMediaSound(adname, width, height){
	var phpads_activex = "<OBJECT ID=MediaPlayer CLASSID='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6' STANDBY='Loading MicroSoft Windows Media Player components...' TYPE='application/x-oleobject' WIDTH='" + width + "' HEIGHT='" + height + "'><PARAM name='url' value='" + adname + "'><PARAM NAME='animationatStart' VALUE='true'><PARAM NAME='transparentatStart' VALUE='true'><PARAM NAME='autoStart' VALUE='false'><PARAM NAME='showControls' VALUE='false'><PARAM NAME='ShowDisplay' VALUE='true'><EMBED TYPE='application/x-oleobject' src='" + adname + "' NAME='MediaPlayer' CONTROLS='false' HEIGHT='" + height + "'  WIDTH='" + width + "' AUTOSTART='false'></EMBED></OBJECT>";
	document.write(phpads_activex)
}


function DisplayIFrame(adname, width, height,scrolling,IsTrans,style){

		if(style==undefined)
			style = '';

		if (IsTrans == 0) {
	        transparent = 'true';
        } else {
        	transparent = 'false';
        }

		if (scrolling == 0) {
	        scrolling = 'yes';
        } else {
        	scrolling = 'no';
        }

	var phpads_activex = "<iframe "+style+" src="+adname+" frameborder=no  marginheight=0 marginwidth=0  vspace=0 hspace=0 scrolling="+scrolling+" width="+width+" height="+height+" allowtransparency="+transparent+"></iframe>";
	document.write(phpads_activex)
}


function display_image(url,iwidth, iheight){
 window.open(url,'','width='+iwidth+',height='+iheight+',titlebar=no,resizable=yes,menubar=no,toolbar=no,scrollbars=yes ');
 }
