
$(function(){
	$('a.sample').each(function(){
		var thisHref = $(this).attr('href');
		$(this).attr('href','javascript:void(0);');
		$(this).click(function(){popupPreview(thisHref);});
		if( typeof($(this).tooltip)=='function'){
			if( $(this).attr('title')!='' ){
				$(this).tooltip({
						tip: '#tooltip',
						// custom positioning
						position: 'center right',
						// move tooltip a little bit to the right
						offset: [0, 15],
						// there is no delay when the mouse is moved away from the trigger
						delay: 0
					});
			}
		}
	})
	$('a.flippage').each(function(){
		var thisHref = $(this).attr('href');
		$(this).attr('href','javascript:void(0);');
		$(this).click(function(){popupFlipPage(thisHref);});
		if( typeof($(this).tooltip)=='function'){
			if( $(this).attr('title')!='' ){
				$(this).tooltip({
						tip: '#tooltip',
						// custom positioning
						position: 'center right',
						// move tooltip a little bit to the right
						offset: [0, 15],
						// there is no delay when the mouse is moved away from the trigger
						delay: 0
					});
			}
		}
	})
	$('a.download').each(function(){
		if( typeof($(this).tooltip)=='function'){
			if( $(this).attr('title')!='' ){
				$(this).tooltip({
						tip: '#tooltip',
						// custom positioning
						position: 'center right',
						// move tooltip a little bit to the right
						offset: [0, 15],
						// there is no delay when the mouse is moved away from the trigger
						delay: 0
					});
			}
		}
	})
});

function popupPreview(url) {
  window.open(url,'WindowStream','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=550,height=80,screenX=100,screenY=80,top=150,left=150');
//  window.open(url,'WindowStream','resizable=yes,width=550,height=80,screenX=100,screenY=80,top=150,left=150');
}

function popupFlipPage(url) {
  window.open(url,'WindowFlipPage','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,screenX=100,screenY=80,top=150,left=150');
}

