function get(id)
{return document.getElementById(id);}
function array_remove(arr,elt)
{var new_array=Array();for(var i=0;i<arr.length;i++)
if(arr[i]!=elt)
new_array.push(arr[i]);return new_array;}
function parseid(s,delim)
{var split_s=s.split(delim);var len=split_s.length;if(len<=0)
return"";return parseInt(split_s[len-1]);}
function whack_def_text(field,def_text)
{if(field.val()!=def_text)
return;field.val('');field.css('color','#454545');field.css('font','13px Tahoma, Helvetica, Arial, sans-serif');field.css('padding','2px 1px 3px')}
function whack_def_search(field,def_text,home_search)
{home_search=home_search||false;if(field.val()!=def_text)return;field.val('');field.css('font-style','normal');if(home_search){if(home_search=='404'){field.css('color','#454545');}else{field.css('color','#454545');field.css('font','20px Tahoma, Helvetica, Arial, sans-serif');field.css('padding','1px 0 0 0');}}else{field.css('color','#454545');field.css('font','13px Tahoma, Helvetica, Arial, sans-serif');field.css('padding','4px 3px 5px')}}
var __deleteme__=[];function bgFileUpload(iframeid,id,url,fileids,jsoncallback)
{while(__deleteme__.length>0)
__deleteme__.pop().remove();var iframe=get(iframeid);var mix=Math.floor(Math.random()*999999);var div=document.createElement('DIV');div.id="div-"+mix;div.innerHTML='<form style="position: absolute; top: -1200px; left: -1200px;" action="" method="POST" name="form-#XXX#" id="form-#XXX#" encoding="multipart/form-data" enctype="multipart/form-data"></form>'.replace(/#XXX#/g,id+'');document.body.appendChild(div);var form=get("form-"+id);var i=0;for(i=0;i<fileids.length;i++)
form.appendChild(get(fileids[i]).cloneNode(true));form.setAttribute('target',iframeid);form.setAttribute('action',url);var callbackfunk=function(){var resp=iframe;var txt='';var bod=null;try{if(resp.contentWindow)
txt=resp.contentWindow.document.body?resp.contentWindow.document.body.innerHTML:null;else if(resp.contentDocument)
txt=resp.contentDocument.document.body?resp.contentDocument.document.body.innerHTML:null;else
txt=resp.document.body?resp.document.body.innerHTML:null;}catch(e){txt=e.description;}
var result=jsoncallback(eval("("+txt.replace(/\<[pP][rR][eE]\>/g,'').replace(/\<\/[pP][rR][eE]\>/g,'')+")"));__deleteme__.push($('#div-'+mix));if(window.attachEvent)
iframe.detachEvent('onload',callbackfunk);else
iframe.removeEventListener('load',callbackfunk,false);return result;}
form.submit();if(window.attachEvent)
iframe.attachEvent('onload',callbackfunk);else
iframe.addEventListener('load',callbackfunk,false);return false;}
function addtolist(list,item)
{var li=[];var i=0;for(i=0;i<list.length;i++)
li[i]=list[i];li[list.length]=item;return li;}
function removefromlist(list,item)
{if(!list||list.length<=0)
return[];var li=[];var i=0;var j=0;for(i=0;i<list.length;i++)
if(list[i]!=item)
li[j++]=list[i];return li;}
var __preloadme__={};function bgImageLoad(imgid,src,alt,times)
{var img=get(imgid);var pre=get("pre-"+imgid);if(!pre){pre=new Image();__preloadme__["pre-"+imgid]=pre;}
pre.src=src;if(times--<0){img.src=alt;return;}
setTimeout("_checkImgLoad('"+imgid+"', '"+src+"', '"+alt+"', "+times+")",5000);}
function _checkImgLoad(imgid,src,alt,times)
{var img=get(imgid);var pre=__preloadme__['pre-'+imgid];if(img&&pre.complete&&pre.width>0){img.src=pre.src;return;}
return bgImageLoad(imgid,src,alt,times)}
function divup(html,width)
{var winwidth;if(typeof(window.innerWidth)=='number')
winwidth=window.innerWidth;else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))
winwidth=document.documentElement.clientWidth;else if(document.body&&(document.body.clientWidth||document.body.clientHeight))
winwidth=document.body.clientWidth;else
winwidth=750;var d=document;var b=d.getElementsByTagName('body')[0];var div=d.createElement('div');var mix=Math.floor(Math.random()*999999);div.id="div-"+mix;div.style.position='absolute';div.style.top='30%';div.style.left=((winwidth/2)-(width/2))+"px";div.style.width=width+"px";div.style.zindex=100;div.style.background='#fff';div.style.padding='10px';div.style.margin='10px';div.style.border='solid #000 1px';var str="<div style='text-align: right; width: 100%;'><a href='#' style='text-decoration: none;' class='removeme'>[ Close ]</a>  </div>";div.innerHTML=str+html.replace(/#XXX#/g,'"'+div.id+'"');b.appendChild(div);$(".removeme").click(function(){$("#div-"+mix).remove();return false;})
return false;}
function initAccord(){$("#accord-list > li > a").find("+ .accord-content").slideUp(1);$('#accord-list > li > a').click(function(){var checkElement=$(this).next();if((checkElement.is('div.accord-content'))&&(checkElement.is(':visible'))){$(this).find("+ .accord-content").slideToggle("fast");$(this).toggleClass("selected");}
if((checkElement.is('div.accord-content'))&&(!checkElement.is(':visible'))){var theClass=$(this).attr('class');$('#accord-list .accord-content:visible').slideUp('fast');$('#accord-list a.'+theClass).removeClass('selected');checkElement.slideDown('fast');$(this).addClass("selected");}});}
$(function(){$('a.new-window').click(function(){window.open(this.href,'New Window');return false;});});