function print_flash(){	

	var set_flash='';
	var width=new Array(373,168); 
	var height=new Array(173,133);
	var bunner, bun_link;
	var b_curr_id;
		
	if(curr_id>5)
		curr_id=0;
		
	b_curr_id=curr_id
	
	window.clearTimeout(id_title);

	j=(register)?1:0;

	for(var i=j; i<4; i++){

		if(b_curr_id>5)
			b_curr_id=0;
			
		bunner=(i==0)?arr_bunner[b_curr_id][0]:arr_bunner2[b_curr_id][0];
		bun_link=(i==0)?arr_bunner[b_curr_id][1]:arr_bunner[b_curr_id][1];
		
		set_flash='<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=\"' + width[(i==0)?0:1] + '\" height=\"' + height[(i==0)?0:1] + '\">';
		set_flash=set_flash + '<param name=\"movie\" value=\"bunner/' + bunner + '.swf\" />';
		set_flash=set_flash + '<param name=\"quality\" value=\"high\" />';
		set_flash=set_flash + '<param name=\"flashvars\" value=\"bun_link=' + bun_link.replace('_', '&amp;') + '\" />';
		set_flash=set_flash + '<embed src=\"bunner/' + bunner + '.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"' + width[(i==0)?0:1] + '\" height=\"' + height[(i==0)?0:1] + '\"><\/embed>';
		set_flash=set_flash + '<\/object>';
	
		document.getElementById('set_flash' + i).innerHTML=set_flash;
		b_curr_id++;
	}
	
	curr_id++;
	
	window.setTimeout('print_flash()', 15000);
}

function play_sound(value){
	//alert(value);
	document.getElementById('get_sound').innerHTML='<embed name="sound1" src="exam_wav/' + value + '.mp3" loop="false" autostart="true" mastersound="mastersound" hidden="true" width="0" height="0"></embed>';
	return true;
}

function sendNewsletter(){
	var tr=document.getElementById('newsletter');
	
	tr.getElementsByTagName('TD')[0].innerHTML='You&nbsp;are&nbsp;now&nbsp;subscribed&nbsp;to&nbsp;the&nbsp;<strong><span style="color: #003366;">iStudy</span><span style="color: #35A2E0">Hebrew</span></strong>&nbsp;mailing&nbsp;list';
	for(var i=0; i<2; i++)
		tr.removeChild(tr.getElementsByTagName('TD')[tr.getElementsByTagName('TD').length-1]);

}

function stam(){
	//alert('');
}

function isValidEmail(email)
{
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(email)){
		return true;
		window.status='Sending...';	
	}
	else{
		alert('Please fill in a valid email address');
		
		return false
	}

}

function check_test(){
	var tag_name='';
	var return_value;

	for(var i=0; i<document.frm.elements.length; i++){

		if(tag_name!=document.frm.elements[i].name && document.frm.elements[i].type=='radio'){
			tag_name=document.frm.elements[i].name;
			return_value=false;
			
			for(var j=0; j<document.frm.elements[tag_name].length; j++)
				if(document.frm.elements[tag_name][j].checked)
					return_value=true;					
				
			if (return_value==false){
				alert('please, ckeck your answers');
				return return_value;
			}	
		}

	}
	
	frm.submit();
}


function get_sum(sum){
	
	var level='';
	
	document.getElementById('hide_show').style.display='';
	document.getElementById('show_hide').style.display='none';
	
	if(sum<=40)
		level='BEGINNER';
	else if(sum>40&&sum<=55)
		level='INTERMEDIATE';
	else if(sum>55)
		level='ADVANCED';
		
	document.getElementById('get_level').innerHTML=level;	
	document.getElementById('send_but').onclick=for_back;
	document.getElementById('send_but').value='back';
}

function for_back(){
	document.getElementById('send_but').onclick=function(){
		frm.submit();
	}
	document.getElementById('send_but').value='send';
	document.getElementById('show_hide').style.display='';
	document.getElementById('hide_show').style.display='none';
}

