//פתיחת קישורים בחלון חדש לפי התקן המחמיר ביותר
function inNewWin(obj){
	window.open(obj);
	return false;
}

//בדיקה שהוקלדה המלצה לפני השליחה
function addRec(obj){
	if (obj.rec.value=="" || obj.rec.value=="רשום כאן המלצה שתתפרסם בעמוד הראשי" || obj.rec.value=="רשמי כאן המלצה שתתפרסם בעמוד הראשי"){
		alert("לא הזנת המלצה לשליחה")
		return false;
	}
}

//פתיחה וסגירה של תיבת אזכור סיסמא בתפריט הימני
function rePass(i){
	if (document.getElementById("rePassDiv").style.display=='none' || document.getElementById("rePassDiv").style.display==''){
		document.getElementById("rePassDiv").style.display='block';
	}else{
		document.getElementById("rePassDiv").style.display='none';
	}
}

//פתיחת חלון שליחה המונית
function sendMsgFull(){
	window.open ("sendMsgFull.asp", "","width=500,height=480");
}
//פתיחת באנר פרסום ניסימדיה
function nisimedia(){
	window.open ("http://www.nisimedia.co.il/tadmit/", "","width=700,height=600");
}
//פתיחת דף מזל טוב ביום הולדת
function birthday(){
	window.open ("birthday.asp?id=1", "","width=640,height=480");
}
//פתיחת דף מנוי במבצע
function weekend(id){
	window.open ("weekend.asp?id="+id, "","width=593,height=503");
}


//בדיקת הזנת שם משתמש וסיסמא לטופס ההתחברות
function checkLogIn(obj){
	if (obj.email.value==""){
		alert("יש למלא כתובת אי מייל");
		obj.email.focus();
		return false;
	}

	if (obj.pass.value==""){
		alert("יש למלא סיסמא");
		obj.pass.focus();
		return false;
	}
}

//בדיקה שאכן הזינו מספר באיתור חבר
function checkId(obj){
	if (obj.id.value=="" || isNaN(obj.id.value)){
		alert("יש למלא מספר כרטיס תקני");
		obj.id.focus();
		return false;
	}
}

//בדיקה שאכן הזינו מייל תקני בהמלצה לחבר
function checkRec(obj){
	if (obj.emailRec.value!=""){
		var x = obj.emailRec.value;
		var filter	= /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (filter.test(x)==false){
			alert("הכנס כתובת דואר אלקטרוני תיקנית");
			obj.emailRec.focus();
			return false;
		}
	}else{
			alert("הכנס כתובת דואר אלקטרוני תיקנית");
			obj.emailRec.focus();
			return false;
	}
}

//כפתור לייק על זיגוטה בכל דף תוכן
function facebookLike(id){
	var flagHebrew=false;
	var thisPage='';

	thisPage=window.location.href;
	thisPage=decodeURI(thisPage);

	for (i=0; i<thisPage.length; i++){
		if ((thisPage.charAt(i)<="ת" && thisPage.charAt(i)>="א")){
			flagHebrew=true;
		}
	}

	if (flagHebrew || id=="0"){
		thisPage='http://www.sexcafe.co.il/';
	}

	document.write('<iframe src="http://www.facebook.com/plugins/like.php?href='+thisPage+'&amp;layout=standard&amp;show_faces=false&amp;width=290&amp;action=like&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:290px; height:35px;" allowTransparency="true"></iframe>');
}



//כפתור שיתוף בפייסבוק בכל דף תוכן
function facebookShare(){
	var flagHebrew=false;
	var thisPage='';

	thisPage=window.location.href;
	thisPage=decodeURI(thisPage);

	for (i=0; i<thisPage.length; i++){
		if ((thisPage.charAt(i)<="ת" && thisPage.charAt(i)>="א")){
			flagHebrew=true;
		}
	}

	if (flagHebrew){
		thisPage='http://www.sexcafe.co.il/';
	}

	window.open ("http://www.facebook.com/sharer.php?u="+thisPage, "","width=570,height=350");
}
