var panelPopup;

var lnkClickHideAll = function () {
	var divs = YAHOO.util.Dom.getElementsByClassName('news-content', 'div', '');
	for ( var i = 0; i < divs.length; i++ ) {
		divs[ i ].style.display = 'none';
	}
	var links = YAHOO.util.Dom.getElementsByClassName('linknews-active', 'a', '');
	for ( var i = 0; i < links.length; i++ ) {
		links[ i ].className = 'linknews';
	}
}

var lnkClickNews = function ( id ) {
	return function () {		
		lnkClickHideAll ();
		var lnk = document.getElementById( id );
		lnk.className = 'linknews-active';
		var elm = document.getElementById(id + '-text');
		if ( elm != null ) {
			elm.style.display = 'block';
		}
	}
}

YAHOO.util.Event.onDOMReady(function(){

setTimeout (
	function () {

panelPopup = new YAHOO.widget.Panel("panelPopup", { width:"450px", height:"380px", visible: false, constraintoviewport:true, draggable:true, iframe : true, modal : false, fixedcenter : true } );
panelPopup.render();

	}, 1000
);

	if(typeof sIFR == "function"){
	    sIFR.replaceElement("h1", named({sFlashSrc: "/Sites/Mediator/flash/utopiastdsemibold.swf", sColor: "#d05d18", sWmode : "transparent" }));
	    sIFR.replaceElement("h3", named({sFlashSrc: "/Sites/Mediator/flash/utopiastdsemibold.swf", sColor: "#d05d18", sWmode : "transparent" }));
	};

	var links = YAHOO.util.Dom.getElementsByClassName('linknews', 'a', '');
	if ( links.length > 0 ) {
		for ( var i = 0; i < links.length; i++ ) {
			YAHOO.util.Event.on ( links[ i ].id, 'click', lnkClickNews ( links[ i ].id )  );	
		}
	}

var loginInpUsr = new WawLoginInput('login_username', 'login_password', 'proxypassword');
var loginInpPass = new WawLoginPassword('login_password', 'proxypassword');


}); 


function addBookmark() {
	url = location.href;
	title = document.title;
	
	if (window.sidebar) { // firefox
			window.sidebar.addPanel(title, url,"");
         } else if( document.all ) { //MSIE
        	window.external.AddFavorite( url, title);
        } else {
        }
}

var sentContentToFriend = function () {
	var elm1 = document.getElementById('emailFrom');
	var elm2 = document.getElementById('emailTo');
	
	if(elm1.value == 'Vul een e-mail adres in'){
		return false;
	}

	if(elm2.value == 'Vul een e-mail adres in'){
		return false;
	}
	
	if(elm1.value.length > 0 && elm2.value.length > 0){
		document.getElementById('frmSentFriend').submit();
	}
}

var popupSentFriend = function () {
	
	panelPopup.show();
}

var popupSentFriendHide = function () {
	panelPopup.hide();
}
