
function getJobs() {
	//var url = window.location.href
	window.location='http://www.placementpartner.co.za/wi/start.php?ID=cohesion&cmd=jobs&RTPG='+url, '_self';
}
function getCurrentURL() {
	//var url = window.location.href;
	window.location='http://www.placementpartner.co.za/wi/start.php?ID=cohesion&VacRef=&RTPG='+url, '_self';
}
function doMouseOvr(obj,color){
	if(obj){
		obj.bgColor=color;
	}
}
function doMouseOut(obj,color){
	if(obj){
		obj.bgColor=color;
	}
}

function setAction(a1, a2, a3) {
  window.document.frm_main.a1.value = a1;
  window.document.frm_main.a2.value = a2;
  window.document.frm_main.a3.value = a3;
  window.document.frm_main.submit(true);
}

function setAction(a1,a2,a3){
if(document.getElementById('a1')){document.getElementById('a1').value = a1};
if(document.getElementById('a2')){document.getElementById('a2').value = a2};
if(document.getElementById('a3')){document.getElementById('a3').value = a3};
//alert(a1 + ' ' + a2 + ' ' + a3);
window.document.frm_main.submit(true);
}

function returnInt(val){
if(val==true){return 1;}else{return 0;}
}

function confDelete(){
if(confirm('Are you sure you wish to delete this record?')){return true;}
}

var dialogArguments;
function uploadForm(field) {

  dialogArguments1 = field;
  var posY, posX;
  posY = 0; posX = 0;

  posY = (screen.availHeight / 2);
  posX = (screen.availWidth / 2) - (250 / 2);

  nw=window.open('uploadFile.php','ss','toolbar=no; top='+posX+'; left='+posX+'; width=250px; height=240px');
  nw.focus;
}

function setDate(sControl,sObj){
var dtsep="/";
	var dd = document.getElementById(sObj+'dayfld').value;
    var mm = document.getElementById(sObj+'monthfld').value;
    var yy = document.getElementById(sObj+'yearfld').value;
    //var hh = document.getElementById('hourfld').value;
    //var nn = document.getElementById('minutefld').value;
    //var ss = document.getElementById('secondfld').value;

    theDate = yy + dtsep + mm + dtsep + dd; //+ ' ' + hh + tmsep + nn + tmsep + ss
    document.getElementById(sControl).value = theDate;
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function posit(mnu,lyr) {
          if (document.getElementById(lyr)) {
      		  document.getElementById(lyr).style.left  = findPosX(document.getElementById(mnu));
      		  document.getElementById(lyr).style.top   = findPosY(document.getElementById(mnu))+14;
     }
}

function hideall() {
        for (i=0; i<100; i++) {
          if (document.getElementById('lyr'+i)) {
      		  document.getElementById('lyr'+i).style.display  = 'none';
          }
     }
}
function showone(lyr) {
	hideall();
  	document.getElementById(lyr).style.display  = 'block';
}
function mouseOvr(Obj){
	if(Obj){
		Obj.style.background = 'url(images/menu-drop.jpg)';
	}
}

function mouseOut(Obj){
	if(Obj){
		Obj.style.background = 'url(images/menu-drop-over.jpg)';
	}
}
function mmouseOvr(Obj){
	if(Obj){
		Obj.style.background = 'url(images/menu-black-tile.jpg)';
	}
}

function mmouseOut(Obj){
	if(Obj){
		Obj.style.background = 'url(images/menu-green-tile.jpg)';
	}
}
var agt = navigator.userAgent.toLowerCase();
function checkBrowserType() {
  var browserType = '';

  if ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) &&
      (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)) {
    browserType = 'NN';
  } else if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
    browserType = 'IE';
  } else if (agt.indexOf("opera") != -1) {
    browserType = 'OPERA';
  } else {
    browserType = '??';
  }
  return browserType;
}

function showhide(strObject,img){
	if(document.getElementById(strObject)){
		if(document.getElementById(strObject).style.display=='none'){
			document.getElementById(strObject).style.display='block';
			document.getElementById(img).src='./images/expand.gif';
		}else{
			if(checkBrowserType()!="NN"){
			document.getElementById(strObject).style.display='none';
			document.getElementById(img).src='./images/collapse.gif';
			}
		}
	}else{
		return false;
	}
}
function mOvr(Obj){
	if(Obj){
		Obj.style.color = '#4E7AB7';
	}
}

function mOut(Obj){
	if(Obj){
		Obj.style.color = '#484848';
	}
}

var secs=0;
var timerID = null;
var timerRunning = true;
var delay = 50;

function InitializeTimer(obj)
{
	//alert(obj);
	secs = 1; // Set the initial delay<br>
	timerRunning = true;
	StartTheTimer(obj);
}

function StopTheClock(obj,dohide)
{
	if(dohide!=false){dohide=true;}
	if (timerRunning)
	{
		clearTimeout(timerID);
		timerRunning = false;
		//    alert(obj)
		if(obj && dohide==true){
			hide(obj);
			hide2(obj);
		}
	}
}

function StartTheTimer(obj)
{
	if (secs==0)
	{
		secs = 1; //-OR- timerRunning=false;
		StopTheClock(obj); //call the function when time expires
	}
	//self.status = secs;
	secs = secs - 1;
	if (timerRunning)
	{
		timerID = self.setTimeout("StartTheTimer('"+obj+"')", delay);
	}
}
function show(lyr) {
	document.getElementById(lyr).style.display  = 'block';
	document.getElementById(lyr).style.visibility='visible';
}

function hide(lyr) {
	//alert(checkBrowserType());
	if (lyr) {
	if(checkBrowserType()=="NN"){
		document.getElementById(lyr).style.display  = 'none';
		//
	}
	}
}
function hide2(lyr) {
	//alert(checkBrowserType());
	if(checkBrowserType()=="IE"){
		document.getElementById(lyr).style.display  = 'none';
		document.getElementById(lyr).style.visibility='hidden';
	}
}
