function submitRating(contentId,id,rating){
	document.getElementById('vote'+contentId).value=id;
	document.getElementById('msg').value=document.getElementById('msg').value + '|' + rating;
	document.getElementById('votingform'+contentId).submit();
}

function addOnLoadListenerOnWindow(func,win) {
	var list;

	if(typeof win._onLoadListenerList=='undefined') {
		list = new Array();
		win._onLoadListenerList = list;
		if(typeof win.onload!='undefined') {
			if(win.onload!=null) {
				list[list.length] = win.onload;
			}
		}
		win.onload = _onLoadListenerListHandler;
	}
	list = win._onLoadListenerList;
	list[list.length] = func;
}

function addOnLoadListener(func) {
	addOnLoadListenerOnWindow(func,window);
}


function _onLoadListenerListHandler() {
	var i;
	if(typeof window._onLoadListenerList!='undefined') {
		for(i=0; i<window._onLoadListenerList.length; i++) {
			try {
				window._onLoadListenerList[i]();
			} catch(e) {
			}
		}
		// Delete the list. Now it is safe to call this function a second time.
		window._onLoadListenerList = [];
	}

	if(window.parent!=null && window.parent!=window) {
		if(typeof window.parent._onLoadListenerListHandler!='undefined') {
			window.parent._onLoadListenerListHandler();
		}
	}
}
