// create resuable short name for jQuery no conflict
var $j = jQuery.noConflict();
function addBookmark() {
// browser checking and branching, since not all browsers allow bookmark the exact same way.
// set the rel attribute for the link to sidebar so that Opera will pick this up. This may not be necessary for new versions though -- test out later
if(window.opera){
if($j('div#bookmark a').attr('rel') != "") {
$j('div#bookmark a').attr('rel','sidebar');
}
}
$j('div#bookmark a').click(function(event) {
event.preventDefault(); // this prevents the default behavior of the anchor link to follow the href value
var url = this.href; // this assigns the current page's href value to the var 'url'
var title = this.title; // this assigns the current page's title value to the var 'title'
// now lets check to see which browser the user is using!
if(window.sidebar) {
window.sidebar.addPanel(title, url,"");
} else if (window.external){
window.external.AddFavorite(url, title);
} else {
alert('Please use "Ctrl-D (PC Win) or Cmd-D (Mac OS)" to bookmark this page.');
}
});
}
function showLanguage(obj) {
// this shows and hides the language selector
$j('a#showLanguages').attr('href','#');
$j('a#showLanguages').click(function(event) {
$j('ul.ulLanguages ul').toggleClass('show'); // basically adds the class 'show' which is set to display: block; in global.css
if($j('#closeLink').length == 0)
$j('
Close').appendTo('ul.ulLanguages ul'); // add a close link to the list since this is a dynamic list built :: this would be better if it could be handled by backend when list is built dynamically
$j('li#closeLink a').click(function(event) {
$j('ul.ulLanguages ul').removeClass('show');
$j('li#closeLink').remove();
return false;
});
return false;
});
}
function fixIE6DropDown(el) {
$j(el).hover(function(){$j(this).addClass('hover');},function(){$j(this).removeClass('hover');});
}
function resizeVideo() {
$j('object').css({width:'220px',height:'178px'});
$j('embed').css({width:'220px',height:'178px'});
}
function showInlineEditbar(){
if($j('.scWebEditInput'))
{
$j('.scWebEditInput').mouseover(function(event) {
var parentDiv = $j(this).parents('div');
var flag = true;
parentDiv.each(function(index) {
if($j(this).attr('id') == 'middleArea')
{
flag = false;
}
});
if(!flag)
return false;
parentDiv.each(function(index) {
var cssOverflow = $j(this).css('overflow');
if(cssOverflow == 'hidden')
{
$j(this).css('overflow','visible');
$j(this).mouseout(function(event) {
$j(this).css('overflow','hidden');
});
return false;
}
});
});
$j('.scWebEditFrameButtons').mouseover(function(event) {
var parentDiv = $j(this).parents('div');
var flag = true;
parentDiv.each(function(index) {
if($j(this).attr('id') == 'middleArea')
{
flag = false;
}
});
if(!flag)
return false;
parentDiv.each(function(index) {
var cssOverflow = $j(this).css('overflow');
if(cssOverflow == 'hidden')
{
$j(this).css('overflow','visible');
$j(this).mouseout(function(event) {
$j(this).css('overflow','hidden');
});
return false;
}
});
});
}
}
$j(document).ready(function () {
showInlineEditbar();
resizeVideo();
addBookmark();
showLanguage();
$j('#podWrap .pod:odd').addClass('podAlt');
//updateNavZIndex();
});