$(document).ready(function() {					   


/*******************************************************************************
=== PDF LINKS ==================================================================
	* Makes any link to a .PDF open in a smaller cromeless window, 
	  and displays the PDF icon image after the link.
*******************************************************************************/
$('a[href$=".pdf"]').click(function(){
	var href = $(this).attr('href');
	
	var s=s_gi('ampriversourceprod,ampglobal'); 
	s.tl(this,'d',href);
	
	window.open(href, 'pdf', 'location=no,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,left=10,top=10,width=750,height=550'); return false;
});

var color = " 'color:gray;'";

$('a[href$=".pdf"]').after(' <span style=' + color + '>(PDF)</span>');


if (!is_mobile()){
	$(".vp2colorbox").colorbox({ width: "500px", height: "450px", iframe: true, scrolling: false });
	$(".vp2colorbox640").colorbox({ width: "700px", height: "500px", iframe: true, scrolling: false });
}







});


/**
 * Popup a window that plays a 320 x 240 flash video
 */
function popupVid320by240(vid) {
	var popup = window.open('/global/media/rvsc/videoPopup-320-240.asp?video='+vid,'','location=no,menubar=no,toolbar=no,status=no,resizable=no,scrollbars=no,width=320,height=260');
}	

/**
 * Popup a window that plays a 420 x 240 flash video
 */
function popupVid450by320(vid) {
	var popup = window.open('/global/media/rvsc/videoPopup-450-320.asp?video='+vid,'','location=no,menubar=no,toolbar=no,status=no,resizable=no,scrollbars=no,width=448,height=320');
}	


function is_mobile() {

    return !!navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad|android)/);

}
