function handleTextField(tfield,op,deftext){switch(op){case'show':if(tfield.value=='')
tfield.value=deftext;break;case'hide':if(tfield.value==deftext)
tfield.value='';break;}
return true;}
function setActive(){url=document.location;if(window.location.hash){divId=window.location.hash;$(divId).addClass('focusedItem');}}
function loadPlayer(vidoeUrl,vidTarget){vid=new SWFObject("swf/player.swf","player","520","320","0","#000000");vid.addParam("allowfullscreen","true");vid.addParam("allowscriptaccess","always");vid.addParam("flashvars","file="+vidoeUrl+"&autostart=true&viral.onpause=false&viral.oncomplete=false");vid.addParam("wmode","opaque");if(vidTarget!==undefined&&vidTarget!==null){vid.write(vidTarget);}}
function closeLayer(){$('#loadOverlay').remove();$('.formFeedback').remove();}
function setEqualColHeights(){var col1H,col2H,eqH;col1H=$('div.mainCol').height();col2H=$('div.sideBar').height();if(col1H>col2H){eqH=col1H;}
else{eqH=col2H;}
$('div.mainCol').css('height',eqH+'px');$('div.sideBar').css('height',eqH+'px');}
function sendForm(){check=$('#do').val();name=$('#newsletterName').val();email=$('#newsletterEmail').val().match(/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/)?$('#newsletterEmail').val():null;errorMsg='';if(name.length==0||name==formLabelsObj.newslettername){errorMsg=errorMessages.nameError;$('#newsletterName').focus();}
else if(email==null){errorMsg=errorMessages.emailError;$('#newsletterEmail').focus();}
if(name.length==0||email===null){$('.formError').fadeIn(250,function(){$(this).css({'display':'block','height':$('#newsLetterForm').height+'px'}),$(this).html(errorMsg)});return false;}
else{$('.formError').fadeOut(250);$('<div id="loadOverlay"></div>').appendTo('#newsLetterForm').fadeIn(1000);$('div#loadOverlay').css('height',$('#newsLetterForm').height()+'px');$('div#loadOverlay').click(function(){closeLayer();})
$.ajax({type:'POST',dataType:'text',data:'do='+check+'&subscriber_name='+name+'&subscriber_email='+email,success:function(data){feedBackMsg='<div class="formFeedback" title="'+formLabelsObj.closelink+'">'+data+'</div>';document.getElementById('newsLetterForm').reset();$('#newsLetterForm').append(feedBackMsg);$('div#loadOverlay').css('background-image','none');$('.formFeedback').click(function(){closeLayer();})}});}
return false;}
function initSlideShow(){if(document.getElementById('headerSlideShow')){$('div#headerSlideShow').cycle({fx:'fade',timeout:5000,pause:1})
return true;}
else{return false;}}
$(document).ready(function(){if(document.getElementById('searchForm')){document.getElementById('txbQuery').value=formLabelsObj.search;}
if(document.getElementById('newsLetterForm')){if(formLabelsObj.newslettername!==''){document.getElementById('newsletterName').value=formLabelsObj.newslettername;}
if(formLabelsObj.newsletteremail!==''){document.getElementById('newsletterEmail').value=formLabelsObj.newsletteremail;}}
$('#txbQuery').focus(function(){handleTextField(this,'hide',formLabelsObj.search);$(this).animate({'width':'150px'},200);})
$('#txbQuery').blur(function(){handleTextField(this,'show',formLabelsObj.search);$(this).animate({'width':'90px'},200);})
$('#newsletterName').focus(function(){handleTextField(this,'hide',formLabelsObj.newslettername);})
$('#newsletterName').blur(function(){handleTextField(this,'show',formLabelsObj.newslettername);})
$('#newsletterEmail').focus(function(){handleTextField(this,'hide',formLabelsObj.newsletteremail);})
$('#newsletterEmail').blur(function(){handleTextField(this,'show',formLabelsObj.newsletteremail);})
if($.browser.msie&&$.browser.version.substr(0,1)<7){$('.jshover').hover(function(){$(this).addClass('hovered');},function(){$(this).removeClass('hovered');})}
$('.menu li:last-child').addClass('last');$('#newsLetterForm').submit(function(){return sendForm();})
if($.browser.msie&&$.browser.version.substring(0,1)<8){$('.jsfocus').focus(function(){$(this).addClass('focused')})
$('.jsfocus').blur(function(){$(this).removeClass('focused')})
$('.news').hover(function(){$(this).children('.fb').css('display','block');$(this).children('.twitter').css('display','block');$(this).children('.linkedin').css('display','block');},function(){$(this).children('.fb').css('display','none');$(this).children('.twitter').css('display','none');$(this).children('.linkedin').css('display','none');})}})
$(window).load(function(){initSlideShow();setEqualColHeights();})
