// CHECK CLIENT BROWSER & PLATFORM
// original code from http://developer.apple.com/internet/_javascript/
//
// USAGE:	browserNaming();
// NOTES:	call it from within an external JS document
// RESULT:	browserNew = true/false
//			browserName = IE/NS/Opera
//			browserNameLong = IE5/etc
//			Macintosh = true/false
// WORKS:	everything

	var its;
	var browserName;
	var browserNameLong;
	var browserNew;
	var preloadFlag = false;
	var Macintosh = navigator.userAgent.indexOf('Mac')>0;

	function its() {
		var n = navigator;
		var ua = ' ' + n.userAgent.toLowerCase();
		var pl = n.platform.toLowerCase();
		var an = n.appName.toLowerCase();

		// browser version
		this.version = n.appVersion;
		this.nn = ua.indexOf('mozilla') > 0;

		// 'compatible' versions of mozilla aren't navigator
		if(ua.indexOf('compatible') > 0) {
			this.nn = false;
		}
		
		this.opera = ua.indexOf('opera') > 0;
		this.ie = ua.indexOf('msie') > 0;
		this.major = parseInt( this.version );
		this.minor = parseFloat( this.version );

		// platform
		this.mac = ua.indexOf('mac') > 0;
		this.win = ua.indexOf('win') > 0;

		// workaround for IE5 which reports itself as version 4.0
		if(this.ie) {
			if(ua.indexOf("msie 5") > 1) {
			var msieIndex = navigator.appVersion.indexOf("MSIE") + 5;
			this.major = parseFloat(navigator.appVersion.substr(msieIndex,3));
			}
		}

		return this;
	}

	function browserNaming() {
		its = new its();
		
		// is it a DOM-enabled browser?
		if (!document.getElementById) {
			browserNew = false;
		}
		else {
			browserNew = true;
		}

		// need the name, too
		if (its.opera) {
			browserName = "Opera";
		}
		else if (its.ie) {
			browserName = "IE";
		}
		else {
			browserName = "NS";
		}

		// and the number
		browserNameLong = browserName + its.major;
	
	}
	
	// DYNAMICALLY UPDATES THE CONTENTS OF A DIV
