function checkRadios() {
 var el = document.forms[0].elements;
 for(var i = 0 ; i < el.length ; ++i) {
  if(el[i].type == "radio") {
   var radiogroup = el[el[i].name]; // get the whole set of radio buttons.
   var itemchecked = false;
   for(var j = 0 ; j < radiogroup.length ; ++j) {
    if(radiogroup[j].checked) {
	 itemchecked = true;
	 break;
	}
   }
   if(!itemchecked) { 
    alert("Please choose login type company or jobseeker.");
    if(el[i].focus)
     el[i].focus();
	return false;
   }
  }
 }
 return true;
} 
function opwin(url,h,w)
{
XPos = screen.availWidth/2 - w/2; 
YPos = (screen.availHeight/2 - h/2) - 85; 
var opwin = window.open(url, 'okies', "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 = 540; 
w = 680;
XPos = screen.availWidth/2 - w/2; 
YPos = (screen.availHeight/2 - h/2) - 85; 
var ow = window.open(url, "okies", "toolbar=no,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 = '#FF9900';}
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 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("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);
}
