function OpenWin(action)
{
	var i;
	if(action=="update")
	{
		for(i=0;i<4;i++)
		{
			if(Form1.votegroup[i].checked==true)
			{
				
					window.open("vote.asp?ID="+Form1.votegroup[i].value+"&voteID="+Form1.vote_id.value+"&action=update","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, width=470, height=250");
				return false;
			}
		}
		alert("الرجاء اختيار النتيجة قبل التصويت");
		Form1.reset();
		return false;
	}
	else if(action=="display")
	{
			window.open("vote.asp?voteID="+Form1.vote_id.value+"&action=display","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, width=470, height=250");
		return false;
	}
}

function OpenNews(ID)
{
		window.open("quicknews.asp?ID="+ID+"","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=500, height=300");
}

function OpenSocial(soID)
{
		window.open("social.asp?ID="+soID+"","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, width=430, height=250");
}

function ValidateOpinion()
{
		if(document.Form1.full_name.value=="" || document.Form1.email.value=="" || document.Form1.country.value=="" || document.Form1.c_title.value=="" || document.Form1.comment.value=="")
	{
		alert('الرجاء تعبئة جميع الحقول')
		return false;
	}
	return true;
}

function ValidateOrder()
{
	if(orderForm.full_name.value=="" || orderForm.email.value=="" || orderForm.question.value=="")
	{
		alert('الرجاء ادخال جميع الحقول');
		return false;
	}
	return true;
}

function getDisplayDate(passedDate)
{
    if (iDay< 10) iDay = ("0" + iDay + ", ");
	if (iMonth< 10) IMonth = ("0" + iMonth + ", ");

	var calendar = new Date(passedDate);
	var iMonth = calendar.getMonth();
	var iDate = calendar.getDate();
	var iYear = calendar.getYear();
	if (iYear < 1000)
	      iYear += 1900;
	var cent = parseInt(iYear/100);
	var g = iYear % 19;
	var k = parseInt((cent - 17)/25);
	var i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19 * g + 15) % 30;
	      i -= parseInt(i/28) * (1 - parseInt(i/28) * parseInt(29/(i+1)) * parseInt((21-g)/11));
	var j = (IYear + parseInt(iYear/4) + i + 2 - cent + parseInt(cent/4)) % 7;
	var l = i - j;
	var emonth = 3 + parseInt((l + 40)/44);
	var edate = l + 28 - 31 * parseInt((emonth/4));
	      emonth--;
	if (iMonth< 10)
	     iMonth = ("0" + iMonth + ", "); // if you want leading zero on month
	if (iDate< 10) 
	    iDate = ("0" + iDate + "/"); // if you want leading zero on date
	    
	DateTemp = IMonth + IDate + IYear;
	
	return DateTemp ;
}