// Old script
<!-- Begin

function OpenVoteUrl(url, type)
{

	if (type == 0)
	{
		if (document.all.Answer.value > 0) 	// Anser is run time control
		{
		
			url = url + "&voteSelect=" + document.all.Answer.value;
			var coll = document.all.item("voteSelect");
			if (coll)
			{
				for (var i=0; i<coll.length; i++)
				{
					coll(i).checked = false;
					coll(i).disabled = true;
				}
			}
			//var votePartLink = document.all.item("votePart");
			//if (votePartLink)
			//	votePartLink.removeAttribute("href");
			document.all.Answer.value = 0;
			window.open(url,"","height=401,width=500,left=200,top=2,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");	
		
		}
	}
	else
		window.open(url,"","height=401,width=500,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");	
}

// End -->
<!-- for pub up window -->
<!-- Begin
function popUp(URL,w,h,s) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars='+s+',location=0,statusbar=0,menubar=0,resizable=0,width='+w+',height='+h+',left=100,top=10');");
}
// End -->
function FormValidation()
{

if(! isEmail(document.FormEmail.MailList.value))
	{alert("رجاء إدخال بريد إلكتروني صحيح");
	 document.FormEmail.MailList.focus();
	 return false;
	 }
//alert("رجاء إدخال بريد إلكتروني صحيح");
return true;
}

function SearchValidation()
{
Search1=document.form2.Search1.value;
if((Search1==null || Search1==""))
{
	alert("ادخل كلمة للبحث");
	document.form2.Search1.focus();
	return false;
}

return true;

}

function PostSearchItems(Page,SearchType)
{
    document.formSearch2.action = "Search.asp?"+Page+"&"+"SearchType="+SearchType
    document.formSearch2.method = "post"
    document.formSearch2.submit()
}

var whitespace = " \t\n\r";

function isWhitespace (s)
	{
	  var i;
 	   for (i = 0; i < s.length; i++)
 	   {

 	       var c = s.charAt(i);

 	       if (whitespace.indexOf(c) == -1) return false;
 	   }


	    return true;
	}



function isEmail(s)
           { 
                if (isWhitespace(s)) return false;
           var i = 1;
           var sLength = s.length;


           while ((i < sLength) && (s.charAt(i) != "@"))
           { i++
           }
           if ((i >= sLength) || (s.charAt(i) != "@")) return false;
           else i += 2;
 
 
           while ((i < sLength) && (s.charAt(i) != "."))
           { i++
           }
 
 
           if ((i >= sLength - 1) || (s.charAt(i) != "."))
                return false

		else
		 return true;

}

/////
function voted()
{
    
        alert("لقد قمت بالتصويت علي هذا الموضوع من قبل"); 
        
        return false;
    }



<!-- Begin

function OpenVoteUrl(url, type)
{

	if (type == 0)
	{
		if (document.all.Answer.value > 0) 	// Anser is run time control
		{
		
			url = url + "&voteSelect=" + document.all.Answer.value;
			var coll = document.all.item("voteSelect");
			if (coll)
			{
				for (var i=0; i<coll.length; i++)
				{
					coll(i).checked = false;
					coll(i).disabled = true;
				}
			}
			//var votePartLink = document.all.item("votePart");
			//if (votePartLink)
			//	votePartLink.removeAttribute("href");
			document.all.Answer.value = 0;
			window.open(url,"","width=590,height=400,left=200,top=2,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");	
		
		}
	}
	else
		window.open(url,"","height=333,width=590,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");	
}

// End -->


function OpenFile(file,win)
{
childWindow=open(file,win,"location=0,width=550,heigh=250,top=75,left=100,scrollbars=yes,status=yes");
if (childWindow.opener == null) childWindow.opener = self;
}

function validate(formCheck) //Function with a parameter representing a form name.
{
    if (formCheck.T1.value =="")
    {
        alert("من فضلك أدخل الاسم"); 
        formCheck.T1.focus();
        return false;
    }
 
var string2=formCheck.T2.value
    if (string2.indexOf("@")==-1)
    {
        alert("من فضلك أدخل بريد صحيح"); 
        formCheck.T2.focus();
        return false;
    }


var string3=formCheck.T3.value
    if (string3.indexOf("@")==-1)
    {
        alert("من فضلك أدخل بريد صحيح"); 
        formCheck.T3.focus();
        return false;
    }
    if (formCheck.s1.value =="")
    {
        alert("من فضلك أدخل نص الرسالة"); 
        formCheck.T4.focus();
        return false;
    }
 

  return true;
}
function fnSave() {
    document.execCommand("SaveAs",null,document.title);
}

