/*
	byO 2006-07 
	v0.3
*/

function openPopup(href) {
	
	window.open(href, 'dcmsPopup', 'scrollbars=yes')
	
}

function dcmsPopup(qString) {
	
	window.open('dcms.standalone.php'+qString, 'dcmsPopup', 'scrollbars=yes')
	
}

function openUrl(url) {
	window.location= url;
}


function display(id) {

	document.getElementById(id).style.display= 'block'
	
}


/* list:hover */
/* /list:hover */


function setCheckbox(id) {
	
	elem= document.getElementById(id)
	
	if (elem.checked) elem.checked= false
	else elem.checked= true
	
}



/* picture module */
function setPicture(filename, id) {

	window.parent.document.getElementById('picturePreview').innerHTML= '<img src="'+filename+'" />'
	window.parent.document.getElementById('pictureInput').value= id
	window.parent.document.getElementById('pictureList').style.display= 'none'
	window.parent.document.getElementById('iframeTrigger').innerHTML= 'select'
	
}

function unsetPicture() {

	document.getElementById('picturePreview').innerHTML= '&nbsp;'
	document.getElementById('pictureInput').value= 0
	
}

function displayPictureList() {

	url= 'dcms.standalone.php?section=image'
	iframe= document.getElementById('pictureList')
	trigger= document.getElementById('iframeTrigger')
	display= iframe.style.display
	
	if (display=='block') {
		iframe.style.display= 'none'
		trigger.innerHTML= 'select'
	} else {
		if (iframe.src!=url) iframe.src= url
		iframe.style.display= 'block'
		trigger.innerHTML= 'close'
	}

}
/* /picture module */

/* js for standalone module v0.4 - replace previous code */
function openStandalone(section) {

	url= 'dcms.standalone.php?section='+section
	trigger= document.getElementById('popupTrigger')
	
	window.open(url, 'saPopup', 'width=500px, height= 500px, scrollbars= yes,resizable= yes, location= yes')

}


function setItem(id, filename, type) {


	opener.document.getElementById('fileInput').value= id
	opener.document.getElementById('filePreview').innerHTML= '<img src="dcms/graphics/icon_'+type+'_small.png" />'+filename
	
/*	
	



	window.parent.document.getElementById('pictureList').style.display= 'none'
	window.parent.document.getElementById('iframeTrigger').innerHTML= 'select'
*/	
}
/* standalone */


function beTricky(info) {
	
	info= info.replace(/ /,".")
	document.write('<a href="mailto:'+info+'@taquin.com">'+info+'@taquin.com</a>')
	
}
