function preview() {
  new Ajax.Updater (
    "result",
    "/preview/",
    {
      method: "post",
      parameters: {cat_id: $F('cat_id')}
    }
  );
}

function getJobs() {
	new Ajax.Updater (
		"jobs",
		"/extras/jobs/",
		{
			method: "get",	
			onLoading: transition
		}
	);
}

function transition() {
	var loader = $('jobs')
    loader.innerHTML = "<img style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"http://media.straightgrade.com/icons/ajax-loader-index.gif\" />"
}


function adjustIFrameSize(id, operaHeight) {
        var myIframe = document.getElementById(id);
        var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1];

        if (myIframe && !window.opera) {
                myIframe.style.display="block";
                        if (myIframe.contentDocument && myIframe.contentDocument.body.offsetHeight) {
                                myIframe.style.height = myIframe.contentDocument.body.offsetHeight + 10 +'px';
                        }
                        else if (myIframe.Document && myIframe.Document.body.scrollHeight) {
                                myIframe.style.height = myIframe.Document.body.scrollHeight;
                                }
				
        }
        else if (myIframe && window.opera) {
                myIframe.height = operaHeight;
        }

}

