function cartoon()
{
	window.open('http://'+window.location.hostname+'/omarchives.html','Cartoon','height=345,width=258,scrollbars=no,toolbar=no,menubar=no,top=50,left=100,resizable=no');
}

function summers()
{
	window.open('lcsummerassociatepop.php','Summer','height=500,width=453,scrollbars=yes,toolbar=no,menubar=no,top=50,left=100,resizable=no');
}

function exclusive()
{
	OpenWin = this.open('lcexclusivepopup.php', "lcexclusive", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=246,height=152,top=100,left=100");
}

function popuptips()
{
	window.open('lcusagetipspopup.php','usagetips','height=268,width=264,scrollbars=yes,toolbar=no,menubar=no,top=50,left=100,resizable=no');
}

function popuppostnewjob(url)
{
	window.open(url,'NewWindow','height=200,width=350,scrollbars=yes,toolbar=no,menubar=no,top=50,left=100,resizable=no');
}

function mailnewswiretofriend(url)
{

	var strurl = "http://"+window.location.hostname+"/lcmailtocolleague.php?a=a";
	alert(strurl);
  	if(typeof(url)!="undefined")
		strurl = strurl + "&url=" + escape(url);
	window.open(strurl,'mailtocollegue','height=383,width=355,scrollbars=yes,toolbar=no,menubar=no,top=80,left=100');
}

//Made this function to work with
//left hand side quick links as add
//logos of other sites with link to that
//side. Have to open that site in new window
// with smallar size. Made by sachin on 2006-01-07
function leftsidemenu_openadvurl(url)
{
   var openurl="";
   if(url=="lsl"){ openurl = "http://www.lawschoolloans.com"; }
   else if(url=="ar"){ openurl="http://www.attorneyresume.com"; }
   else if(url=="la"){ openurl="http://www.legalauthority.com"; }
   else if(url=="bcg"){ openurl="http://www.bcgsearch.com"; }
   else if(url=="gj"){ openurl="http://www.goodjob.com/"; }
   else if(url=="judged"){ openurl="http://www.judged.com/"; }
   else if(url=="lc_postjob"){ openurl="http://www.lawcrossing.com/lctellusaboutjob.php"; }
   else if(url=="lfs_postjob"){ openurl="http://www.lawfirmstaff.com/erc/index.html"; }
   else if(url=="gj_postjob"){ openurl="http://www.gjonsulting.com/employer_resources.html"; }
   else if(url=="bcg_postjob"){ openurl="http://www.bcgsearch.com/"; }

   window.open(openurl,"","height=400,width=400,left=400,top=40,menubar=yes,location=yes,toolbar=yes,resizable=yes,scrollbars=yes,status=yes");
}


// from arg 28/08/2006 - added by mayur
function Set_Cookie( name, value, expires, path, domain, secure )
{
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	alert(value);
	/*
	if the expires variable is set, make the correct
	expires time, the current script below will set
	it for x number of days, to make it for hours,
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires )
	{
	expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
	( ( path ) ? ";path=" + path : "" ) +
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}

function Get_Cookie( name ) {

var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}


function MoveOption(objSourceElement, objTargetElement,flag)
{
	var aryTempSourceOptions = new Array();
	var x = 0;
 	//looping through source element to find selected options
	for (var i = 0; i < objSourceElement.length; i++) {
		if (objSourceElement.options[i].selected)
		{
			//if(flag != "D")
			//{
				var bln=true;
				for (var j = 0; j < objTargetElement.length; j++)
				{
					 if(objTargetElement.options[j].value == objSourceElement.options[i].value)
					 {
					 	bln=false;
					 }
				}
				if(bln)
				{
					//need to move this option to target element
					var intTargetLen = objTargetElement.length++;
					objTargetElement.options[intTargetLen].text = objSourceElement.options[i].text;
					objTargetElement.options[intTargetLen].value = objSourceElement.options[i].value;
				}
			//}
			//objSourceElement.options[i].selected=false;
	 	}

		else {
			//if(flag=="D")
			//{
				//storing options that stay to recreate select element
				var objTempValues = new Object();
				objTempValues.text = objSourceElement.options[i].text;
				objTempValues.value = objSourceElement.options[i].value;
				aryTempSourceOptions[x] = objTempValues;
				x++;
			//}
		}
 	}

	//if(flag=="D")
	//{
		//resetting length of source
		objSourceElement.length = aryTempSourceOptions.length;
		//looping through temp array to recreate source select element
		for (var i = 0; i < aryTempSourceOptions.length; i++)
		 {
			objSourceElement.options[i].text = aryTempSourceOptions[i].text;
			objSourceElement.options[i].value = aryTempSourceOptions[i].value;
			objSourceElement.options[i].selected = false;
		}
	//}
	var listobj;
	if(flag=="D")
	{
		listobj=objSourceElement
	}
	else
		listobj=objTargetElement

	var idstring,textstring;
	idstring="";
	textstring="";
	for (var j = 0; j < listobj.length; j++)
	{
		if(listobj.options[j].value != -1)
		{
			if(j!=listobj.length-1)
			{
				idstring=idstring+listobj.options[j].value+",";
				textstring=textstring+listobj.options[j].text+",<br>";
			}
			else
			{
				idstring=idstring+listobj.options[j].value;
				textstring=textstring+listobj.options[j].text;
			}
		}
	}
	Set_Cookie("IdString", idstring);
	Set_Cookie("TextString", textstring);
}

function checkEmailX(strng,fieldcaption)
{
	var error = "";
	if (strng == "")
		{
		error = "You did not enter an "+fieldcaption+".\n";
		}
	var emailFilter=/^.+@.+\..{2,4}$/;
	if (!(emailFilter.test(strng)))
		{
		error = "Please enter a valid "+fieldcaption+".\n";
		}
	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/;
	if(strng.match(illegalChars))
		{
		error = "The "+fieldcaption+" contains illegal characters.\n";
		}
	return error;
}

function alwaysontop()
{
	window.focus();
}

//FOR FEDERAL EXIT
function show_too_busy()
{
	return overlib(loan,
	 STICKY, CAPTION,' ', CAPTIONPADDING,4, TEXTPADDING,8,
	 CGCLASS,'olcg', FGCLASS,'olfg', CAPTIONFONTCLASS,'olcap', TEXTFONTCLASS,'oltxt',
	 CLOSETEXT,myClose, CLOSECLICK, MIDX,0, MIDY,0, WRAP, BASE,3, SCROLL,
	 DRAGGABLE, SHADOW, SHADOWX,-1, SHADOWY,-1,
	 STATUS,'STICKY popup with link and secondary popup and FILTER for IE v5.5+',
	 FILTER);
}


function checkspecialchar(alphane)
{
	var str = alphane;
	for(var j=0; j<str.length; j++)
	{
		var alphaa = str.charAt(j);
		var chrcode = alphaa.charCodeAt(0);
		if((chrcode > 47 && chrcode<59) || (chrcode > 64 && chrcode<91) || (chrcode > 96 && chrcode<123) || chrcode==95)
		{
		}
		else
		{
			return false;
		}
	}
	return true;
}

function checkspecialcharexceptspace(alphane)
{
	var str = alphane;
	for(var j=0; j<str.length; j++)
	{
		var alphaa = str.charAt(j);
		var chrcode = alphaa.charCodeAt(0);
		if((chrcode > 47 && chrcode<59) || (chrcode > 64 && chrcode<91) || (chrcode > 96 && chrcode<123) || chrcode==95 || chrcode == 32)
		{
		}
		else
		{
			return false;
		}
	}
	return true;
}

function trim(value) {
   var temp = value;
   var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
   if (obj.test(temp)) { temp = temp.replace(obj, '$2'); }
   var obj = /  /g;
   while (temp.match(obj)) { temp = temp.replace(obj, " "); }
   return temp;
}
function showcuttext(id)
{
	var objmultiplecombo=document.getElementById(id);
	var showfulltext;
	showfulltext = '';

	for (var j = 0; j < objmultiplecombo.length; j++)
	{
		if(objmultiplecombo.options[j].value != -1 && objmultiplecombo.options[j].selected)
		{
			if(objmultiplecombo.options[j].text.length>42)
			{
				showfulltext += objmultiplecombo.options[j].text + '<br>';
			}
		}
	}

	document.getElementById('showfulltext').innerHTML = showfulltext;
}

// Modification By :: Jitendra Gohi
// Date : 10th May, 2007

function hidediv(id)
{
	jobid = id;	
	id = 'hideshow_'+ id;
		
	if (document.getElementById)
	{ // DOM3 = IE5, NS6
		document.getElementById(id).style.visibility = 'hidden';
		document.getElementById(id).style.position='absolute';
		
		document.getElementById('txtareanote_'+jobid).value = document.getElementById('txtareanote_hdn_'+jobid).value;
		document.getElementById('txtboxnotealert_'+jobid).value = document.getElementById('txtareanotealert_hdn_'+jobid).value;
	}
	else
	{
		if (document.layers)
		{ // Netscape 4
			document.combinedid.visibility = 'hidden';
			document.combinedid.position='absolute';
		}
		else
		{ // IE 4
			document.all.id.style.visibility = 'hidden';
			document.all.id.style.position = 'absolute';
		}
	}
}


function showdiv(id) {
	if (document.getElementById)
	{ // DOM3 = IE5, NS6
		document.getElementById(id).style.visibility = 'visible';
		document.getElementById(id).style.display = 'block';
		document.getElementById(id).style.position='relative';
	}
	else
	{
		if (document.layers)
		{ // Netscape 4
			document.id.visibility = 'visible';
			document.getElementById(id).style.display = 'block';
			document.id.position='relative';
		}
		else
		{ // IE 4
			document.all.id.style.visibility = 'visible';
			document.getElementById(id).style.display = 'block';
			document.all.id.style.position = 'relative';
		}
	}
}

function opacity(id, opacStart, opacEnd, millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
	var object = document.getElementById(id).style;
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}

function shiftOpacity(id, millisec) {
	alert(id);
	alert(millisec);
	//if an element is invisible, make it visible, else make it ivisible
	if(document.getElementById(id).style.opacity == 0) {
		opacity(id, 0, 100, millisec);
	} else {
		opacity(id, 100, 0, millisec);
	}
}

function blendimage(divid, imageid, imagefile, millisec) {
	var speed = Math.round(millisec / 100);
	var timer = 0;

	//set the current image as background
	document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";

	//make image transparent
	changeOpac(0, imageid);

	//make new image
	document.getElementById(imageid).src = imagefile;

	//fade in image
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
		timer++;
	}
}

function currentOpac(id, opacEnd, millisec) {
	//standard opacity is 100
	var currentOpac = 100;

	//if the element has an opacity set, get it
	if(document.getElementById(id).style.opacity < 100) {
		currentOpac = document.getElementById(id).style.opacity * 100;
	}

	//call for the function that changes the opacity
	opacity(id, currentOpac, opacEnd, millisec)
}
/**
 * Function for set focus on any filed.
 *
 * @param string formname < name of the form >
 * @param string fieldname <name of the field >
 *
 * @author Pratik Shah
 * @since  2-11-2006.
 */
function setfocus(formname,fieldname)
{
	var doc = "document.";
	eval(doc+formname+"."+fieldname+".focus()");
}
/**
 * Function added for the purpose of add search boxes on each page other than index.
 */
function checkfieldsmall()
{
	document.formsearch.clsjobsearch_hdnaction.value="Search";
	document.formsearch.submit();
}


function getCookie( name ) {
  var start = document.cookie.indexOf( name + "=" );
  var len = start + name.length + 1;
  if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
    return null;
  }
  if ( start == -1 ) return null;
  var end = document.cookie.indexOf( ";", len );
  if ( end == -1 ) end = document.cookie.length;
  return unescape( document.cookie.substring( len, end ) );

}

function deleteCookie( name, path, domain ) {
  if ( getCookie( name ) ) document.cookie = name + "=" +
    ( ( path ) ? ";path=" + path : "") +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

//  For AJAX Component
function createRequestObject()
{
	 var request_o;
	 var browser = navigator.appName;
	 if(browser == "Microsoft Internet Explorer")
	 {
	 	 request_o = new ActiveXObject("Microsoft.XMLHTTP");
	 }
	 else
	 {
	 	 request_o = new XMLHttpRequest();
	 }
	 return request_o;
}

function isSelected_Form_CheckBoxArray(formname,objname)
{
	var chkflg,strmessageid,url,returl;
	strmessageid="";
	chkflg=false;
	for(j=0; j<document.forms.length;j++)
	{
		if(document.forms[j].name==formname)
		{
			for (i=0;i<document.forms[j].elements.length;i++)
			{
				if (document.forms[j].elements[i].name==objname)
				{
					if (document.forms[j].elements[i].checked)
					{
						chkflg=true;
						break;
					}
				}
			}
		}
	}
	return chkflg;
}
/** checkbox function start */
function ChkValidate(frm,chkname){
	var validflag = false;
	for (i=0;i<document.forms[frm].elements.length;i++)
	{
		if (document.forms[frm].elements[i].name == chkname && document.forms[frm].elements[i].checked)
		{
			validflag = true;
			break;
		}
	}
	return validflag;
}
function chk_uncheck(frm,chkname,chkallobj){
	if(chkallobj.checked == true){
		checkAll(frm,chkname);
	} else {
		uncheckAll(frm,chkname)
	}
	return true;
}
function checkAll(frm,chkname)
{
     var docF=document.forms[frm];
     for(var i=0;i<docF.elements.length;i++)
     {
          if(docF.elements[i].name==chkname && docF.elements[i].type=="checkbox")
               docF.elements[i].checked=true;
     }
	 return true;
}

function checkState(frm,chkname,chkallname)
{
	var flg=true;
	var docF=document.forms[frm];
    for(var i=0;i<docF.elements.length;i++)
    {
       if(docF.elements[i].name==chkname && docF.elements[i].type=="checkbox")
		{
	  		if(docF.elements[i].checked==false)
			{
				flg=false;
				break;
			}
		 }
     }
     document.getElementById(chkallname).checked=flg;
     return true;
}
/** checkbox function end */
function urlencode(url) 
{ 
	return escape(url).replace(/\+/g,'%2B').replace(/\//g,'%2F').replace(/%20/g,'+'); 
} 


/*
This method is used to Send HTTP request.
*/
function sendHTTPRequest(uri, method, control, callback ) 
{
	//alert(callback);
	var req = createRequestObject();
	  if (!method) method = 'get';
	 //alert(req); 
	 req.open(method, uri, true);
	 req.onreadystatechange = function() { callback(req,control); };
	 req.send(null);
}
