var _dgFlow=null;if(typeof jQuery!='undefined'){$(document).ready(function(){if(typeof $.blockUI!='undefined'){$.blockUI.defaults.overlayCSS.backgroundColor='#fcfcfc';$.blockUI.defaults.overlayCSS.backgroundImage='url(/images/loader.gif)';$.blockUI.defaults.overlayCSS.backgroundPosition='center center';$.blockUI.defaults.overlayCSS.backgroundRepeat='no-repeat';}
$('#ContactsLink').click(function(e){e.preventDefault();showModalPopup($(this).attr('href'),400,200);return false;});$('.videoLink').click(function(e){e.preventDefault();showModalPopup($(this).attr('href'),$(this).attr('vw'),parseInt($(this).attr('vh'))+30);return false;});$('a.Zoom').click(function(e){e.preventDefault();showModalPopup($(this).attr('href'),420,220,InitZoomer);return false;});$('a.BuyNow').click(function(e){e.preventDefault();showModalPopup($(this).attr('href'),500,400,InitBuyNow);return false;});$('div#cartDetails').each(function(){InitCart();});$('div#findOrder').each(function(){InitFindOrder();});$('input#payPalBuyBtn').each(function(){InitCheckout();});});}
function loadModalPopupContent(url,data,callback){$('div#modalPopup').load(url,data,function(){if(parseInt($(this).height())>parseInt($('.simplemodal-container').height())){$.modal.setContainerDimensions();}
if($.isFunction(callback)){callback();}});}
function showModalPopup(url,width,height,callback,autoresize){$('#modalPopup').modal({overlayClose:true,minWidth:width,minHeight:height,autoPosition:true,autoResize:(autoresize===true),onOpen:function(dialog){dialog.container.block({message:null});dialog.overlay.fadeIn('fast',function(){dialog.data.hide();dialog.container.fadeIn('fast',function(){dialog.data.show();});});},onClose:function(dialog){dialog.container.fadeOut('slow',function(){dialog.data.fadeOut('fast',function(){dialog.overlay.fadeOut('fast',function(){$.modal.close();});});});},onShow:function(dialog){loadModalPopupContent(url,null,function(){dialog.container.unblock();if($.isFunction(callback)){callback()}});}});}
