var ajaxImgLoading = '
';
function check_dist(){
if (document.form_with_country.country_id.value == '0'){
alert('من فضلك اختر البلد');
document.form_with_country.country_id.focus();
return false;
}else if(document.form_with_country.city_id.value == 'no_select') {
alert('من فضلك اختر المدينة.');
document.form_with_country.city_id.focus();
return false;
}
}
function openIT(u,W,H,X,Y,n,b,x,m,r) {
var cU ='images/close.gif'
var cO ='images/close.gif'
var cL ='images/clock.gif'
var mU ='images/minimize.gif'
var mO ='images/minimize.gif'
var xU ='images/max.gif'
var xO ='images/max.gif'
var rU ='images/restore.gif'
var rO ='images/restore.gif'
var tH =''
var tW ='site'
var wB ='#FFF4F4'
var wBs ='#FFF4F4'
var wBG ='#FFF4F4'
var wBGs='#FFF4F4'
var wNS ='toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0'
var fSO ='scrolling=auto noresize'
var brd =b||5;
var max =x||false;
var min =m||false;
var res =r||false;
var tsz =20;
return chromeless(u,n,W,H,X,Y,cU,cO,cL,mU,mO,xU,xO,rU,rO,tH,tW,wB,wBs,wBG,wBGs,wNS,fSO,brd,max,min,res,tsz)
}
function updateUserNotification()
{
//var t = setTimeout("alertMsg()", 10000);
}
function getCities(countryID, city_id)
{
var loadCity = $("#loadCity");
$.ajax({
type: "GET",
url: "etc.php",
data: "action=getCities&get_country_id=" + countryID + '&city_id=' + city_id,
beforeSend: function()
{
$('#' + countryID).attr('disabled', 'disabled');
loadCity.html('تحميل المدن...');
},
success: function(data, textStatus)
{
loadCity.html(data);
} //End Success
});
}
function alertMsg()
{
/*var msgs = $("#homePageNewMsgs").text();
$.ajax({
type: "GET",
url: "alertNewMsg.php",
data: "",
async: false,
success: function(data, textStatus)
{
var sp = data.split('|');
var newMsgs = sp[0];
var viewNotf = sp[1];
//View Notification Message
if ( newMsgs != 0 && newMsgs > msgs && viewNotf == 1 )
{
$(".notificationSection").html('
لديك ' + newMsgs + ' رسالة جديدة غير مقروءة
'); $(".notificationSection").show(); } $("#homePageNewMsgs").html(newMsgs); } }); updateUserNotification(); */ } function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } function reportBadProfile(uID) { if ( reason = prompt("الرجاء إدخال سبب الإبلاغ") ) { if ( reason.length >= 1 ) { $.ajax({ type: "GET", url: "etc.php", data: "action=reportBadProfile&uID=" + uID + "&reason=" + reason , async: false, beforeSend: function() { $("#topLoading").show(); }, success: function(data, textStatus) { alert('تم الإبلاغ عن الملف بنجاح! ستقوم إدارة الموقع باتخاذ الاجراءات اللازمة'); $("#topLoading").hide(); } }); } } } function sendMsg(send, send_user_id, full_name, hash_1, hash_2) { $.ajax({ type: "POST", url: "send_msg.php", data: 'send=' + send + '&send_user_id=' + send_user_id + '&full_name=' + full_name + '&hash_1=' + hash_1 + '&hash_2=' + hash_2 + '&message_body=' + $("#msgBody").val(), async: false, beforeSend: function() { $("#topLoading").show(); }, success: function(data, textStatus) { var sp = data.split('|'); var st = sp[0]; var msg = sp[1]; if (st == 0) { alert(msg); $("#message_body").focus(); window.location.hash = '#'; } else if (st == 1) { $("#msgContainer").html('
تم إرسال رسالتك بنجاح!
'); window.location.hash = '#'; } $("#topLoading").hide(); } }); } function ajaxFields(ArrData) { var qs = ''; if (ArrData != '') { var Arr = ArrData; for( var i = 0; i < Arr.length; i++ ) { var setAnd = (Arr.length != (i + 1))?'&':''; var qs = qs + Arr[i] + '=' + $("#" + Arr[i]).val() + setAnd; } } return qs; } function registerUser() { var full_name = document.getElementById("full_name"); var gender = document.getElementById("regGender"); var state_id = document.getElementById("regStateID"); var year = document.getElementById("year"); var country_id = document.getElementById("country_id"); var city_id = document.getElementById("city_id"); var nationality_id = document.getElementById("regNat"); var user_name = document.getElementById("reg_user_name"); var password = document.getElementById("reg_password"); var email = document.getElementById("email"); var about_your_self = document.getElementById("about_your_self"); var about_your_wife = document.getElementById("about_your_wife"); var misyar = $('input[name=misyar]:checked', '#form_with_country').val(); var multi = $('input[name=multi]:checked', '#form_with_country').val(); // var aff = document.getElementById("aff"); var regBtnStatus = $("#regBtnStatus"); var register_send = $("#register_send"); var captcha = $("#captcha"); var terms = document.getElementById("terms").checked; var privacy = document.getElementById("privacy").checked; if (terms == false) { alert('يجب عليك الموافقة على شروط الموقع قبل التسجيل!'); return false; } else if (privacy == false) { alert('يجب عليك الموافقة على سياسة الخصوصية قبل التسجيل!'); return false; } else if ( full_name.value.length < 1 ) { alert('من فضلك أدخل اسمك المستعار.'); full_name.focus(); return false; } //Err else if (gender.value == 'no_select') { alert('من فضلك اختر جنسك'); gender.focus(); return false; } else if (gender.value == 'F' && misyar == 'undefined') { alert('الرجاء تحديد هل ترغبين بالمسيار أو لا'); misyar.focus(); return false; } else if (gender.value == 'F' && multi == 'undefined') { alert('الرجاء تحديد هل ترغبين بالتعدد أو لا'); multi.focus(); return false; } else if (state_id.value == 'no_select') { alert('من فضلك اختر حالتك الاجتماعية'); state_id.focus(); return false; } else if (gender.value == 'F' && state_id.value == '3') { alert('لا يمكن التسجيل كامرأة متزوجة!'); state_id.focus(); return false; } else if (gender.value == 'M' && state_id.value == '4') { alert('لا يمكن للرجل أن يختر "آنسة" من فضلك حدد حالتك الاجتماعية الصحيحة!'); state_id.focus(); return false; } else if (year.value == 'no_select') { alert('من فضلك اختر عمرك!'); year.focus(); return false; } else if (country_id.value == 'no_select') { alert('من فضلك اختر دولة الإقامة!'); country_id.focus(); return false; } else if ( city_id.value <= 0 ) { alert('من فضلك اختر "مدينة الإقامة".'); city_id.focus(); return false; } else if (nationality_id.value == 'no_select') { alert('من فضلك اختر "الجنسية".'); nationality_id.focus(); return false; } else if (user_name.value.length < 4 || user_name.value.length > 20){ alert('من فضلك أدخل اسم المستخدم.\n اسم المستخدم يجب أن لا يقل على 4 أحرف كحد أدنى و 20 حرفاً كحد أقصى.'); user_name.focus(); return false; } else if (password.value.length < 4 || password.value.length > 20){ alert('خطأ في كلمة المرور.\n كلمة المرور يجب أن لا تقل عن 4 أحرف كحد أدنى و 20 حرفاً كحد أقصى.'); password.focus(); return false; }else if ( email.value == "" ){ alert('البريد الإلكتروني فارغ!'); email.focus(); return false; }else if ( about_your_self.value.length < 10 ){ alert('يجب أن تكتب بيانات عن نفسك وأن لا تقل عن 10 أحرف وأن لا تزيد على 500 حرف في الحقل تكلم عن نفسك.'); about_your_self.focus(); return false; }else if ( about_your_self.value.length > 500 ){ alert('أقصى أحرف في الحقل تكلم عن نفسك هو 500 حرف'); about_your_self.focus(); return false; }else if ( about_your_wife.value.length < 10 ){ alert('يجب أن تكتب بيانات عن شريك حياتك وأن لا تقل عن 10 أحرف وأن لا تزيد على 500 حرف في الحقل تكلم عن شريك حياتك.'); about_your_wife.focus(); return false; }else if ( about_your_wife.value.length > 500 ){ alert('أقصى أحرف في الحقل تكلم عن شريك حياتك هو 500 حرف'); about_your_wife.focus(); return false; } else { //var regDataAff = (aff.value == '1')?'&aff=1':''; var regDataAff = '&aff=0'; var regData = ajaxFields(new Array('captcha', 'full_name', 'regGender', 'regStateID', 'day', 'month', 'year', 'country_id', 'regNat', 'reg_user_name', 'reg_password', 'email', 'mobile_no', 'about_your_self', 'about_your_wife')) + '&multi=' + multi + '&misyar=' + misyar + '&city_id=' + city_id.value + '®ister=1' + regDataAff + '&captcha=' + captcha.val(); $.ajax({ type: "POST", url: "register.php", data: regData, async: false, beforeSend: function() { window.location.hash = '#'; register_send.hide(); regBtnStatus.html('تجري عملية التسجيل...'); $('#regForm').animate({ opacity: 0.5 }, 100); $("#topLoading").show(); }, success: function(data, textStatus) { var sp = data.split('|'); var st = sp[0]; var msg = sp[1]; if (st == 0) { alert(msg); register_send.show(); regBtnStatus.html(''); captcha.val(''); $("#captchaImg").attr('src', 'libs/captcha/securimage_show.php?d=' + Math.random()); } else if (st == 1) { $("#regForm").html('
تمّت عملية التسجيل بنجاح!
يجري الآن نقلك إلى صفحة حسابك