function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
var sitemapArray_old = new Array(
							["content.asp?i=24","vision.asp","news.asp","studioGalleries.asp","bulletinboard.asp","graduatesTalk.asp"],
							["courses.asp","preparatoryProgram.asp","fashion.asp","enriching.asp"],
							["studioGalleries.asp","gallery.asp?section=2","gallery.asp?section=3"],
							["teachers.asp"],
							["whoAmI.asp","whatSuitsMe.asp","whatNext.asp","dictionary.asp"],
							["registration.asp"]);

var sitemapArray = new Array(
                            ["courses.asp","coursesConsult.html","whatNext.asp","dictionary.asp","courses.asp?type=3","gallery.asp?section=3","graduatesTalk.asp","why6b.asp","courses.asp?type=2"],
                            ["content.asp?i=25","workers.asp","gallery.asp?section=2","comments.asp"],
                            ["GraphicDesign.asp","fashion.asp","preparatoryProgram.asp","enriching.asp"],
                            ["content.asp?i=24","studioGalleries.asp","vision.asp","articles.asp","news.asp",""],
                            ["gallery.asp?section=3","gallery.asp?section=8","gallery.asp?section=6","gallery.asp?section=7","gallery.asp?section=2"],
                            ["teachers.asp"]);
                                                      
                            
function navigateFromFlash(str){
	var mainSelect = str.split("~")[0];
	var subSelect = str.split("~")[1];

	window.location.href =  "http://www.6bstudio.co.il/"+sitemapArray[mainSelect][subSelect]
}	


function select_img(image_type, image_id, image_big, image_name){
	var html=null;
	
	if(image_type==1){
		if(image_big.indexOf('.flv')!=-1){
			html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="345" height="345">' +
				'<param name="movie" value="/flash/flvplayer.swf">' +
				'<param name="quality" value="high">' +
				'<param name="flashvars" value="width=345&backcolor=0xffffff&height=345&location=/flash/flvplayer.swf&autostart=false&file=../data/pictures/project/image' + image_id + '/' + image_big + '">';
			'</object>';
		}else{
			html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="345" height="345">' +
				'<param name="movie" value="../data/pictures/project/image' + image_id + '/' + image_big + '">' +
				'<param name="quality" value="high">' +
			'</object>';
		}
	}else
		html='<img src="../data/pictures/project/image' + image_id + '/' + image_big + '"/>'
		
	document.getElementById('project_content').innerHTML=html;
	document.getElementById('image_name').innerHTML=image_name;
		
	return false;
}


function  popWindow(filename, w, h){
	window.open(filename,"_blank","left=50,top=50,chanelmode=no,toolbar=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=" +  w + ",height=" + h) 	
}
function  popWindow_noScrollBars(filename, w, h){
	window.open(filename,"_blank","left=50,top=50,chanelmode=no,toolbar=no,location=no,status=no,menubar=no,resizable=no,scrollbars=no,width=" +  w + ",height=" + h) 	
}

//get X Y position of an obj
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	var pos= new Array();
	pos['left']=curleft;
	pos['top']=curtop;
	
	return pos;
}


function printHeaderLinks(){



	var direction_map_src='open("http://www.6bstudio.co.il/directions.html","location_map","width=640,height=450,top=120,left=200").focus()'
		document.write("<a href='http://www.6bstudio.co.il/interiors' class='regLink2'><b>ידיעון פנים</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/folders' class='regLink2'><b>ידיעון מכינה</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/fashion' class='regLink2'><b>ידיעון אופנה</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/graphic' class='regLink2'><b>ידיעון גרפי</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/openforum' class='regLink2'><b>פורום</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/bulletinboard.asp' class='regLink3'>לוח מודעות</a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/contact.asp' class='regLink2'>צור קשר</a>");
	
//		document.write("<a href='http://www.6bstudio.co.il/students/studentslogin.php' class='regLink2'>מפגשים</a>");


}


function printHeaderLinksIndex(){ 



	var direction_map_src='open("http://www.6bstudio.co.il/directions.html","location_map","width=640,height=450,top=120,left=200").focus()'
	   	
		document.write("<a href='http://www.6bstudio.co.il/interiors' class='regLink2'><b>ידיעון פנים</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/folders' class='regLink2'><b>ידיעון מכינה</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/fashion' class='regLink2'><b>ידיעון אופנה</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/graphic' class='regLink2'><b>ידיעון גרפי</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/openforum' class='regLink2'><b>פורום</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/bulletinboard.asp' class='regLink3'>לוח מודעות</a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/contact.asp' class='regLink2'>צור קשר</a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/students/studentslogin.php' class='regLink2'>זירת הלימודים</a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='javascript:"+direction_map_src+"'  class='regLink2'>איך מגיעים ?</a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/jobs.asp'  class='regLink2'>דרושים</a>");
		

}


