$(document).ready(function(){
	   
    $(".logo").click(function(){
  		window.location=$(this).find("a").attr("href");return false;
  	})

	//pngfix
	$('div').pngFix();
	
	$(".gv-nav-prev,.gv-img_wrap,.gv-nav-next,.gv-panel,.inquireItem,.gv-panel-nav-next,.gv-panel-nav-prev").live("click",function(){
			optsGalleryView.transition_interval = 0;	    
    });

	$(".inquireItem").live("click",function(){
		$("#mypopupcallus").hide();
		$("#mypopup").centerInClient();
		$("#mypopup").show();
		str = $(this).parent('p').parent("div#itemDescription").clone();
		$("#moreItem",str).remove();
		$(".moreimagesGallery",str).remove();		
		$("#mypopup .popupProductName").html($(str).html());
		// Here in variable popupProductNameHidden products id will be saved. 
        $("#popupProductNameHidden").val($(this).attr('id'));        
		return false;
	});
	
	
	$(".moreinfoProduct").live("click",function(){
		optsGalleryView.transition_interval = 0;
		document.getElementById("mypopup").style.display="none";
		tb_show("Product Info",$("#themename").val()+"/productInfo.php?productid="+$(this).attr("title")+"&amp;TB_iframe=true&amp;height=450&amp;width=520");
		return false;
	});
	
    $(".thickboxImage").live("click",function(e){
		e.preventDefault();
        optsGalleryView.transition_interval = 0;
		document.getElementById("mypopup").style.display="none";
		//height = $(window).height() - 60;
		height = 500;
		//tb_show("Product Images",$(this).attr('href')+'&amp;height='+height+'&amp;width=920');
		tb_show("Product Images",$(this).attr('href')+'&amp;height='+height+'&amp;width=550');
		return false;
	});
	

});


function moreInfoProduct(id){
		document.getElementById("mypopup").style.display="none";
		tb_show("Product Info",$("#themename").val()+"/productInfo.php?productid="+ id + "&amp;TB_iframe=true&amp;height=450&amp;width=520");
		//return false;

}

var Popup = {
            open: function(options){
                this.options = {
                    url: '#'
                }
                $.extend(this.options, options || {});
				window.open(this.options.url);
            }
        }
        
function printStoreMap(){
   	Popup.open({url: $("#sitename").val()+ '/printmap.php'});
}


