window.addEvent('domready', function() {
	
// ----- Blintdesign code -------------------------------
	
	// Portfolio page ccordion instance
	var myAccordion = new Accordion($('accordion'), 'h3.toggler', 'div.folio_box', {
		opacity: false,
		onActive: function(toggler, element){
			toggler.setStyle('color', '#fff');
		},
		onBackground: function(toggler, element){
			toggler.setStyle('color', '#00ffff');
		}
	});
	
	
// ------------------------------------------------------- 
	
	
	// Comments box toggler
	var CommentBox = new Fx.Slide('comments');
	$('comments_toggle').addEvent('click', function(e){
		e.stop();
		CommentBox.toggle();
	});

	if (((window.location.hash.substring(0,8)) == "#comment") || ((window.location.hash.substring(0,8)) == "#respond")) {
		CommentBox.show();
	} else {
		CommentBox.hide();
	}


	// If search button isn't activ
	var searchbtn   = $('searchbtn');
	var searchfield = $('q');
	searchbtn.onclick = function(e) {
		if(searchfield.value == "") return false;
	}
	
	
	// If webpage comment input not filled
	var commentbtn = $('comment-submit');
	var urlfield = $('url');
	commentbtn.onclick = function(e) {
		if(urlfield.value.substring(0,3) == "web") urlfield.value = "";
	}


	// Comment form - Author
	var author = $('author');
	var tauthor = author.value;
	if(!author.value.length || author.value == tauthor) author.value = tauthor;
	author.onfocus = function(e){ if(author.value == tauthor) author.value = ""; }
	author.onblur  = function(e){ if(!author.value.length) author.value = tauthor; }

	// Comment form - E-Mail
	var email = $('email');
	var temail = email.value;
	if(!email.value.length || email.value == temail) email.value = temail;
	email.onfocus = function(e){ if(email.value == temail) email.value = ""; }
	email.onblur  = function(e){ if(!email.value.length) email.value = temail; }
	
	// Comment form - URL
	var url = $('url');
	var turl = url.value;
	if(!url.value.length || url.value == turl) url.value = turl;
	url.onfocus = function(e){ if(url.value == turl) url.value = ""; }
	url.onblur  = function(e){ if(!url.value.length) url.value = turl; }
	
	// Comment form - Capcha
	var chap = $('mcspvalue');
	var tchap = chap.value;
	if(!chap.value.length || chap.value == tchap) chap.value = tchap;
	chap.onfocus = function(e){ if(chap.value == tchap) chap.value = ""; }
	chap.onblur  = function(e){ if(!chap.value.length) chap.value = tchap; }


});
