function popir(p)
{
	var width = 500;
	var height = 350;
	var left = (screen.width-width)/2;
	var top = (screen.height-height)/2
	var popup = window.open("ir_index.html?p=" + p,'irasiaconfirm','resizable=no,width='+width+',height='+height+',left='+left+',top='+top);
	popup.focus();
}


function popirindex()
{
	var pages = {
		'announce' : 'http://www.irasia.com/listco/hk/sjm/announcement/index.htm',
		'reports' : 'http://www.irasia.com/listco/hk/sjm/annual/index.htm',
		'circulars' : 'http://www.irasia.com/listco/hk/sjm/listingdoc/index.htm',
		'stock' : 'http://www.irasia.com/listco/hk/sjm/quote.htm'
		
	};
	var p = getParameter("p");
	var page = "http://www.irasia.com/listco/hk/sjm/index.htm";
	if (pages[p]) page = pages[p];
	var popup = window.open(page,"irasia","resizable=yes,menubar=1,location=1,toolbar=1,scrollbars=1,status=1");
	popup.focus();
	window.close();
}


function getParameter(pname,frstr)
{
    var pattern = new RegExp("[\\?\\&]" + pname + "=(\\w*)");
    if (!frstr)
        frstr = self.location.href;
    var matches = pattern.exec(frstr);
    if (matches != null)
        return matches[1];
    else
        return null;
}

function popnotice()
{
	var width = 600;
	var height = 580;
	var left = (screen.width-width)/2;
	var top = (screen.height-height)/2
	var popup = window.open('important_notice.html','irasiaconfirm','resizable=no,width='+width+',height='+height+',left='+left+',top='+top);
	popup.focus();
}

function popemployee()
{
	var width = 500;
	var height = 350;
	var left = (screen.width-width)/2;
	var top = (screen.height-height)/2
	var popup = window.open('HR_link.html','irasiaconfirm','resizable=no,width='+width+',height='+height+',left='+left+',top='+top);
	popup.focus();
}

function popemployeeindex()
{
	var pages = {
		'employee' : 'http://www-us.computershare.com/employee/hk/en/sjm.html'
	};
	var p = getParameter("p");
	var page = "http://www-us.computershare.com/employee/hk/en/sjm";
	if (pages[p]) page = pages[p];
	var popup = window.open(page,"irasia","resizable=yes,menubar=1,location=1,toolbar=1,scrollbars=1,status=1");
	popup.focus();
	window.close();
}

function getParameter(pname,frstr)
{
    var pattern = new RegExp("[\\?\\&]" + pname + "=(\\w*)");
    if (!frstr)
        frstr = self.location.href;
    var matches = pattern.exec(frstr);
    if (matches != null)
        return matches[1];
    else
        return null;
}