//This code was written by Jared Proffitt
//and belongs to Jared Proffitt.
//All rights reserved.

function appendInputTypeClasses() { 
 if (!document.getElementsByTagName ) 
  return; 
 var inputs = document.getElementsByTagName('input'); 
 var inputLen = inputs.length; 
 for ( i=0;i<inputLen;i++ ) { 
  if ( inputs[i].getAttribute('type') ) 
   inputs[i].className += ' '+inputs[i].getAttribute('type'); 
 } 
} 

function blinkit(){
	intrvl=0;
	for(nTimes=0;nTimes<2;nTimes++){
	intrvl += 100;
	setTimeout("document.getElementById('loginblink').style.border='1px #05707A solid';",intrvl);
	intrvl += 100;
	setTimeout("document.getElementById('loginblink').style.border='1px white solid';",intrvl);
   }
}

function showTable(num){
	if(num == 1){
		document.getElementById('t1').style.display='block';
		document.getElementById('t2').style.display='none';
		document.getElementById('img1').src='Images/mybids_on.gif';
		document.getElementById('img2').src='Images/watchlist_off.gif';
	}
	else if(num == 2){
		document.getElementById('t1').style.display='none';
		document.getElementById('t2').style.display='block';
		document.getElementById('img1').src='Images/mybids_off.gif';
		document.getElementById('img2').src='Images/watchlist_on.gif';
	}
}


function biddersBox(num, e){
	getElementByClass('biddersdiv');
	var cursor = getPosition(e);
	var curX = cursor.x - 200;
	var curY = cursor.y + 10;

	document.getElementById('job'+num).style.visibility='';
	document.getElementById('job'+num).style.left=curX+'px';
	document.getElementById('job'+num).style.top=curY+'px';
}

function clearBiddersBox(num){
	document.getElementById('job'+num).style.visibility='hidden';
}

function getPosition(e) {
	e = e || window.event;
	var cursor = {x:0, y:0};
	if (e.pageX || e.pageY) {
		cursor.x = e.pageX;
		cursor.y = e.pageY;
	} 
	else {
		var de = document.documentElement;
		var b = document.body;
		cursor.x = e.clientX + (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
		cursor.y = e.clientY + (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
	}
	return cursor;
}


var allHTMLTags = new Array();

function getElementByClass(theClass) {
	var allHTMLTags=document.getElementsByTagName("*");
	for (i=0; i<allHTMLTags.length; i++) {
		if (allHTMLTags[i].className==theClass) {
			allHTMLTags[i].style.visibility='hidden';
		}
	}
}