function isset(obj) {
    if(typeof obj != 'undefined' && obj != null && obj != '') {
        return true;
    }
    return false;
}

function unset(getarray,getKeyValue,keyOrValue){
    var newArray = new Array();
    for (var i = 0; i < getarray.length; i++) {
        if(keyOrValue == 'value') {
            if(getarray[i] != getKeyValue) {
                newArray[i] = getarray[i];
            }
        } else {
            if(i != getKeyValue) {
                newArray[i] = getarray[i];
            }
        }
    }
    return newArray;
}

function showdiv (FirstDiv, SecondDiv, ThirdDiv)
{
	$(FirstDiv).style.display = 'inline';
   	$(SecondDiv).style.display = 'none';
	$(ThirdDiv).style.display = 'none';
}

function confirmDelete(anchor)
{
	if (confirm('Are you sure you want to delete this row?'))
   {
   	anchor.href += '&confirm=1';
		return true;
	}
	return false;
}


function in_array(needle, haystack, assoc)
{
	if( !assoc || assoc == '' )
	{
		for( var i=0; i<haystack.length; i++ )
		{
			if( haystack[i] == needle )
			{
				return true;
			}
		}
	}
	else
	{
		if( assoc == 'key' )
		{
			for( var key in haystack)
			{
				if( key == needle )
				{
					return true;
				}
			}
		}
		else
		{
			for( var key in haystack )
			{
				if( haystack[key] == needle )
				{
					return true;
				}
			}
		}
	}
	return false;
}

var tgs = new Array( 'div','td','tr','p');
var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
var lines = new Array( '5px','10px','15px','20px','25px','30px','35px' );
var startSz = 1;

function resizer( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null, sz=startSz , i, j, cTags;

	sz += inc;
	if ( sz < 1 ) sz = 1;
	if ( sz > 5 ) sz = 5;
	startSz = sz;

	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];
	cEl.style.lineHeight = lines[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ )
		{
			cTags[ j ].style.fontSize = szs[ sz ];
			cTags[ j ].style.lineHeight = lines[ sz ];
		}
	}
}



function serializeHash(){
    var getdata = window.location.hash;
    var data = getdata.replace(/-/g,'=').replace(/\//g,'&').replace('#','');
    return data;
}