var timeout;		
function scroll_text_down()
{
		var objDiv = document.getElementById("text_to_scroll");
		
		objDiv.scrollTop += 1;
		timeout = setTimeout('scroll_text_down()', 10);
}		

function scroll_text_up()
{
		var objDiv = document.getElementById("text_to_scroll");
		objDiv.scrollTop -= 1;
		timeout = setTimeout('scroll_text_up()', 10);
}	

function down_out()
{
	clearTimeout(timeout);
}




function abc()
{
	alert('asd');
}





function open_win(loc,id,width,height,resize,scroll) 
{
	var top = (screen.height - height) / 2;
	var left = (screen.width - width) / 2; 
	window.open(loc,id,"width="+width+",height="+height+",left="+left+",top="+top+",scrollbars="+scroll+",resizable="+resize+",status=yes"); 
} 

function popup(act,id,width,height,resize,scroll)
{ 
	if 
	(!width) 
	{ 
		width = 640; height = 480; resize = "no"; scroll = "no"; 
	} 
	open_win(act,id,width,height,resize,scroll); 
} 



function editContainer(id,page)
{
	var height = 610;
	var width = 1076;
	newwin = window.open("/"+page+"/edit_container/" + id, "message", "top=" + 50 + ",left=" + 50 + ",height=" + height + ",width=" + width + ",resize=yes,scrollbars=no,toolbar=no,location=no,menubar=no,status=no");
}

function mailCheck(str) {
	
	
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		  /// alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   //alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    //alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }

 		 return true			
	}
