
function Email(filename)
{
	OpenBox("/promite/email.html?f="+filename);
}

function SubscribeNewsletter()
{
	if( $('#newsletter_email').attr("value") == "" )
	{
		alert( 'Nu ati completat campul Email' );
		$('#email').focus();
		return false;
	}
		var temp= new String($('#newsletter_email').attr("value"));
		var len=temp.length - 3;
		if(temp=="" || temp.indexOf("@")<0 || temp.indexOf(".")<0 || temp.lastIndexOf(".")> len || temp.length-temp.lastIndexOf(".")>4)
		{
			alert("Va rugam introduceti o adresa de email corecta!");
		//	$('#email').attr("value") = "";
			$('#email').focus();
			return false;
		}


	$.post(  
		"/newsletter.html",  
		$("#ajax-form").serialize(),  
		function(data){  
			$("#body_form").html(data);
		}  
	);  
}	

function CreateBookmarkLink() { 
	title = document.title;   // Blogger - Replace with <$BlogItemTitle$>   // MovableType - Replace with <$MTEntryTitle$> 
	url = window.location.href;  // Blogger - Replace with <$BlogItemPermalinkURL$>   // MovableType - Replace with <$MTEntryPermalink$>  // WordPress - <?php bloginfo('url'); ?>	
	if($.browser.msie){

		window.external.AddFavorite( url, title); 
	} else if( window.sidebar ) { // IE Favorite
		window.sidebar.addPanel(title, url,"");	
	}	else if(window.opera && window.print) { // Opera Hotlist		
		return true; 
	} 
} 



function OpenPrint(){
	window.open(window.location.href+'?print','print','width=700,height=500,scrollbars=yes');
}
function Show(obiect,day)
{
	var s=new jQuery(obiect);
	var position = s.position();
	
	$("#box_calendar_events").css("display","block");
	$("#box_calendar_events").css("left",position.left+20);
	$("#box_calendar_events").css("top",position.top +20);
	$("#box_calendar_events .body").html(ev[day]);
}


function Yahoo()
{
	window.location=encodeURI('ymsgr:im?msg='+(window.location.href));
}

//---------------------send email		
function SendEmail(url){
	if (CheckFormEmail()){

  		
		    $.ajax({
			  type: "POST",
			  url: url,
			  data: $('#sendemail').serialize(),  	
			  success: function(data,text) {
				$("#box_email").html(data);
			  }
			});
			return false;
	}	 
}

function CheckFormEmail(){
	
	
	
	if( $('#email').attr("value") == "" )
	{
		alert( 'Nu ati completat campul Email' );
		$('#email').focus();
		return false;
	}
	var temp= new String($('#email').attr("value"));
	var len=temp.length - 3;
	if(temp=="" || temp.indexOf("@")<0 || temp.indexOf(".")<0 || temp.lastIndexOf(".")> len || temp.length-temp.lastIndexOf(".")>4)
	{
		alert("Va rugam introduceti o adresa de email corecta!");
	//	$('#email').attr("value") = "";
		$('#email').focus();
		return false;
	}
	
	
	
	return true;
}

function OpenBox(url){
	 $("#box_email").load(url);
	 
	ttop=0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
		ttop=window.pageYOffset;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
		ttop=document.documentElement.scrollTop;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
		ttop=document.body.scrollTop;
	}

	l = (myWidth-700)/2;
	t = (myHeight-250)/2+ttop ; 
	
	 $('#box_email').css('left',l+'px');
	 $('#box_email').css('top' , t+'px'); 
	 
	 $('#box_email').css('display','block');
}

function Close(name){
	$('#'+name).css('display','none');
} 
function ChangeMonthCalendar(year,month)
{
	$("#box_calendar").load('/calendar_show.php?year='+year+"&month="+month);
}

function countChar(text,div,numar_caractere) {	
	val = text.value;
	if (val.length > numar_caractere) {
		alert('Textul dumneavoastra depaseste limita de '+numar_caractere+' de caractere!');
		text.value = val.substring(0,numar_caractere);
		text.focus();
	}
	document.getElementById(div).innerHTML = parseInt(val.length);
}


function sidebar_discuri_toggle()
{
	$('#sidebar_discuri_closed').toggle();
	$('#sidebar_discuri_contents').toggle();
}

function sidebar_interviuri_toggle()
{
	$('#sidebar_interviuri_closed').toggle();
	$('#sidebar_interviuri_contents').toggle();
}

function sidebar_concerte_toggle()
{
	$('#sidebar_concerte_closed').toggle();
	$('#sidebar_concerte_contents').toggle();
}

function sidebar_nworm_toggle()
{
	$('#sidebar_nworm_closed').toggle();
	$('#sidebar_nworm_contents').toggle();
}

function sidebar_metalfans_toggle()
{
	$('#sidebar_metalfans_closed').toggle();
	$('#sidebar_metalfans_contents').toggle();
}

$(function() {
	//$('.content').ifixpng(); 
})

