function switcher(id,imagename){

	document.getElementById(id).innerHTML = "<img src=" + imagename + " border='0'>";

//	document.getElementById(id).innerHTML.img.src = imagename;

}




function confirmSubmit(message)

{

var agree=confirm(message);

if (agree)

	return true ;

else

	return false ;

}



function clearfield(field,fieldmessage)

{

	if (document.getElementById(field).value==fieldmessage) {

			document.getElementById(field).value=''; 	

	}

}



function openwindow(page)

{

window.open(page, "newwindow","menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=200,height=160");

}



function openbanlist(page)

{

window.open(page, "newwindow","menubar=no,location=no,resizable=yes,scrollbars=auto,status=no,width=200,height=400");

}



function turnoff(item)

{

	document.getElementById(item).style.display='none';

}

 

function loadContent(action, id) {

	YAHOO.util.Connect.asyncRequest('POST', 'rpc.php?action=' + action + '&id=' + id, { success : handleSuccess, failure : handleFailure, argument : 'blog' });

}



function handleSuccess(data)

{

                if (data.responseXML.getElementsByTagName('error').length > 0)

                {

        	        alert('Respons: ' + data.responseXML.getElementsByTagName('error')[0].firstChild.data);        

                } else {  

			if (data.argument == 'blog') {

				var xmldate = data.responseXML.getElementsByTagName('blog')[0].getAttribute('date');

				var xmlid = data.responseXML.getElementsByTagName('blog')[0].getAttribute('id');

				

				var xmltitle = data.responseXML.getElementsByTagName('title')[0].firstChild.data;

				var xmlcontent = data.responseXML.getElementsByTagName('content')[0].firstChild.data;

				document.getElementById('blogdate').innerHTML = xmldate;

				document.getElementById('blogtitle').innerHTML = xmltitle;

				document.getElementById('blogcontent').innerHTML = xmlcontent; 

			}		

				}

}



function handleFailure(data)

{

	alert('Något gick fel i kontakt med server...' + data);

}



function myOpen(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);

}


