
function emtf() {
  window.open('http://db2.jobstreet.com/referral/refer.asp?t=1&link=' + location.href, '_mail', config='height=600,width=600,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no');
}


function opwin(url,h,w)
{
XPos = screen.availWidth/2 - w/2; 
YPos = (screen.availHeight/2 - h/2) - 50; 
var opwin = window.open(url, "newwindow", "toolbar=yes,menubar=no,scrollbars=yes,resizable=yes,location=top,status=no,width="+w+",height="+h+",ScreenX=0,ScreenY=0,Top="+YPos+",Left="+XPos); 
opwin.focus();
}

function ow(url,lk)
{
h = 600; 
w = 750;
XPos = screen.availWidth/2 - w/2; 
YPos = (screen.availHeight/2 - h/2) - 85; 
var ow = window.open(url, "newwindow", "toolbar=yes,menubar=no,scrollbars=yes,resizable=yes,location=top,status=no,width="+w+",height="+h+",ScreenX=0,ScreenY=0,Top="+YPos+",Left="+XPos); 
if (!(navigator.appName.indexOf("Netscape")!= -1 && parseInt(navigator.appVersion) == 4)) {lk.style.color = '#800080';}
ow.focus();
}

function opwin1(url,h,w)
{
theHeight = h; 
XPosition = screen.availWidth/2 - w/2; 
YPosition = screen.availHeight/2 - theHeight/2; 
	window.open(url, "newwindow", "toolbar=no,menubar=no,scrollbars=no,resizable=no,location=top,status=no,width="+w+",height="+theHeight+",ScreenX=0,ScreenY=0,Top="+YPosition+",Left="+XPosition);
}

function opwin2(url,h,w)
{
theHeight = h; 
XPosition = screen.availWidth/2 - w/2; 
YPosition = screen.availHeight/2 - theHeight/2; 
window.open(url, "newwindow", "toolbar=yes,menubar=no,scrollbars=yes,resizable=yes,location=top,status=no,width="+w+",height="+theHeight+",ScreenX=0,ScreenY=0,Top="+YPosition+",Left="+XPosition); 
}

function opwin3(url,h,w)
{
theHeight = h; 
XPosition = screen.availWidth/2 - w/2; 
YPosition = screen.availHeight/2 - theHeight/2; 
window.open(url, "newwindow", "toolbar=yes,menubar=no,scrollbars=yes,resizable=yes,location=yes,status=no,width="+w+",height="+theHeight+",ScreenX=0,ScreenY=0,Top="+YPosition+",Left="+XPosition); 
}

function popup(c,url,e) {
	var r = null;
	if(getCookie(c) == null) {
		setCookie(c, "true", e);
		r = window.open('', 'special','width=320,height=320,resizable=0');
		if (r != null) {
			if (r.opener == null) {
				r.opener = self;
			}
			r.location.href = url;
		}
	}
}

function popup2(c,url,e,wn,h,w) {
	var r = null;
	if(getCookie(c) == null) {
		setCookie(c, "true", e);
		r = window.open('', wn,'width='+w+',height='+h+',resizable=0');
		if (r != null) {
			if (r.opener == null) {
				r.opener = self;
			}
			r.location.href = url;
		}
	}
}

function popup3(url,h,w)
{
	var x= screen.availWidth/2 - w/2; 
	var y= screen.availHeight/2 - h/2; 
	window.open(url, "newwindow", "toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=top,status=no,width="+w+",height="+h+",ScreenX=0,ScreenY=0,Top="+y+",Left="+x); 
}

function getCookie(name) { 
	var re = new RegExp(name + "=([^;]+)");
	var value = re.exec(document.cookie);
	return (value != null) ? unescape(value[1]) : null;
}

function setCookie(name, value, e) { 
	// e = in minutes
	var today = new Date();
	var expiry = new Date(today.getTime() + e * 60 * 1000); // plus 1 hour
	document.cookie=name + "=" + escape(value) + "; expires=" + expiry.toGMTString();
}

