//Javascript document
//Written by Luke Freeman
$(document).ready(function() {
	$('marquee').marquee('pointer').mouseover(function () {
    	$(this).trigger('stop');
		}).mouseout(function () {
            $(this).trigger('start');
        }).mousemove(function (event) {
            if ($(this).data('drag') == true) {
                this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
            }
        }).mousedown(function (event) {
            $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
        }).mouseup(function () {
            $(this).data('drag', false);
        });
		
		
	
	$(".postit").mouseover(function(){
										$(this).css("background-position", "0px -102px");
										});
										
	$(".postit").mouseout(function(){
										$(this).css("background-position", "0 0");
										});

	//$(".postit").click(function(){
		//	document.location.href='http://www.actant.com//pdf/Actant_and_Object_Trading.pdf';
	//	});
});


function injectVideo(videoFile) {
	if(videoFile!='null'){
		if ($('#pageheader').length != 0){
			$("#pageheader").html('<object type="application/x-shockwave-flash" data="videofiles/'+videoFile+'" width="628" height="240" ><param name="movie" value="videofiles/'+videoFile+'" /><param name="wmode" value="opaque" /></object>');
		} else {
			Shadowbox.open({ content: 'http://'+location.host+'/includes/videoPopup.php?q='+videoFile, player:'iframe', height:'240', width:'628' });
		}
	}
}

function openWebinar(videoFile) {
	window.open('http://'+location.host+'/flash/'+videoFile);	
}

function getPDF(pdfFile) {
	if(pdfFile!='null') {
		window.open('http://'+location.host+'/pdf/'+pdfFile);	
	}
}

function getPresentation(file) {
	if(file!='null') {
		window.open('http://'+location.host+'/presentations/'+file);	
	}
}

function getDemo(file) {
	if(file!='null') {
		//newwindow=window.open('http://'+location.host+'/demoform.php?file='+file,'name','height=500,width=500');
		
		window.open('http://'+location.host+'/flash/'+file);	
	}
}

