$(document).ready(
function(){
$mq = $('.teaser_news').marquee({duration: 10000});
$('.teaser_news h2').click(function(){$mq.marquee('toggle')});
$('.teaser_news_fix').click(function(){
$mq.marquee('destroy');
$('.teaser_news h2').css('display','block');
$('.teaser_news h2').css('cursor','text');
$('.teaser_news').css('height','225px');
$('.teaser_news_fix').hide();
});
}
);
$.fn.scrollView = function () {
return this.each(function () {
$('html, body').animate({
scrollTop: $(this).offset().top
}, 1000);
});
}
function infoblock_toggle(div_id){
var icon_id = '#icon_' + div_id;
var title_id = '#title_' + div_id;
var idd = '#' + div_id;
var displayed = document.getElementById(div_id).style.display;
$(idd).slideToggle(600);
if (displayed == 'block'){
$.cookie(idd, 'collapsed', {expires: 7, path: '/', domain: 'synth.market'});
$(icon_id).attr('src', "/_img/icon_expand.gif");
$(title_id).attr('title', "Expand the info block");
$(title_id).css('text-decoration', 'none');
}
else {
$.cookie(idd, 'expanded', {expires: 7, path: '/', domain: 'synth.market'});
$(icon_id).attr('src', "/_img/icon_collapse.gif");
$(title_id).attr('title', "Minimize the info block");
$(title_id).css('text-decoration', 'underline');
}
}
function div_toggle(div_id){
var idd = '#' + div_id;
if (document.cookie == "") {
if (document.getElementById(div_id).style.display == 'block'){
$(idd).slideToggle(600);
$.cookie(idd, 'collapsed', {expires: 7, path: '/', domain: 'synth.market'});
}
else {
$(idd).slideToggle(600);
$.cookie(idd, 'expanded', {expires: 7, path: '/', domain: 'synth.market'});
}
}
else {
if ($.cookie(idd) == 'collapsed') {
$(idd).slideToggle(600);
$.cookie(idd, 'expanded', {expires: 7, path: '/', domain: 'synth.market'});
}
else {
$(idd).slideToggle(600);
$.cookie(idd, 'collapsed', {expires: 7, path: '/', domain: 'synth.market'});
}
}
}
function topmenu_toggle(div_id){
var topmenu_div_id = '#topmenu' + div_id;
var submenu_div_idd = 'submenu' + div_id;
var submenu_div_id = '#submenu' + div_id;
$('.shop_submenu_synths,.shop_submenu_guitars,.shop_subsubmenu').hide('slow');
$('.market_topmenu,.market_submenu,.market_subsubmenu').hide('slow');
if ($(submenu_div_id).css('display') == 'block') {
$('.shop_topmenu_synths span, .shop_topmenu_guitars span').removeClass('actlink');
}
else {
$('.shop_topmenu_synths span, .shop_topmenu_guitars span').removeClass('actlink');
div_toggle(submenu_div_idd);
$(topmenu_div_id).toggleClass('link actlink');
}
//$('.shop_topmenu_synths span, .shop_topmenu_guitars span').removeClass('actlink');
}
function market_topmenu_toggle(div_id){
var topmenu_div_id = '#market_topmenu' + div_id;
var submenu_div_idd = 'market_submenu' + div_id;
var submenu_div_id = '#market_submenu' + div_id;
$('.market_submenu,.market_subsubmenu').hide('slow');
$('.shop_topmenu,.shop_submenu,.shop_subsubmenu').hide('slow');
if ($(submenu_div_id).css('display') == 'block') {
$('.market_topmenu span').removeClass('actlink');
}
else {
$('.market_topmenu span').removeClass('actlink');
div_toggle(submenu_div_idd);
$(topmenu_div_id).toggleClass('link actlink');
}
//$('.market_topmenu span').removeClass('actlink');
}
function slideSwitch() {
var $active = $('#fpslideshow #frames_list div.active');
if ( $active.length == 0 ) $active = $('#fpslideshow #frames_list div:last');
var $next = $active.next().length ? $active.next() : $('#fpslideshow #frames_list div:first');
var f_id = $next.data('id');
$('#fpslideshow #frames_links span').removeClass('active');
$('#fpslideshow #frames_links span#framelink'+f_id).addClass('active');
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 2000, function() {
$active.removeClass('active last-active');
});
}
$(function(){
var refresh_id = setInterval("slideSwitch()",5000);
$('#fpslideshow #frames_links span').click(function(){
var frame_id = '#fpslideshow div#frame'+ $(this).data('id');
$('#fpslideshow #frames_links span').removeClass('active');
$(this).addClass('active');
$('#fpslideshow div').removeClass('active');
$(frame_id).addClass('active');
});
if ($('#fpslideshow #frames_links span.active').length == 0) $('#fpslideshow #frames_links span:first').addClass('active');
$('#fpslideshow').hover(function(slideSwitch){
clearInterval(refresh_id);
}, function(slideSwitch){
refresh_id = setInterval('slideSwitch()', 5000);
});
});
$(function(){
$("ul.topmenu li").hover(function(){
$(this).addClass("hover");
$('ul:first',this).show('slow');
}, function(){
$(this).removeClass("hover");
$('ul:first',this).hide('slow');
});
$("ul.topmenu li ul li:has(ul)").find("a:first").append('
');
});
function fpnews_activate(div_id){
var title_id = '#fpnewstitle' + div_id;
var intro_id = '#fpnewsintro' + div_id;
$('.fpnewsintro').hide('slow');
$('.fpnewstitle').css('background-color','#F0F0F0');
$(title_id).css('background-color','#E0E0E0');
$(intro_id).slideToggle(600);
}
function IsNumeric(sText){
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;
for (i = 0; i < sText.length && IsNumber == true; i++) {
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1) IsNumber = false;
}
return IsNumber;
}
function show_mail(username, host) {
document.write('' + username + '@' + host +'');
}
function addbookmark(title,url){
if (window.sidebar) window.sidebar.addPanel(title, url, "");
else if (window.opera && window.print){
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all) window.external.AddFavorite(url, title);
}
function setHomepage(url){
if (document.all){document.body.style.behavior='url(#default#homepage)';document.body.setHomePage(url);}
else if (window.sidebar){
if(window.netscape){
try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");}
catch(e){alert("To make it possible to set the homepage, open the settings (about:config) and set the variable signed.applets.codebase_principal_support to 'true';");}
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage',url);
}
}
function selstar(val){
for(var x=1;x<=val;x++){
document['ri'+x].src="/_img/star1.gif";
}
}
function unselstar(val){
for(var x=1;x<=val;x++){
document['ri'+x].src="/_img/star0.gif";
}
}
function sendpolldata(form,id) {
var howMany = form.elements.length;
var str = '';
for (count = 0; count < howMany; count++) {
if (form.elements[count].checked == true) {
str = str + "&answer[]=" + form.elements[count].value;
}
}
var url = "/dynpolls/?poll=" + id + str;
$('#polls').load(url);
return false;
}