/* page.js|customers */
// Inits script
function initPageJs(){
	frameBreakout();
	newsTicker("7000");
}

function frameBreakout(){
	if(window.top!=window.self){
		window.top.location = window.self.location;
	}
}

function popw(url){
	popwindow = window.open (url, "stockHistory","location=0,status=0,scrollbars=1,width=550,height=520");
}

function loginBox(){
    $('#mdBodyContentSubInner').css('visibility','hidden');
    $('#loginBox').show();
}

function newsTicker(speed){
	if($('.mdNewsTicker').get(0)){
		var tickerWidth=0;
		var tickerAmount=$('.mdNewsTicker li').length;
		var tickerSpeed=tickerAmount*speed;
		$('.mdNewsTicker li').each(function(){tickerWidth=tickerWidth+$(this).width()});
		$('.mdNewsTicker ul').width(tickerWidth);
		tickerContainerWidth=$('.mdNewsTicker dd').width();
		$('.mdNewsTicker ul').css("visibility","visible").css("margin-left",tickerContainerWidth).animate({marginLeft:"-"+tickerWidth+"px"},tickerSpeed,"linear",function(){newsTicker(speed)});
	}
}

// Initialize functions
$(document).ready(function(){
	initPageJs();
});

