function display_Messages(parent,named,link,h,w){
  var menu_element = document.getElementById(named);
  menu_element.innerHTML = "&nbsp;&nbsp;<a onclick=Hide_menu('Messages')>[Close]</a><br><iframe border=0 height=250 width=470 src="+link+"></iframe>";
  menu_element.style.display = "";
	var placement = findPosImage(parent);
  menu_element.style.right =  "";
  menu_element.style.top = "";
}

function LoadMessenger(name,h,w) {
	Awindow=window.open('','name','height='+h+',width='+w+'');
	var tmp = Awindow.document;
	var fh = h - 50;
	var fw = w - 20;
	tmp.write('<html><body background="./../../images/bgcolor.jpg">');
	tmp.write('<DIV style=\'background-color: #CCFFCC;\'>');
	tmp.write('<iframe id="noid" frameborder="1" height='+fh+' width='+fw+' marginwidth="-10" marginheight="0"');
	tmp.write('src='+name+'>');
	tmp.write('</iframe>');
	tmp.write('&nbsp;&nbsp;&nbsp;<SPAN class=buttonborder><button type=button onclick=javascript:self.close()>Close</button></SPAN>');
	tmp.write('</DIV>');
	tmp.write('</body></html>');
	tmp.close();
}
function PopUpRadioStations() {
	Popwindow=window.open('','name','height=650,width=580');
	var tmp = Popwindow.document;
	tmp.write('<html><head><title>Irandk Radio Stations</title>');
	tmp.write('<iframe class=irandk frameborder="1" width="560" height="580" marginwidth="-10" marginheight="0"');
	tmp.write('src="./../../radiostations/output/radiostations_list.php">');
	tmp.write('</iframe>');
	tmp.write('</head><body bgcolor=#66CC99>');
	tmp.write('<p><a href="javascript:self.close()">Close</a>');
	tmp.write('</body></html>');
	tmp.close();
}

function AttachMultiChat(name,h,w) {
	Awindow=window.open('','name','height='+h+',width='+w+'');
	var tmp = Awindow.document;
	var fh = h - 50;
	var fw = w - 20;
	tmp.write('<html><body onunload="opener.display_Profile_Info(this,\'multichat\')">');
	tmp.write('<iframe id="AttachMultiChatFrame" frameborder="1" height='+fh+' width='+fw+' marginwidth="-10" marginheight="0"');
	tmp.write('src='+name+'>');
	tmp.write('</iframe>');
	tmp.write('&nbsp;&nbsp;&nbsp;<SPAN class=buttonborder><button type=button onclick=javascript:self.close()>Close</button></SPAN>');
	tmp.write('</body></html>');
	tmp.close();
}
function display_Profile_Info(parent,named)
{
  var menu_element = document.getElementById(named);
  menu_element.style.display = "";
	var placement = findPosImage(parent);
  menu_element.style.right =  "5%";
  menu_element.style.top = "";
}

function findPosImage(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop 
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft 
			curtop += obj.offsetTop
		}
  }
	return [curleft,curtop];
}

function Hide_menu(named)
{
 	var menu_element = document.getElementById(named);
 	menu_element.style.display = "none";
}
