
function showBan(divName,width,height,wmode,src,spec,xparams)
{
	var d=document.getElementById(divName);
	d.innerHTML='<OBJECT '+spec+' classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0	 WIDTH='+width+' HEIGHT='+height+'><PARAM NAME=movie VALUE="'+src+'"><PARAM NAME=wmode value='+wmode+'><PARAM NAME=quality VALUE=high><PARAM NAME=AllowScriptAccess VALUE=always>'+xparams+'<EMBED src="'+src+'" quality=high WIDTH='+width+' HEIGHT='+height+' WMODE='+wmode+' AllowScriptAccess=always TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash  type=application/x-shockwave-flash></EMBED></OBJECT>';
}

function changecolor(id,onw){
	if(onw == 0){
		document.getElementById(id).style.background = "#C6ED80";
	}else if(onw == 1){
		document.getElementById(id).style.background = "#F2F7E9";
	}
}
function DoHideAIFRAME(id) {
	document.getElementById(id).style.display = 'none';
}


function openAd(){
	 obj1 = document.getElementById ("i100");
	obj2 = document.getElementById ("bigFlash");
	obj1.style.display = 'none';
	obj2.style.display = "";
}
function closeAd(){
	obj1 = document.getElementById ("i100");
	obj2 = document.getElementById ("bigFlash");
	obj3 = document.getElementById ("bigbannerpopup");
	obj1.style.display = "";
	obj2.style.display = 'none';
	obj3.style.display = 'none';
	
	var hideFlash=false;
}
function closeAda(){
	obj1 = document.getElementById ("bigbannerpopupShade");
	obj2 = document.getElementById ("bigbannerpopup");
	obj1.style.display = 'none';
	obj2.style.display = 'none';
}
function closeDAd(a,b) {
	
	if (a == "leshonit120") {
		
	obj = document.getElementById ("BANdiv11");
	obj.style.display = 'none';
	
		
	}
	
	if (b == "leshonit120") {

	obj = document.getElementById ("BANdiv11");
	obj.style.display = "";

	}
	
tmpWindow = document.getElementById(b);
tmpWindow.style.display = "inline";

tmpWindow = document.getElementById(a);
tmpWindow.style.display = "none";
}

var hideFlash=true;


function getW(){
  if(document.body.clientWidth>=958){

obj = document.getElementById ("bigFlash");

if (obj.style.display == "none") {

	var hideFlash=false;

} else {

	var hideFlash=true;

}
  	
    if(hideFlash==false){

        document.getElementById("i100").style.display="inline";
        
    }
  } else {
      document.getElementById("i100").style.display="none";
  }
  
b = setTimeout("getW()",0);
}

function DisplayAD(){
	obj3 = document.getElementById ("bigbannerpopup");
	obj3.style.display = 'block';
	if(document.body.clientWidth <= 1005){
		var dcOzen = document.getElementById("left.big.banner");
		dcOzen.style.display = "none";
		dcHidden = true;
	}
	else if(document.body.clientWidth > 1005)
	{
		var dcOzen = document.getElementById("left.big.banner");
		dcOzen.style.display = "block";
		dcHidden = false;
	}
}

function dcOnResizes(){
	if(!dcHidden && document.body.clientWidth <= 1005){
		dcHidden = true;
		var dcOzen = document.getElementById("left.big.banner");
		dcOzen.style.display = "none";
	}
	else if(dcHidden && document.body.clientWidth > 1005)
	{
		dcHidden = false;
		var dcOzen = document.getElementById("left.big.banner");
		dcOzen.style.display = "inline";
	}
}

function getWidth(){
	
  if(document.body.clientWidth>=958){
        document.getElementById("i100").style.display="inline";


  } else {
      document.getElementById("i100").style.display="none";
  }

}


function getWidthGlobal(){
  if(document.body.clientWidth>=958){

		document.getElementById("i100").style.display="inline";

  } else {
		document.getElementById("i100").style.display="none";
  }
  
b = setTimeout("getWidthGlobal()",0);
}



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,'ZoomPic','menubar=no,resizable=yes,scrollbars=yes,width=640,height=550');
}


function openFlash(my_var,width,height) {

	window.open(my_var,'NewsFlash','menubar=no,resizable=no,scrollbars=yes,width='+width+',height='+height);
}


function openTerms(my_var,width,height) {

	window.open(my_var,'Terms','menubar=no,resizable=no,scrollbars=yes,width='+width+',height='+height);
}
 
 
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;
} 

function ValidateForm_Forums()
{
		if (document.frmAddTalkBackForums.sender.value.length<2){alert("errors")}

		return false;
}


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 setToHomePage(obj)
{
    obj.style.behavior='url(#default#homepage)';
    obj.setHomePage('http://www.samsem.net');
}
                                    
// This functions retrieve the Virtual Keyoard
function OpenPopKey (theInputName) {
	document.getElementById('inputName').value=theInputName;
	openPopKeyWindow('includes/key.htm',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) {
	KbRef = window.open(url,'PopKey','toolbar=no,location=no,directories=no,top=0, left=440,status=yes,menubar=no,scrollbars=no,movable=yes,resizable=no,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, 'replyComment', '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 openSender_Forums(URL) {
  Popup = sendcomment(URL, 'replyComment', 'dependent=0,height=385,width=600,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 allComments(id) {
	
URL = '?path=article&sec=comments&op=allComments&id='+id;

w=465;h=465;l=(screen.availWidth - w)/2;t=(screen.availHeight - h)/2;

Features = 'width='+w+',height='+h+',left='+l+',top='+t+',scrollbars=yes';

var x = window.open(URL,'ShowComments',Features)

}

function allCommentsPlus(id) {
	
URL = '?path=Plus&sec=comments&op=allComments&id='+id;

w=465;h=465;l=(screen.availWidth - w)/2;t=(screen.availHeight - h)/2;

Features = 'width='+w+',height='+h+',left='+l+',top='+t+',scrollbars=yes';

var x = window.open(URL,'ShowCommentsPlus',Features)

}


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 = ''	
			
		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)

}