function fdbk(site) {
	var s;
	if ((site==null) || (site=="")) {
		var h=location.href; 
		if ((h.indexOf("my.jobstreet.com") > 0) || (h.indexOf("www.jobstreet.com.my") > 0)) {s="my"}
		else if (h.indexOf("ph.jobstreet.com") > 0) {s="ph"} 
		else if (h.indexOf("sg.jobstreet.com") > 0) {s="sg"} 
		else if (h.indexOf("id.jobstreet.com") > 0) {s="id"} 
		else if (h.indexOf("bd.jobstreet.com") > 0) {s="bd"} 
		else if (h.indexOf("th.jobstreet.com") > 0) {s="th"} 
		else if (h.indexOf("vn.jobstreet.com") > 0) {s="vn"} 
		else if (h.indexOf("jp.jobstreet.com") > 0) {s="jp"} 
		else if (h.indexOf("th.jobstreet.com") > 0) {s="th"} 
		else if ((h.indexOf("in.jobstreet.com") > 0) || (h.indexOf("www.jobstreet.co.in") > 0)) {s="in"} 
		else {s="sg"}
	}
	else {
		s=site;
	}
	popup3('http://myjobstreet.jobstreet.com/help/feedback.asp?site='+s,520,650);
}

/**************************************/
// Description: Expandable ad setup script 
// Version: 1.0
// Last update: Oct 10, 2008
// Sample usage:
//	<script type="text/javascript">
//		jobstreet_setup_expleaderboard("MyLeaderboard.swf", 728, 90, 728, 180);
//	</script>
/**************************************/

// The id/name for flash banner
leaderboard_id = "homepage_leaderboard";
// Setup expandable leaderboard
function jobstreet_setup_expleaderboard(file, width, height, expwidth, expheight) {

	if(!expwidth) {
		expwidth = width;
	}
	if(!expheight) {
		expheight = height;
	}
	jobstreet_writeFlash(leaderboard_id, file, expwidth, expheight, "transparent", "");
	jobstreet_shrink_leaderboard();
} 
// Call this from flash banner to expand your ad
function jobstreet_expand_leaderboard() {
	jobstreet_getFlash(leaderboard_id).height = 120;
}
// Call this from flash banner to shrink your ad
function jobstreet_shrink_leaderboard() {
	jobstreet_getFlash(leaderboard_id).height = 60;
}
// Function to get flash id/name
function jobstreet_getFlash(id) {
	if(navigator.appName.indexOf("Microsoft") != -1) {
		return window[id];
	}else {
		return document[id];
	}
}
// Function to write the flash
function jobstreet_writeFlash(id, file, width, height, wmode, params) {

	var flashTag = '';
	flashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
	flashTag += 'id="' + id + '" ';
	flashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#" ';
	flashTag += 'width="' + width + '" ';
	flashTag += 'height="' + height + '">';
	flashTag += '<param name="movie" value="' + file + '"/>';
	flashTag += '<param name="wmode" value="' + wmode + '"/>';
	flashTag += '<param name="quality" value="high"/>';
	flashTag += '<param name="flashvars" value="' + params + '"/>';
	flashTag += '<param name="allowscriptaccess" value="always"/>';
	flashTag += '<embed src="' + file + '"';
	flashTag += ' width="' + width + '"';
	flashTag += ' height="' + height + '"';
	flashTag += ' type="application/x-shockwave-flash"';
	flashTag += ' name="' + id + '"';
	flashTag += ' allowscriptaccess="always"';
	flashTag += ' quality="high"';
	flashTag += ' wmode="' + wmode + '" ';
	flashTag += ' flashvars="' + params + '" ';
	flashTag += ' swliveconnect="true" ';
	flashTag += ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
	flashTag += '</embed>';
	flashTag += '</object>';
	document.write(flashTag);
}

