
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 = '#6FA3D9';
	}
}

function mouseOut(Obj){
	if(Obj){
		Obj.style.background = '#044585';
	}
}
function mmouseOvr(Obj){
	if(Obj){
		Obj.style.background = '#6FA3D9';
	}
}

function mmouseOut(Obj){
	if(Obj){
		Obj.style.background = '#3A7EBF';
	}
}
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';
	}
}
function expcol(objdiv,image){
	objdiv=document.getElementById(objdiv);
	if(document.layers){
		switch(objdiv.style.visibility){
			case 'visible':
				//objdiv.style.height='1';
				objdiv.style.visibility='hidden';
				image.src='images/expand.png';
			break;
			case 'hidden':
				//objdiv.style.height='100%';
				objdiv.style.visibility='visible';
				image.src='images/collapse.png';
			break;
		}
	}else{
		switch(objdiv.style.display){
			case 'block':
				objdiv.style.display='none';
				//objdiv.style.height='1';
				image.src='images/expand.png';
			break;
			case 'none':
				objdiv.style.display='block';
				//objdiv.style.height='100%';
				image.src='images/collapse.png';
			break;
		}
	}
	
}
