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_sc'+i)[0].style.display='none';}
$('#first_doc_sc'+obj).fadeIn(300);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(){if(maxDoc<=1)
return;var maxHeight=0;for(i=0;i<maxDoc;i++)
{$('#first_doc_sc'+i)[0].style.display="block";if($('#first_doc_sc'+i)[0].offsetHeight>maxHeight)
maxHeight=$('#first_doc_sc'+i)[0].offsetHeight;$('#first_doc_sc'+i)[0].style.display="none";}
for(i=0;i<maxDoc;i++)
$('#first_doc_sc'+i)[0].style.height=maxHeight;}
function SwitchDiv(CurrentSel,tabPrefix,tabAlign)
{var maxHeight=0;var tabCounter=eval(tabPrefix+'TabCounter');var buttonContainerID=eval(tabPrefix+'BcontainerID');var selectedClass=eval(tabPrefix+'selectedClass');var unSelectedClass=eval(tabPrefix+'unSelectedClass');var tabPositioning=eval(tabPrefix+'Positioning');var addtopPos=eval(tabPrefix+'TopPos');var tabPadding=eval(tabPrefix+'TabPad');if(!tabPositioning)
{for(i=0;i<tabCounter;i++)
{var buttonHeight=$('#'+tabPrefix+'_tab_button'+i).height();if(buttonHeight>maxHeight)
maxHeight=buttonHeight;}
$('#'+buttonContainerID).css("height",maxHeight);for(i=0;i<tabCounter;i++)
{var thisbObj=$('#'+tabPrefix+'_tab_button'+i);var thisPos=0;for(n=0;n<i;n++){thisPos+=$('#'+tabPrefix+'_tab_button'+n).width();}
thisbObj.css(tabAlign,thisPos+(i+(i*tabPadding)));thisbObj.css("height",maxHeight);}
var contentMaxHeight=0;for(i=0;i<tabCounter;i++)
{var thisTabcontentOBJ=$('#'+tabPrefix+'_tab_content'+i+" table:only-child");var contentHeight=thisTabcontentOBJ.height();if(contentHeight>contentMaxHeight)
contentMaxHeight=contentHeight;}
for(i=0;i<tabCounter;i++)
$('#'+tabPrefix+'_tab_content'+i+" table:only-child").height(contentMaxHeight);eval(tabPrefix+'Positioning=true;'+tabPrefix+'maxHeight='+maxHeight+';');}
var tabTopPos=eval(tabPrefix+'maxHeight');var selbtJQ=$('#'+tabPrefix+'_tab_button'+CurrentSel);selbtJQ.attr("class",selectedClass);selbtJQ.css("top",selbtJQ.height()-tabTopPos+addtopPos);$('#'+tabPrefix+'_tab_content'+CurrentSel).fadeIn(300);for(i=0;i<tabCounter;i++)
{if(i==CurrentSel)
continue;var buttonJQ=$('#'+tabPrefix+'_tab_button'+i);var ContentJQ=$('#'+tabPrefix+'_tab_content'+i);if(!buttonJQ||!ContentJQ)
continue;buttonJQ.attr("class",unSelectedClass);buttonJQ.css("top",0);ContentJQ.css("display","none");}}
function getBoxMaxHeight(container,count,addHeight)
{var maxHeight=0;for(i=0;i<count;i++){if($('#'+container+i).height()>maxHeight)
maxHeight=$('#'+container+i).height();}
for(i=0;i<count;i++){$('#'+container+i).height(maxHeight+addHeight);}}
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;}