function CheckSelect(variable,msg)
{for(i=0;;i++)
{thisVar=variable+'_'+i;obj=document.getElementById(thisVar);if(obj)
{if(obj.checked)
return true;}
else
break;}
window.alert(msg);return false;}
function CheckSearch(formObj,msg)
{if(document.forms[formObj].elements['keywords'].value=='')
{window.alert(msg);document.forms[formObj].elements['keywords'].focus();return false;}
else
return true;}
function CheckAll(element)
{for(i=0;;i++)
{var thisObj=document.getElementById(element+i);if(!thisObj)
break;thisObj.checked=true;}
return;}
function UncheckAll(element)
{var allObj=document.getElementById('all_'+element);var allVal=true;for(i=0;;i++)
{var thisObj=document.getElementById(element+i);if(!thisObj)
break;else if(!thisObj.checked)
{allVal=false;break;}}
allObj.checked=allVal;}
function printThis()
{document.styleSheets[0].disabled=true;document.styleSheets[1].disabled=false;window.print();setTimeout('printDone()',700);}
function printDone()
{document.styleSheets[1].disabled=true;document.styleSheets[0].disabled=false;}
function eCheckEMail(sn){s=sn.value;if(s.indexOf("@")==-1)return false;if(s.indexOf(".")==-1)return false;at=false;dot=false;for(var i=0;i<s.length;i++){ch=s.substring(i,i+1);if((ch>="A"&&ch<="Z")||(ch>="a"&&ch<="z")||(ch=="@")||(ch==".")||(ch=="_")||(ch=="-")||(ch>="0"&&ch<="9")){if(ch=="@"){if(at)return false;else at=true;}
if((ch==".")&&at)
dot=true;}
else return false;}
return dot;}
function CheckEMail(theForm,theEmailFields,theMsg){for(var i=0;i<theEmailFields.length;i++)
if(!eCheckEMail(theForm.elements[theEmailFields[i]])){alert(theMsg);theForm.elements[theEmailFields[i]].focus();return false;}
return true;}
function CheckRequiredFields(theForm,theRequiredFields,theMsg)
{for(i=0;i<theRequiredFields.length;i++)
if(theForm.elements[theRequiredFields[i]].type=="radio")
{var radioName=theForm.elements[theRequiredFields[i]].name;var radioLength=theForm.elements[radioName].length;for(n=0;n<radioLength;n++)
{if(theForm.elements[radioName][n].checked)
return true;}
alert(theMsg);theForm.elements[theRequiredFields[i]].focus();return false;}
else if(theForm.elements[theRequiredFields[i]].value==""){alert(theMsg);theForm.elements[theRequiredFields[i]].focus();return false;}
return true;}
function CheckForm(theForm,theEmailFields,theRequiredFields,theEmailMsg,theGlobalMsg){if(CheckRequiredFields(theForm,theRequiredFields,theGlobalMsg))
if(CheckEMail(theForm,theEmailFields,theEmailMsg))
return true;return false;}
function changeLang()
{var obj=$('#chlang')[0];var selectedVal=obj.options[obj.selectedIndex].value;if(selectedVal=="")
return;location.href=selectedVal;}
function CheckLogin(formObj,msg1,msg2,msg3)
{var usrVal=document.forms[formObj].elements['cuser'].value;var pasVal=document.forms[formObj].elements['cpass'].value;if(usrVal==""&&pasVal=="")
{window.alert(msg1);document.forms[formObj].elements['cuser'].focus();return false;}
else if(usrVal=="")
{window.alert(msg2);document.forms[formObj].elements['cuser'].focus();return false;}
else if(pasVal=="")
{window.alert(msg3);document.forms[formObj].elements['cpass'].focus();return false;}
else
return true;}
function menuOver(obj)
{obj.style.cssText="color:#cd9e40;background:#e2dddb;cursor:pointer;";}
function menuOut(obj)
{obj.style.cssText="color:white;background:none;cursor:none;";}
function menuClick(url)
{location.href=url;}
var currentDoc=-1;function switchDoc(obj,val)
{for(i=0;i<maxDoc;i++)
{if($('#first_doc_bg'+i)[0])
$('#first_doc_bg'+i)[0].className='first_doc_slides';$('#first_doc_img'+i)[0].style.display='none';$('#first_doc_con'+i)[0].style.display='none';}
$('#first_doc_img'+obj)[0].style.display=val;$('#first_doc_con'+obj)[0].style.display=val;if($('#first_doc_bg'+obj)[0])
$('#first_doc_bg'+obj)[0].className='slides_selected';}
function nextDoc()
{if(currentDoc<maxDoc-1)
currentDoc++;else
currentDoc=0;switchDoc(currentDoc,'block');}
function preDoc()
{if(currentDoc==0)
currentDoc=maxDoc-1;else
currentDoc--;switchDoc(currentDoc,'block');}
function playDocs(){nextDoc();if(maxDoc>1)
autoTimerID=window.setTimeout("playDocs()",timerSpeed);}
function stopDocs(){if(maxDoc<=1)
return;clearTimeout(autoTimerID);}
function resumeDocs(){if(maxDoc<=1)
return;clearTimeout(autoTimerID);autoTimerID=window.setTimeout("playDocs()",timerSpeed);}
function getMaxHeight(childVar,parentVar,isArray,maxDoc){var maxHeight=0;for(i=0;i<maxDoc;i++)
{$('#'+childVar+i).css("display","block");if($('#'+childVar+i).outerHeight()>maxHeight)
maxHeight=$('#'+childVar+i).outerHeight();$('#'+childVar+i).css("display","none");}
if(maxHeight<=0)
return;if(isArray)
{for(i=0;i<maxDoc;i++)
$('#'+parentVar+i).css("height",maxHeight);}
else
$('#'+parentVar).css("height",maxHeight);}
function switchTab(varIndex,thisVar,tabCounts)
{for(i=0;i<tabCounts;i++)
{$('#tab_content'+varIndex+'_'+i).css('display','none');$('.tab_button'+varIndex+'_'+i).removeClass('tab_button'+varIndex+'_'+i+'_over');}
$('.tab_button'+varIndex+'_'+thisVar).addClass('tab_button'+varIndex+'_'+thisVar+'_over');$('#tab_content'+varIndex+'_'+thisVar).fadeIn(300);}
function switchSectionTops(varIndex,varName)
{$("div[id^='sections_top"+varIndex+"_img']").css("display","none");$("div[id^='sections_top"+varIndex+"_til']").removeClass("main_div30_over");$('#sections_top'+varIndex+'_img'+varName).css("display","block");$('#sections_top'+varIndex+'_til'+varName).addClass("main_div30_over");}
function switchSpsection(varIndex)
{$("div[id^='spsection_content']").css("display","none");$("div[id^='spsection_tab']").removeClass("main_div34_over");$('#spsection_tab'+varIndex).addClass("main_div34_over");$('#spsection_content'+varIndex).fadeIn(300);}
function showAtch(){var dvObj=$("#attachments_div2");if(dvObj.css("visibility")!="visible"){dvObj.css("visibility","visible");$("#attachments_div2 object").css("visibility","visible");}}
function hideAtch(){var dvObj=$("#attachments_div2");if(dvObj.css("visibility")!="hidden"){dvObj.css("visibility","hidden");$("#attachments_div2 object").css("visibility","hidden");}}
var currentNews=0;var intTickSpeed=5000;function ClicktNav(varID){if(!arrNewsItems.length)
return;$('#'+varID).mouseup(function(){$(this).removeClass('tnav'+varID);}).mousedown(function(){$(this).addClass('tnav'+varID);});if(varID=="next")
nextNews();else if(varID=="back")
prevNews();}
function nextNews(){setNews(currentNews);}
function prevNews(){setNews(currentNews-2);}
function initTicker(){if(!arrNewsItems.length)
return;$("#ticker")[0].onmouseover=stopTicker;$("#ticker")[0].onmouseout=resumeTicker;$("#back")[0].onmouseover=stopTicker;$("#next")[0].onmouseover=stopTicker;$("#next")[0].onmouseout=resumeTicker;$("#back")[0].onmouseout=resumeTicker;playTicker();}
function stopTicker(){clearTimeout(tickerTimerID);}
function resumeTicker(){clearTimeout(tickerTimerID);tickerTimerID=self.setTimeout("playTicker()",intTickSpeed);}
function playTicker(){setNews(currentNews);tickerTimerID=self.setTimeout("playTicker()",intTickSpeed);}
function setNews(intPos)
{if(arrNewsItems.length<intPos+1)
intPos=0;else if(intPos<0)
intPos=arrNewsItems.length-1;strResults='';strResults+='<a href="'+arrNewsItems[intPos][1]+'" target="_top">';strResults+=arrNewsItems[intPos][0]+'</a>';$("#ticker_content").html(strResults);var thisWidth=$("#ticker_content").width();var thisHeight=$("#ticker_content").height();$("#ticker_typer").css({'width':thisWidth,'height':thisHeight}).animate({width:0},1000,function(){});currentNews=intPos+1;}