function printHeaderLinksIndex2(){ 



    var direction_map_src='open("http://www.6bstudio.co.il/directions.html","location_map","width=480,scrollbars=yes, height=550,top=50,left=200").focus()'
        
        document.write("<a href='http://www.6bstudio.co.il/bulletinboard.asp' class='regLink3'>לוח מודעות</a>");
        document.write("&nbsp;|&nbsp;&nbsp;");   
        document.write("<a href='http://www.6bstudio.co.il/articles.asp' class='regLink2'>מאמרים</a>");
        document.write("&nbsp;|&nbsp;&nbsp;");   
        document.write("<a href='http://www.6bstudio.co.il/interiors' class='regLink2'><b>ידיעון פנים</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/folders' class='regLink2'><b>ידיעון מכינה</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/fashion' class='regLink2'><b>ידיעון אופנה</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/graphic' class='regLink2'><b>ידיעון גרפי</b></a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/openforum' class='regLink2'><b>פורום</b></a>");
        document.write("&nbsp;|&nbsp;&nbsp;");
        document.write("<a href='http://www.6bstudio.co.il/students/studentslogin.php' class='regLink2'>כניסת סטודנטים</a>");
        document.write("&nbsp;|&nbsp;&nbsp;");
        document.write("<a href='http://www.6bstudio.co.il/contact.asp' class='regLink2'>צור קשר</a>");
        document.write("&nbsp;|&nbsp;&nbsp;");
       // document.write("<a href='http://www.6bstudio.co.il/students/studentslogin.php' class='regLink2'>איך מגיעים</a>");
       // document.write("&nbsp;|&nbsp;&nbsp;");
        document.write("<a href='javascript:"+direction_map_src+"'  class='regLink2'>איך מגיעים ?</a>");
		document.write("&nbsp;|&nbsp;&nbsp;");
		document.write("<a href='http://www.6bstudio.co.il/jobs.asp'  class='regLink2'>דרושים</a>");

}


function open_close_messages(mType){
	var  classImg,classNme
	classImg="message_"+mType
	var oTR=document.getElementsByTagName("TABLE")[classImg]
	classImg="plus_minus_"+mType
	var oIM=document.getElementsByTagName("IMG")[classImg]
	if(oTR.className == "messShow")
			{ 
			 oTR.className="messHide"
			 oIM.src="../images/general/pls.gif"
			
			}
	else
			{ 
				if(oTR.className == "messHide") 
					{
					oTR.className="messShow"
					oIM.src="../images/general/mns.gif"
					}
			}
}

function open_close_content(mType){
	var classI = "mcontent1_"+mType
	var classII = "mcontent2_"+mType
	var oTRI=document.getElementsByTagName("TABLE")[classI]
	var oTRII=document.getElementsByTagName("TABLE")[classII]
	if(oTRI.className == "messShow") 
			{
			oTRI.className="messHide"
			oTRII.className="messShow"
			}
	else 
			{
				if(oTRI.className == "messHide") 
					{
					oTRI.className="messShow"
					oTRII.className="messHide"
					}
			}
}


function open_close_dictionary(mType){
	var  classImg,classNme
	classImg="message_"+mType
	var oTR=document.getElementsByTagName("TABLE")[classImg]
	classImg="plus_minus_"+mType
	var oIM=document.getElementsByTagName("IMG")[classImg]
		classImg="pmTitle_"+mType
	var oTD=document.getElementsByTagName("TD")[classImg]
	if(oTR.className == "messShow")
			{ 
			 oTR.className="messHide"
			 oIM.src="../images/general/pls.gif"
			if(oTD.className == "regText12bold") oTD.className="regText12"
			}
	else
			{ 
				if(oTR.className == "messHide") 
					{
					oTR.className="messShow"
					oIM.src="../images/general/mns.gif"
					if(oTD.className == "regText12") oTD.className="regText12bold"
					}
			}
}

function checkform(){

with(document["f"])
{
	var count = elements.length
	
	for(var i=0; i<count; i++)
	{
			if(elements[i].name.indexOf("hova") > -1)
				{ // check email
			   if(elements[i].name.indexOf("email") > -1 && !checkemail(elements[i].value))
				   	{
					  elements[i].focus()
					  alert("Please type a valid e-mail.")
					  return false;
					}
			 else if(elements[i].value == "")
				 		{
						 elements[i].focus()
						  alert("Please fill all mandatory fields!!")		
						  return false;
				    	} 		 
	      		}
	 }	
  }	
  return true;
}

function checkemail(pass){
var emailRE = /^\S{1,}@{1}\S*\.{0,1}\.{1}\w{2,}\b/i
return emailRE.exec(pass)
}

function doAjaxAction(file,sendStr,areaID,retFunc){
	if ((areaID!='') && document.getElementById(areaID)){
		var original = document.getElementById(areaID).innerHTML;
		document.getElementById(areaID).innerHTML = "<div align=center style='height:50px; font-size:16px'><br /><h6>....טוען</h6> </div>";
	}
	if (window.XMLHttpRequest){ try { xmlhttp = new XMLHttpRequest(); }catch(e){ xmlhttp = false; }
	} else if(window.ActiveXObject){ try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { xmlhttp = false; } } }
	if (xmlhttp) xmlhttp.open('POST', file, true);
	else{ alert("error init"); return false; }
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4) {
			if (xmlhttp.status == 200){
				if ((areaID!='') && document.getElementById(areaID)){
					document.getElementById(areaID).innerHTML = xmlhttp.responseText; // responseXML
				}else{
					if (typeof retFunc=='function') retFunc(xmlhttp.responseText);
					else alert("No function: " + retFunc);
				}
			}else{
				if ((areaID!='') && document.getElementById(areaID)){
					alert("Error occured... loading original");
					document.getElementById(areaID).innerHTML = original;
				}else{
					if (typeof retFunc=='function') retFunc("[ERROR]");
					else alert("No function: " + retFunc);
				}
			}
		}
	}
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	
	xmlhttp.send(sendStr);
}
