// JavaScript Document - for Pil Jobs
function poponload()
{
testwindow= window.open ("invoice.php", "mywindow",
    "location=1,status=1,scrollbars=1,width=100,height=100");
testwindow.moveTo(0,0);
}

//this is for the text limiter for the short description
function textCounter(field,counter,maxlimit,linecounter) {
	// text width//
	var fieldWidth =  parseInt(field.offsetWidth);
	var charcnt = field.value.length;        

	// trim the extra text
	if (charcnt > maxlimit) { 
		field.value = field.value.substring(0, maxlimit);
	}

	else { 
	// progress bar percentage
	var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ;
	document.getElementById(counter).style.width =  parseInt((fieldWidth*percentage)/100)+"px";
	document.getElementById(counter).innerHTML="Limit: "+percentage+"%"
	// color correction on style from CCFFF -> CC0000
	setcolor(document.getElementById(counter),percentage,"background-color");
	}
}

function setcolor(obj,percentage,prop){
	obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)";
}

 function CreateBookmarkLink() {

 title="Jet IB, Specialists in Webdesign and Databased Solutions"; url="http://www.jetib.com";

 if (window.sidebar) { // Mozilla Firefox Bookmark

  window.sidebar.addPanel(title, url,"");

 } else if( window.external ) { // IE Favorite

  window.external.AddFavorite( url, title); }

 else if(window.opera && window.print) { // Opera Hotlist

  return true; }
  
 }
