jQuery(document).ready(function($){
                var max_height=0;
                $(".view-id-search_glossary .view-content table").each(function(){
                                max_height +=$(this).height();
                });
                
                //find all slice that height is just less than max_height/2
                var h=0;
                for (c1=0;c1<$(".view-id-search_glossary .view-content table").length;c1=c1+1){
                                h=h+$(".view-id-search_glossary .view-content > table:eq("+c1+")").height();
                                if (h>=max_height/2)
                                                break;
                }
                $(".view-id-search_glossary .view-content > table").slice(0,c1+1).wrapAll("<div class='col1' />");
                $(".view-id-search_glossary .view-content > table").slice(0,$(".view-id-search_glossary .view-content > table").length).wrapAll("<div class='col2' />");

});;
/*
 
 jQuery Tools 1.2.5 / Flashembed - New wave Flash embedding

 NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.

 http://flowplayer.org/tools/toolbox/flashembed.html

 Since : March 2008
 Date  :    Wed Sep 22 06:02:10 2010 +0000 
*/
(function(){function f(a,b){if(b)for(var c in b)if(b.hasOwnProperty(c))a[c]=b[c];return a}function l(a,b){var c=[];for(var d in a)if(a.hasOwnProperty(d))c[d]=b(a[d]);return c}function m(a,b,c){if(e.isSupported(b.version))a.innerHTML=e.getHTML(b,c);else if(b.expressInstall&&e.isSupported([6,65]))a.innerHTML=e.getHTML(f(b,{src:b.expressInstall}),{MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title});else{if(!a.innerHTML.replace(/\s/g,"")){a.innerHTML="<h2>Flash version "+b.version+
" or greater is required</h2><h3>"+(g[0]>0?"Your version is "+g:"You have no flash plugin installed")+"</h3>"+(a.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='"+k+"'>here</a></p>");if(a.tagName=="A")a.onclick=function(){location.href=k}}if(b.onFail){var d=b.onFail.call(this);if(typeof d=="string")a.innerHTML=d}}if(i)window[b.id]=document.getElementById(b.id);f(this,{getRoot:function(){return a},getOptions:function(){return b},getConf:function(){return c},
getApi:function(){return a.firstChild}})}var i=document.all,k="http://www.adobe.com/go/getflashplayer",n=typeof jQuery=="function",o=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,j={width:"100%",height:"100%",id:"_"+(""+Math.random()).slice(9),allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:[3,0],onFail:null,expressInstall:null,w3c:false,cachebusting:false};window.attachEvent&&window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}});
window.flashembed=function(a,b,c){if(typeof a=="string")a=document.getElementById(a.replace("#",""));if(a){if(typeof b=="string")b={src:b};return new m(a,f(f({},j),b),c)}};var e=f(window.flashembed,{conf:j,getVersion:function(){var a,b;try{b=navigator.plugins["Shockwave Flash"].description.slice(16)}catch(c){try{b=(a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"))&&a.GetVariable("$version")}catch(d){try{b=(a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"))&&a.GetVariable("$version")}catch(h){}}}return(b=
o.exec(b))?[b[1],b[3]]:[0,0]},asString:function(a){if(a===null||a===undefined)return null;var b=typeof a;if(b=="object"&&a.push)b="array";switch(b){case "string":a=a.replace(new RegExp('(["\\\\])',"g"),"\\$1");a=a.replace(/^\s?(\d+\.?\d+)%/,"$1pct");return'"'+a+'"';case "array":return"["+l(a,function(d){return e.asString(d)}).join(",")+"]";case "function":return'"function()"';case "object":b=[];for(var c in a)a.hasOwnProperty(c)&&b.push('"'+c+'":'+e.asString(a[c]));return"{"+b.join(",")+"}"}return String(a).replace(/\s/g,
" ").replace(/\'/g,'"')},getHTML:function(a,b){a=f({},a);var c='<object width="'+a.width+'" height="'+a.height+'" id="'+a.id+'" name="'+a.id+'"';if(a.cachebusting)a.src+=(a.src.indexOf("?")!=-1?"&":"?")+Math.random();c+=a.w3c||!i?' data="'+a.src+'" type="application/x-shockwave-flash"':' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';c+=">";if(a.w3c||i)c+='<param name="movie" value="'+a.src+'" />';a.width=a.height=a.id=a.w3c=a.src=null;a.onFail=a.version=a.expressInstall=null;for(var d in a)if(a[d])c+=
'<param name="'+d+'" value="'+a[d]+'" />';a="";if(b){for(var h in b)if(b[h]){d=b[h];a+=h+"="+(/function|object/.test(typeof d)?e.asString(d):d)+"&"}a=a.slice(0,-1);c+='<param name="flashvars" value=\''+a+"' />"}c+="</object>";return c},isSupported:function(a){return g[0]>a[0]||g[0]==a[0]&&g[1]>=a[1]}}),g=e.getVersion();if(n){jQuery.tools=jQuery.tools||{version:"1.2.5"};jQuery.tools.flashembed={conf:j};jQuery.fn.flashembed=function(a,b){return this.each(function(){$(this).data("flashembed",flashembed(this,
a,b))})}}})();
;
jQuery(document).ready(function() {
 //jQuery("#views-exposed-form-jobs-board-page").attr("action", "/jobs/jobs-result");
 //jQuery("#views-exposed-form-advanced-jobs-board-page").attr("action", "/jobs/jobs-advanced-result");
  
	jQuery("#edit-field-trade-und").click(function(){

	if(jQuery(this).val()==156){
		jQuery("#edit-field-other-trade").fadeIn("fast");
	}else{
		  jQuery("#edit-field-other-trade").fadeOut("fast");
	}

	});
 
/*
	jQuery(".form-item-field-expiry-date-und-0-value-date").append('<div class="date-error" style="display:none;">Date must be less than 2 months in the future</div>')

	jQuery("#edit-field-expiry-date-und-0-value-datepicker-popup-0").change(function(){

		var d=jQuery("#edit-field-expiry-date-und-0-value-datepicker-popup-0").val();
	    var d1 = new Date(d);
		var today = new Date();
    //If date is more than 2 months in future
		if ((d1.getTime()-today.getTime())>5184000000){
			jQuery(".date-error").show();
		}else{
			jQuery(".date-error").hide();        
		}
	});
 */
  
  //hack to make content into link
var h=jQuery(".field-name-field-another-website .field-item").html();
jQuery(".field-name-field-another-website .field-item").empty();
jQuery(".field-name-field-another-website .field-item").append("<a href='"+h+"' target='_blank'>"+h+"</a>");
  
});

