var mailto ="m"+"a"+"i"+"l"+"t"+"o"+":";
var strudle = "@";
var gmail = strudle + "gmail" + "." + "com";
var zephyrmail = strudle + "zephyrww" + "." + "co.il";
function sendM(){
   location = mailto + "studio" + zephyrmail + "?subject=From [Please add your name here]&body=Just to know that you are flesh and blood and not a robot, would you kindly add your name to the subject line. Thanks! Michal";
}

function senToGM(someone) {
	location = mailto + someone + gmail;
}


function show(s_id, display) {
	if( typeof(display) == 'undefined') {
		display = 'block'
	}
	document.getElementById(s_id).style.display = display;
}

function hide(s_id) {
	if (!document.getElementById(s_id)) {
		return false;
	}
	document.getElementById(s_id).style.display = 'none';
}

function toggleContent(current) {
	var currentContent = "egg" + current;
	for(i=1;i<=4;i++)
		document.getElementById("egg" + i).style.display = "none";
	document.getElementById(currentContent).style.display = "block";
	var currentLi = "li" + current;
	for(i=1;i<=4;i++)
		document.getElementById("li" + i).className = "";
	document.getElementById(currentLi).className = "currentLi";
}


function slideOpen (sId, finalHeight) {
	var slidingElement = document.getElementById(sId);
	slidingElement.style.height = '1px';
	var actualHeight = 2;
	show (sId);
	var slideInt = setInterval(function () {
		while (actualHeight < finalHeight ) {
			slidingElement.style.height = actualHeight + 'px';
			actualHeight++;
		}
		clearInterval(slideInt);
	}, 500);
}

function slideClose (sId) {
	var slidingElement = document.getElementById(sId);
	var actualHeight = slidingElement.offsetHeight;
	var slideCloseInt = setInterval(function () {
		while (actualHeight >= 1 ) {
			slidingElement.style.height = actualHeight + 'px';
			actualHeight--;
		}
		hide (sId);
		clearInterval(slideCloseInt);
	}, 500);
}


function detectIe6 () {

	if (navigator.appVersion.indexOf('MSIE 6.0') > -1 && navigator.appVersion.indexOf('MSIE 7.0') < 0) {
		if(document.getElementById('ie6Detector')) {
			ie6Text = '<p><strong>הדפדפן שלך ישן ומוגבל. לא חבל?</strong> מיקרוסופט כבר הוציאה שתי (!) גרסאות יותר חדשות עבורו</p>\n<p>למה לא לשדרג? זה בחינם! אולי אפילו כדאי לך להתקין FIREFOX</p>\n<p><a href="http://www.mozilla-europe.org/en/products/firefox/" target="_blank">להתקנת <strong>Firefox</strong></a> | <a href="http://www.microsoft.com/windows/products/winfamily/ie/default.mspx" target="_blank">להתקנת הגרסה האחרונה של דפדפן אכספלורר של מיקרוסופט</a> | <a href="http://www.uweb.ucsb.edu/~mguidry/firefox/" target="_blank"><strong>מה כדאי לי</strong></a></p>\n<p class="button" onclick ="slideClose(\'ie6Detector\');">עזוב, אחשוב על זה אחר כך (סגור)</p>';
			/*ie6Text = '<p><strong>Your Internet is not up to date</strong>.  This is not the last version of Microsoft Internet Explorer</p>\n<p>You can enjoy your web surfing much more bu upgrading your browser, and it is even free!</p>\n<p><a href="http://www.mozilla-europe.org/en/products/firefox/" target="_blank">Install <strong>Firefox</strong></a> | <a href="http://www.microsoft.com/windows/products/winfamily/ie/default.mspx" target="_blank">Upgrade your Microsoft Internet Explorer</a> | <a href="http://www.uweb.ucsb.edu/~mguidry/firefox/" target="_blank"><strong>what\'s best for me?</strong></a></p>\n<p class="button" onclick ="slideClose(\'ie6Detector\');">Later. Now, please go away.</p>';*/
			document.getElementById('ie6Detector').innerHTML = ie6Text;
			slideOpen('ie6Detector', 65);
		}
		var images = document.getElementsByTagName('img');
		for (var i=0;i < images.length;i++) {
			images[i].src = images[i].src.replace(/png/i,'gif');
		}
	}
}

window.onload = function() {
	detectIe6();
	if (document.getElementById('vmarquee')) {
		initializemarquee();
	}
}
