if (!JC_first_in_column) {
	//document.write('<div class="JC_dotted-rule-jobs-top"></div>');
}
var JC_widget_body;

document.write (' '+
	'<STYLE TYPE="text/css">'+
	' .JC_dotted-rule-jobs {'+
	' height: 1px;'+
	' background: url(http://www.gapersblock.com/gfx/rule_airbags.gif) bottom repeat-x;'+
	' margin: 0 0 5px 0;'+
	' }'+
	' .JC_dotted-rule-jobs-top {'+
	' height: 1px;'+
	' background: url(http://boards.jobcoin.com/linked/secure_images/rule_chicago_jobs.gif) bottom no-repeat;'+
	' margin: 0 0 0px 0;'+
	' }'+
	'</STYLE>');

JC_widget_body = '<img class="bpad" src="http://boards.jobcoin.com/linked/secure_images/gb_chicago_jobs.gif" alt="Chicago Jobs" />';

	for (var JC_i = 1; JC_i <= 3; JC_i++) {

		if(eval("typeof(JC_randomJob" + JC_i + "Link)") != "undefined") {

			JC_widget_body += '<p style="padding-bottom: 10px;"><a href="'+eval("JC_randomJob" + JC_i + "Link")+'">'+eval("JC_randomJob" + JC_i + "Title")+'</a><br>'+
				'<span class="by"><em>at</em> '+eval("JC_randomJob" + JC_i + "Company")+'</span></p>'+
				'<div class="JC_dotted-rule-jobs"></div>';
		}
	}

JC_widget_body += '<p><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td align="right"><a href="'+JC_viewallLink+'">...View all jobs</a></td></tr></table></p>';

document.write(JC_widget_body);

if (JC_first_in_column) {
	document.write('<div class="JC_dotted-rule-jobs-top"></div>');
}




// Load the optional floating element

window.onload=function(){

	//alert((location.host + location.pathname).toLowerCase());
	//if ((location.host + location.pathname).toLowerCase() == "boards.jobcoin.com/linked/gb4.html") {
	//alert(location.hash);

	if(location.hash != "") {

		//alert(Testing.offsetHeight);
		
		var y;
		if (self.pageYOffset) { // all except Explorer
			y = self.pageYOffset;
		} else if (document.documentElement && document.documentElement.scrollTop) {
			// Explorer 6 Strict
			y = document.documentElement.scrollTop;
		} else if (document.body) { // all other Explorers
			y = document.body.scrollTop;
		}

		var JC_finddiv = new Array();

		JC_finddiv = JC_getElementsByClass(document, "col-right", "div");
		JC_col = JC_finddiv[0];
	
		//var JC_col = document.getElementById("Testing");

		//alert(y + " > " + (JC_col.offsetHeight + 250 + 100));
		if (y > (JC_col.offsetHeight + 250 + 100)) {

			var JC_newdiv = document.createElement("div");
			JC_newdiv.style.cssText="position: absolute; width: 275px;";
			JC_newdiv.style.top = y+"px"; 
			JC_newdiv.innerHTML = '';
			JC_newdiv.innerHTML = '<div class="JC_dotted-rule-jobs-top"></div>'+JC_widget_body;
			JC_col.appendChild(JC_newdiv);
		}
	}
}

function JC_getElementsByClass(node,searchClass,tag) {

  var classElements = new Array();
  var els = node.getElementsByTagName(tag);
  var elsLen = els.length;
  var i;
  var j;

  for (i = 0, j = 0; i < elsLen; i++) {
    if (els[i].className == searchClass) {
      classElements[j] = els[i];
      j++;
    }
  }
return classElements;
}
