function openDemo(obj,event){
	event.preventDefault();
	var vWidth = 0; 
	var vHeight = 0; 
	var arrayValue = "";
	var hrefArray = obj.attr("href").split("&");
	for (var x in hrefArray)
	{
		arrayValue = hrefArray[x].toString();
		if(arrayValue.search(/width=/i) != -1)
		{
			if($.browser.msie)
				vWidth = parseInt(arrayValue.replace(/width=/i, "")) - 10; //Demo Width 
			else
				vWidth = parseInt(arrayValue.replace(/width=/i, "")) - 29; //Demo Width - 29 
		}
		if(arrayValue.search(/height=/i) != -1)
		{
			if($.browser.msie)
				vHeight = parseInt(arrayValue.replace(/height=/i, "")) - 5; //Demo Height 
			else
				vHeight = parseInt(arrayValue.replace(/height=/i, "")) - 12; //Demo Height - 12 
		}
	}
	var url = obj.attr("href")+"&TB_iframe=true&height="+vHeight+"&width="+vWidth+"&scroll=no"
	tb_show('',url,'');
	event.stopPropagation();
}
jQuery(function($) {	
	//$("img[src*='icon_360_demo.gif']").parents("a[href*='pgname=']").bind('click',function(event) {
	$("a[href*='pgname=']").bind('click',function(event) {
		obj = $(this);
		openDemo(obj,event);
	});
});