// USAGE:	writeNewDiv('thisdiv');
//			replace 'newCnt' with the new contents of the div
// WORKS:	ie4+, ns4+

	var newCnt = '<div style="position: absolute;" dir="rtl">&nbsp;</div>';
	var theDelay = true;
	
	function swap(id){
	if (id==1){newCnt = '<div class="about" style="position: absolute;" dir="rtl"><span class="about">נאורה שם שאול היא בונת אתרים ומרצה באוניברסיטת תל-אביב בנושאי תרבות הרשת. ספרה "רומן דיגיטלי" יצא לאור בהוצאת הקיבוץ המאוחד ב- 1993 והיא ארגנה את כנס ההאקרים הראשון בישראל לפני שנתיים.</span></div>';}
	if (id==2){newCnt = '<div class="about" style="position: absolute;" dir="rtl">דביר וולק הוא העורך הראשי של פורטל נענע, ומריץ את פרויקט מנוע החיפוש העצמאי בוקה.</div>';}
	if (id==3){newCnt = '<div class="about" style="position: absolute;" dir="rtl">יועץ בתחום עיצוב אינטראקטיבי וניהול מוצר, ובעל הטור דו"ח אמין" במגזין דה מרקר.</div>';}
	if (id==4){newCnt = '<div class="about" style="position: absolute;" dir="rtl">ריקי כהן היא עיתונאית, עורכת ומנהלת קהילות באתר YNET.</div>';}
	if (id==5){newCnt = '<div class="about" style="position: absolute;" dir="rtl">נורית גזית ניהלה את קהילות IOL. כיום מפתחת שירותים אינטראקטיבים לסלולר.</div>';}
	if (id==6){newCnt = '<div class="about" style="position: absolute;" dir="rtl">שירלי היא מייסדת אתר בננות.קום</div>';}
	if (id==7){newCnt = '<div class="about" style="position: absolute;" dir="rtl">גיל רימון הוא עיתונאי ותסריטאי </div>';}
	if (id==8){newCnt = '<div class="about" style="position: absolute;" dir="rtl">איתי בנר ערך את אינדקס IOL וניהל את צוות התוכן. כיום עורך בפורטל נענע וכותב במוסף "קפטן אינטרנט" של "הארץ".</div>';}
	if (id==9){newCnt = '<div class="about" style="position: absolute;" dir="rtl">עזי ברק הוא פרופסור לפסיכולוגיה באוניברסיטת חיפה. חוקר ומלמד היבטים ויישומים פסיכולוגיים של האינטרנט. חבר הנהלת עמותת אשנ"ב ויו"ר מיט"ל ("מרכז ידע בין-מוסדי לסיוע בטכנולוגיות למידה").</div>';}
	if (id==10){newCnt = '<div class="about" style="position: absolute;" dir="rtl">דן יכין היה עורך "תרבות דיגיטלית" (גלובס)</div>';}
	if (id==11){newCnt = '<div class="about" style="position: absolute;" dir="rtl">דובי קננגיסר הוא עורך כתב העת המקוון "האייל הקורא" וסטודנט לתקשורת ומדע המדינה באוניברסיטה העברית.</div>';}
	if (id==12){newCnt = '<div class="about" style="position: absolute;" dir="rtl">שולי גילוץ היא בוגרת תואר שני בתכנית ה-HCI המפורסמת של אוניברסיטת סטנפורד, בפאלו-אלטו, קליפורניה, ועובדת כמומחית חווית משתמש בנילסן-נורמן גרופ.</div>';}
	if (id==13){newCnt = '<div class="about" style="position: absolute;" dir="rtl">גדי שמשון הקים את מגזין מוניטור, ואחר כך שימש כעורך הראשי של פורטלי ווואלה! ונענע, בימים שהאינטרנט הישראלי עוד היה אליטיסטי</div>';}
	if (id==14){newCnt = '<div class="about" style="position: absolute;" dir="rtl">דרור פויר, בעבר עורך קפטן אינטרנט, כיום בעל טור ב-themarker.com. בין לבין הספיק לעבוד בשני סטארטאפים שנסגרו.</div>';}
	if (id==15){newCnt = '<div class="about" style="position: absolute;" dir="rtl">יוני שדמי הוא עיתונאי. כתב בזומביט ובכגלובס, היה עורך ההי-טק של פורטל נענע, וכתב את מדור עכברשת ב"עכבר העיר". </div>';}
	if (id==16){newCnt = '<div class="about" style="position: absolute;" dir="rtl">אורי ברוכין, הוא מהאנשים שמאחורי האתר הזה ואף כותב מדי שבוע את הניוזלטר של קונספציה - הקולקטיב. ניהל את תחום פיתוח התוכן האינטראקטיבי ביואל, אותה עזב, לפני המיזוג, לטובת עבודה בחברה לייעוץ אסטרטגי בלונדון.</div>';}
	if (id==17){newCnt = '<div class="about" style="position: absolute;" dir="rtl">ירדן לוינסקי , ממייסדי אתר קונספציה, היה מנהל מו"פ בחברת  IOL. היום הוא ארכיטקט מידע ראשי ומנהל פיתוח בחברת  Zoe Interactive. </div>';}
	if (id==18){newCnt = '<div class="about" style="position: absolute;" dir="rtl">גל מור הוא עיתונאי</div>';}
	if (id==0){newCnt = '<div class="about" style="position: absolute;" dir="rtl">&nbsp;</div>';}
	writeNewDiv('infopop');
	}
	
	function swapname(id){
	if (id==1){newCnt = '<div class="author" style="position: absolute;" dir="rtl"><span class="author">נאורה שם שאול</span></div>';}
	if (id==2){newCnt = '<div class="author" style="position: absolute;" dir="rtl">דביר וולק</div>';}
	if (id==3){newCnt = '<div class="author" style="position: absolute;" dir="rtl">עידו אמין</div>';}
	if (id==4){newCnt = '<div class="author" style="position: absolute;" dir="rtl">ריקי כהן</div>';}
	if (id==5){newCnt = '<div class="author" style="position: absolute;" dir="rtl">נורית גזית</div>';}
	if (id==6){newCnt = '<div class="author" style="position: absolute;" dir="rtl">שירלי צלצינסקי</div>';}
	if (id==7){newCnt = '<div class="author" style="position: absolute;" dir="rtl">גיל רימון</div>';}
	if (id==8){newCnt = '<div class="author" style="position: absolute;" dir="rtl">איתי בנר</div>';}
	if (id==9){newCnt = '<div class="author" style="position: absolute;" dir="rtl">עזי ברק</div>';}
	if (id==10){newCnt = '<div class="author" style="position: absolute;" dir="rtl">דן יכין</div>';}
	if (id==11){newCnt = '<div class="author" style="position: absolute;" dir="rtl">דובי קננגיסר</div>';}
	if (id==12){newCnt = '<div class="author" style="position: absolute;" dir="rtl">שולי גילוץ</div>';}
	if (id==13){newCnt = '<div class="author" style="position: absolute;" dir="rtl">גדי שמשון</div>';}
	if (id==14){newCnt = '<div class="author" style="position: absolute;" dir="rtl">דרור פויר</div>';}
	if (id==15){newCnt = '<div class="author" style="position: absolute;" dir="rtl">יוני שדמי</div>';}
	if (id==16){newCnt = '<div class="author" style="position: absolute;" dir="rtl">אורי ברוכין</div>';}
	if (id==17){newCnt = '<div class="author" style="position: absolute;" dir="rtl">ירדן לוינסקי</div>';}
	if (id==18){newCnt = '<div class="author" style="position: absolute;" dir="rtl">גל מור</div>';}
	if (id==0){newCnt = '<div class="author" style="position: absolute;" dir="rtl">&nbsp;</div>';}
	writeNewDiv('namepop');
	}
	
	function writeNewDiv(id) {
		if (browserNew) {
			document.getElementById(id).innerHTML=newCnt;
		}
		else {
			if (browserName == "NS") {
				document.layers[id].document.write(newCnt);
				document.layers[id].document.close();
			}
			else {
			//IE4 crashes if you set the innerhtml without a delay, strange
				if (browserNameLong == "IE4") {
					if (theDelay == true) {
						thisID = id;
						setTimeout("writeNewDiv(thisID);",100);
						theDelay = false;
					}
					else {
						document.all[id].innerHTML=newCnt;
						theDelay = true;
					}
				}
				else {
					document.all[id].innerHTML=newCnt;
				}
			}
		}
	}

	