<?php
$arr_sort=array ('2'=>'室内图', '1'=>'外景图', '0'=>'户型图');
$uploadlimit = array('2'=>10,'1'=>5,'0'=>3);
$isfaceimg = true;	//判断封面图是否已标记，这个设定针对重复图片的情况。

foreach($arr_sort as $key=>$sort) { ?>
    <dd class="list_item clearfix">
          <div class="addPicBox radius3">
              <div class="addPicLeft"><?=$sort?></div>
               <div class="addPicRight pre">
                  <div class="addBtn radius5">
                        <span id="spanButtonPlaceholder<?=$key?>"></span>
                  </div>

				  <?php
						//微信传图按钮ID
						$wechatButton = '';

						//微信HTML结构容器ID
						$wechatHtmlId = '';

						//微信二维码图片地址
						$wechatImageSrc = '';

						//每个种上传模式，限制图片上传的数量
						$imageLimitNum = 0;
						
						//微信二维码过期时间
						$lastTime = 0;
						
						//微信唯一标识
						$wechatCacheKey = '';

						//图片上传类型
						$imageUploadType = '';

						//图片地址ID
						$wechatImageSrcId = '';

						//
						$imageWeiXinEwmValid = '';

						$imageWeiXinEwmExpirationId = '';

						if($key == '2')
						{
							$wechatButton = 'doorinImageWeiXinButton';
							$wechatHtmlId = 'doorinImageWeiXinHtml';

							//$wechatImageSrc = $wechatDoorinData['wechat_image'];
							$wechatImageSrc = '';
							$imageLimitNum = '10';

							//$lastTime = $wechatDoorinData['last_time'];
							$lastTime = '';

							//$wechatCacheKey = $wechatDoorinData['wechat_cache_key'];
							$wechatCacheKey = '';

							$wechatImageSrcId = 'doorinWechatImage';
							$ImageWeiXinEwmValid = 'doorinImageWeiXinEwmValid';
							$imageWeiXinEwmExpirationId = 'doorinImageWeiXinEwmExpiration';
							$imageUploadType = 'doorin';
						}
						elseif($key == '1')
						{
							$wechatButton = 'dooroutImageWeiXinButton';
							$wechatHtmlId = 'dooroutImageWeiXinHtml';

							//$wechatImageSrc = $wechatDooroutData['wechat_image'];
							$wechatImageSrc = '';
							$imageLimitNum = '5';

							//$lastTime = $wechatDooroutData['last_time'];
							$lastTime = '';

							//$wechatCacheKey = $wechatDooroutData['wechat_cache_key'];
							$wechatCacheKey = '';

							$wechatImageSrcId = 'dooroutWechatImage';
							$ImageWeiXinEwmValid = 'dooroutImageWeiXinEwmValid';
							$imageWeiXinEwmExpirationId = 'dooroutImageWeiXinEwmExpiration';
							$imageUploadType = 'doorout';
						}
						elseif($key == '0')
						{
							$wechatButton = 'layoutImageWeiXinButton';
							$wechatHtmlId = 'layoutImageWeiXinHtml';
							//$wechatImageSrc = $wechatLayoutData['wechat_image'];
							$wechatImageSrc = '';
							$imageLimitNum = '3';

							//$lastTime = $wechatLayoutData['last_time'];
							$lastTime = '';

							//$wechatCacheKey = $wechatLayoutData['wechat_cache_key'];
							$wechatCacheKey = '';
							
							$wechatImageSrcId = 'layoutWechatImage';
							$ImageWeiXinEwmValid = 'layoutImageWeiXinEwmValid';
							$imageWeiXinEwmExpirationId = 'layoutImageWeiXinEwmExpiration';
							$imageUploadType = 'layout';
						}
				  ?>

				  <div class="addBtn radius5 ">
						<span class="yz-ewmp" id="<?php echo $wechatButton;?>" imageUploadType="<?php echo $imageUploadType;?>" imageLimitNum="<?php echo $imageLimitNum;?>" lastTime="<?php echo $lastTime;?>" wechatCacheKey="<?php echo $wechatCacheKey;?>" wechatImageSrc="<?php echo $wechatImageSrc;?>">
							微信传图    
						</span>
				  </div>

				  <div id="<?php echo $wechatHtmlId;?>" class="yz-ewm cf" style="display:none;"> 

						<!--二维码未过期-->
						<div class="fl yz-ewmi" id="<?php echo $ImageWeiXinEwmValid;?>">
							<img id="<?php echo $wechatImageSrcId;?>" src="" />
						</div>

						<!--二维码过期-->
						<div class="fl yz-ewmw" style="display: none;" id="<?php echo $imageWeiXinEwmExpirationId;?>">
							<p>二维码已过期</p>
							<p><a id="<?php echo $imageUploadType;?>WeicodeRefresh" class="JsweicodeRefresh">点此刷新</a></p>
						</div>
						
						<div class="fr pre yz-ewmr">
							<span class="yz-close">X</span>
							<p class="yz-ewmt">微信扫描二维码</p>
							<p>关注后直接上传手机中的<strong style="color:red; font-weight: 700;"><?php echo $sort;?></strong></p>
						</div>
				  </div>

                <p class="text">
                <?php if($key==2){ ?>
                为防止图片审核未通过，室内图的房源装修情况请与装修描述相符，最多上传<span class="number">10</span>张。
               <?php }elseif($key==1){ ?>
                请不要上传失真图片，如开发商的效果图等，最多上传<span class="number">5</span>张。 
                <?php }else{ ?>
                为防止图片审核未通过，户型图请与房型描述一致，最多上传<span class="number">3</span>张。<a href="http://zsb.house365.com/tools/draw/draw.html" target="_blank" style="color: #3887F2;">在线绘制户型图>></a>
                <?php } ?>
                </p>
              </div>
          </div>
       </dd>		
<script type="text/javascript">
    
var swfu<?=$key?>;
$(function() {
swfu<?=$key?> = new SWFUpload({
	// Backend Settings
	upload_url: "<?=$upload_pic_url?>",
	//post_params: {"PHPSESSID": "5onmcek5m1qsu5e5nor2tiq325"},
	//post_params: {"postion" : position},
	// File Upload Settings
	file_size_limit : "5 MB",	// 5MB
	file_types : "*.jpg;*.png;",
	file_types_description : "Images",
	file_upload_limit : "0",
	file_queue_limit : "5",

	custom_settings : {
		upload_target : "jsPicPreviewBoxM<?=$key?>",
		upload_limit  : <?=$uploadlimit[$key]?>,
		upload_nail	  : "thumbnails<?=$key?>",
		upload_infotype : <?=$key?>
	},

	// Event Handler Settings - these functions as defined in Handlers.js
	//  The handlers are not part of SWFUpload but are part of my website and control how
	//  my website reacts to the SWFUpload events.
	swfupload_loaded_handler : swfUploadLoaded,
	file_queue_error_handler : fileQueueError,
	file_dialog_start_handler : fileDialogStart,
	file_dialog_complete_handler : fileDialogComplete,
	upload_progress_handler : uploadProgress,
	upload_error_handler : uploadError,
	upload_success_handler : uploadSuccess,
	upload_complete_handler : uploadComplete,


	// Button Settings
	button_image_url : "",
	button_placeholder_id : "spanButtonPlaceholder<?=$key?>",
	button_width: 96,
	button_height: 28,
	button_cursor: SWFUpload.CURSOR.HAND,
	button_text:"从电脑选择图片",



	// Flash Settings
	//flash_url : "<?=STATIC_SOURCE_URL?>/common/js/swf/swfupload.swf"
    flash_url : "/swfupload.swf"
	// Debug Settings
	//debug: true
});

});
</script>

        <?php
	if(isset($house_detail['house_pic' . $key]) && !empty($house_detail['house_pic' . $key])) {
        $style = 'style="display:block"';
        $bolHasHouse = true;
     } else {
        $style = 'style="display:none"';
        $bolHasHouse = false;
     }

?>
<div id="jsPicPreviewBoxM<?=$key?>" style="display:none" ></div>
		   <dd class="list_item clearfix" id="picshow<?=$key?>" <?=$style?>>
					<div class="picPreviewBox radius3" >
						<p class="title">您选择的图片</p>
						<div class="picPreviewBoxM clearfix ui-sortable" id="thumbnails<?=$key?>"> 

						
<?php
    if($bolHasHouse)
    {
       foreach($house_detail['house_pic' . $key] as $k => $v){
           $title = $v['title'] == '' ? '图片描述30字' : $v['title'];
           if (!isset($house_detail['pic1']))
           {
               $house_detail['pic1'] = '';
           }
?>
<div style="" class="mItem">
    <div class="mItemInner">
        <div class="mPic">
            <img width="130" height="100" alt="" src="<?=$v['filename']?>">
            <input type="hidden" name="p_filename[]" value="<?=$v['filename']?>?fid=<?=$v['id']?>">
            <input type="hidden" name="p_sort[]" value="<?=$v['sort']?>" class="psort">
            <div class="funM"></div>
            <div class="funMtext">
                <label><input type="radio" onclick="setIndexPic(this);" value="<?=$v['filename']?>" class="input_r" name="jsPicPreviewList" <?php if($house_detail['pic1'] == $v['filename'] && $isfaceimg){ $isfaceimg = false; ?> checked <?php } ?>>封面</label>
                <a class="bigPicLin" style="bottom:84px;" target="_balnk" href="<? echo str_replace('/thumb','',$v['filename']); ?>" title="查看大图">查看大图</a>
                <div class="delBtn" id="<?=$v['sort']?>" imageSrc='<?=$v['filename']?>' title="删除" onclick="setPicDel(<?=$v['id']?>);"></div>
            </div>
        </div>
    </div>
    <div class="inputBoxM jsNameInput nameInput "><input type="text" name="p_title[]" value="<?=$title?>" class="jsInputCount input_text w126" onclick="if(this.value=='图片描述30字')this.value='',this.className='jsInputCount input_text w126 input_text_on'" onblur="if(this.value=='')this.value='图片描述30字',this.className='jsInputCount input_text w126'">
    </div>
</div>

<?php
          }
		}
?>
							
		</div>
	</div>
</dd>
       <?php if($key!=2){ ?>
            <dd style="_display:none;"></dd>
				<dd class="list_item clearfix" id="tuku<?=$key?>" style="display:none">
					<div class="picPreviewBox radius3">
						<p class="title" id="t<?=$key?>">365图库推荐选择您要的图片，即可出现在房源图列中</p>
						<div id="jsPicDepotSZMod<?php if($key==0) echo 2; ?>"  class="list clearfix hide showIe6-7">
							<?php if($key==1){ ?>
							<div class="jsPicPreviewList" id="jsPicPreviewList1"></div>
							<?php }else{ ?>
							<div class="jsPicPreviewList" id="jsPicPreviewList"></div>
							<?php } ?>
						</div>
					</div>
					<div id="jsPicDepotSZBtn<?php if($key==0) echo 2; ?>" class="picDepotSZ">
						<p class="jsZK innerSZ">展开图库</p>
						<p class="jsSQ innerSZ innerSZ2">收起图库</p>
					</div>
				</dd>
		 <?php } ?>


<?php } ?>
<input type='hidden' name='deleteupload' value='1' />
<input type='hidden' id="delpic" name='delpic' value='' />
<input type='hidden' id="pic1" name='pic1' value='<?=$house_detail['pic1']?>' />

<script type="text/javascript">
$(function(){
   

    /****
	var showBtn = $('.show-btn'),
		showDiv = $('#xg_rule');
		showBtn.click(function(){
		if(showDiv.height()<150){
			showBtn.css({
					'background':'url({$conf_url}/template/sz/images/show_btn_ico.gif) no-repeat -1px -1px'
				})
			showDiv.animate({
			'height':'150px'
			})
		}else{
			showBtn.css({
					'background':'url({$conf_url}/template/sz/images/show_btn_ico.gif) no-repeat -1px -1px'
				})
			showDiv.animate({
			'height':'20px'
			})
		}
	});***/

	$(".pictitle").keyup(function(){

		var str=$(this).val();
		var obj_value_arr = str.split("");

		var num = 0;
		for(var i = 0; i < obj_value_arr.length; i++)
		{
			num += returnStrLen(obj_value_arr[i]);
		}
		if(num>60)
		{
			var num=$(this).val().substr(0,30);
			$(this).val(num);
			alert("超过字数(30个汉字)限制，多出的字将被截断！" );
		}
	});


	$("#blockshowname").blur(function(){
		//addlishi(123);
		//$("#historyHouse").hide();
        //getBlockImg(1);
	});
	$("input[name=room]").blur(function(){
		getBlockImg(1);
	});

	$("input[name=hall]").blur(function(){
		getBlockImg(1);
	});
})

//图库推荐图片ajax请求地址
var isort0url = '';
var isort1url = '';
getBlockImg(1);

//获取小区图库图片
function getBlockImg(page,type)
{  
    type = type || false ;
	var blockname = $("input[name=blockshowname]").val();
	blockname = encodeURIComponent(blockname);
	var room = $("input[name=room]").val();
	var hall = $("input[name=hall]").val();
    $("#jsPicPreviewList1").html('');
    $("#tuku1").hide();
    $("#t1").html('');
    $("#jsPicPreviewList0").html('');
    $("#tuku0").hide();
    $("#t0").html('');
	if(blockname != '')
	{
		var url1 = "/ajax_xiao/find_block_img/?blockname="+blockname+"&page="+page;
        /***
		if(isort1url != url1)
		{
			isort1url = url1;
			$.get(isort1url, function(data){
				if(data)
				{
				$("#jsPicPreviewList1").html(data);
				checkImgSelected(1);
				$("#tuku1").show();
				$("#t1").html("365图库为您推荐了<span style='color:#F47936;font-weight:bold;'>"+$("#pic_num").attr("value")+"</span> 张小区外景图片供您选择");
				}
			});
		}***/
        $.get(url1, function(data){
            if(data) {
                $("#jsPicPreviewList1").html(data);
                checkImgSelected(1);
                if(type)
                {
                    var is_display = $($("#jsPicPreviewList1").children("div").get(0)).find('.btn').css('display');
                    if(is_display != 'block' && $("#thumbnails1").find("img").length <5)
                    {
                        //$("#jsPicDepotSZMod").show();
                        $("#jsPicDepotSZBtn").find(".jsZK").click();
                        $($("#jsPicPreviewList1").children("div").get(0)).click();
                    }
                }
                $("#tuku1").show();
                $("#t1").html("365图库为您推荐了<span style='color:#F47936;font-weight:bold;'>"+$("#pic_num").attr("value")+"</span> 张小区外景图片供您选择");
            }
		});
	}

	if(blockname != '' && !(room == 0 && hall == 0))
	{
		var url0 = url1+"&room="+room+"&hall="+hall;
        /***
		if(isort0url != url0)
		{
			isort0url = url0;
			$.get(isort0url, function(data){
				if(data)
				{
				$("#jsPicPreviewList").html(data);
				checkImgSelected(0);
				$("#tuku0").show();
				$("#t0").html("365图库为您推荐了<span style='color:#F47936;font-weight:bold;'>"+$("#pic_num1").attr("value")+"</span> 张小区户型图片供您选择");
				}
			});
		}	***/
        $.get(url0, function(data){
            if(data)
            {
            $("#jsPicPreviewList").html(data);
            checkImgSelected(0);
            $("#tuku0").show();
            $("#t0").html("365图库为您推荐了<span style='color:#F47936;font-weight:bold;'>"+$("#pic_num1").attr("value")+"</span> 张小区户型图片供您选择");
            }
        });
	}

	
}

//上传图片点击设为标题图
function setIndexPic(obj)
{   
	//console.dir($(this).find(".mPic:first"));
	//.children(':first').attr('src')
	var pic1 = $(obj).val();

	if(/^(http.+)_([0-9]+)x([0-9]+)\.([a-z]+)(\?pid=([0-9]+))?$/.test(pic1))
	{
		var imageValArr = /^(http.+)_([0-9]+)x([0-9]+)\.([a-z]+)(\?pid=([0-9]+))?$/.exec(pic1);

		pic1 = imageValArr[1]+'_'+imageValArr[2]+'x'+imageValArr[3]+'.'+imageValArr[4];
	}	

	$('#pic1').val(pic1);
}
//检查图片标题
function checkPicTitle(obj)
{
	var str = obj.value;
	var obj_value_arr = str.split("");

	var num = 0;
	for(var i = 0; i < obj_value_arr.length; i++)
	{
		num += returnStrLen(obj_value_arr[i]);
	}
	if(num>60)
	{
		var num = str.substr(0,30);
		obj.value = num;
		alert("超过字数(30个汉字)限制，多出的字将被截断！" );
	}
}
//选择图库图片
function selectBlockImg(id, src, sort)
{
	var bigimg = src.replace('/thumb','');
	var bigimg = bigimg.replace(/_(.*?)\./g,'.');
	var ischecked = $("#bimg_checkbox_"+id).attr("checked");

	if(document.getElementById("bimg_"+id) && ischecked == false)
	{
		$("#bimg_"+id).remove();
		if(sort == 10)
		{
			swfu1.setButtonDisabled(false);
		}
		else
		{
			swfu0.setButtonDisabled(false);
		}
	}
	else if(!document.getElementById("bimg_"+id))
	{
		var sort1 = sort == 9 ? 0 : 1;
		var oSwfu = sort1 == 0 ? swfu0 : swfu1;

		if( $("#thumbnails"+sort1+" img").size() < oSwfu.customSettings.upload_limit )
		{
			var content = "<div class='mItem'><div class='mItemInner'><div class='mPic'><img width='130' height='100' num='7' src='"+src+"' alt=''><div class='funM'></div><div class='funMtext'><label><input type='radio' name='jsPicPreviewList' class='input_r'>封面</label><div imageSrc='"+src+"' title='删除' class='delBtn'  ></div></div></div></div><div class='inputBoxM jsNameInput nameInput '><input type='text' onblur='if(this.value=='')this.value='图片描述30字',this.className='jsInputCount input_text w126'' onclick='if(this.value=='图片描述30字')this.value='',this.className='jsInputCount input_text w126 input_text_on'' class='jsInputCount input_text w126' value='图片描述30字'></div></div>";

			$("#thumbnails"+sort1).append(content);
		
			if( $("#thumbnails"+sort1+" img").size() >= oSwfu.customSettings.upload_limit ) oSwfu.setButtonDisabled(true);
		}
		else
		{
			$("#bimg_checkbox_"+id).attr("checked",false);
			alert("对不起，您选择的文件数量已达上限。");
		}
	}
}
//设置图片是否同意入库
function checkPblockPic(obj)
{
	var self = $(obj);
	var p_block = self.val();
	if(self.attr('checked') == true)
	{
		$("#"+p_block).val('1');
	}
	else
	{
		$("#"+p_block).val('0');
	}
}
//判断图片是否已选择
function checkImgSelected(sort)
{
	var img1s = $("#thumbnails"+sort+" img");
	var img2s = $("#jsPicPreviewList"+sort+" img");
	var img2src = '';
	var img2id = '';
	
	var img1sarr = new Array();
	var temp = 0;
	img1s.each(function(){
		img1sarr[temp] = $(this).attr('src');
		temp++;
	});

	img2s.each(function(){
        var item = $(this);
		img2src = item.attr('src');
		img2id = item.attr('id');
		img1s.each(function(){
			for(var i=0;i<temp;i++)
			{
				if(img1sarr[i] == img2src)
				{
                    item.parents(".item").find(".btn").show();
				}
			}
		});

	});
}
function setPicDel(delid)
{
	var delpic = $("#delpic").val();
	delpic += delpic != '' ? ','+delid : delid;
	$("#delpic").val(delpic);
}
//选择图库图片 box==可点击选择图片外部div ID，  number==最多可以选择的张数  toBox==添加到的div的ID   jsNameInputDz 
function picPreview(box,number,toBox,cs){
	$("#"+toBox).find(".mItem").find(".delBtn").live("click",function(){
			
		   //var picVal = $(this).prev().attr('href');
		   var picVal = $(this).attr('imageSrc');

		   if(/^(http.+)_([0-9]+)x([0-9]+)\.([a-z]+)(\?pid=([0-9]+))?$/.test(picVal))
		   {
				var imageValArr = /^(http.+)_([0-9]+)x([0-9]+)\.([a-z]+)(\?pid=([0-9]+))?$/.exec(picVal);

				picVal = imageValArr[1]+'_'+imageValArr[2]+'x'+imageValArr[3]+'.'+imageValArr[4];
		   }
	
		   var pic1 = $('#pic1').val();
				
		   if(picVal == pic1)
    	   {
			   $('#pic1').val('');
		   }

		   if($(this).attr("id")==0)
		   {
			   swfu0.setButtonDisabled(false);
		   }
		   if($(this).attr("id")==1)
		   {
			   swfu1.setButtonDisabled(false);
		   }
		   if($(this).attr("id")==2)
		   {
			   swfu2.setButtonDisabled(false);
		   }

		$(this).parents(".mItem").remove();
		var oNum = $(this).parents(".mItem").find("img").attr("num");
		$("#"+box).find("img").each(function(index, element) {
				if($(this).attr("num") == oNum )
				{
					$(this).parents(".item").find(".btn").hide()
				}
		});
	});
	$("#"+box).find(".item").live("click",function(){
		if(box=='jsPicPreviewList1')
		{
		$("#picshow1").show();
		}else if(box=='jsPicPreviewList0')
		{
		$("#picshow0").show();
		}
		if($(this).find(".btn").is(":hidden"))
		{
			if($("#"+toBox).find("img").length == number)
			{
				openWin("jsDialog");
				$("#jsDialog .text").empty().html("对不起！您最多只可添加 "+number+" 张图片");
				return false	
			}
			$(this).find(".btn").show();
			
			var oNewImg = $(this).find(".pic").html();
			var oForId = toBox +'_' + $(this).find(".pic").find("img").attr("num");
            var oPicLink = $(this).find(".bigPicLin").attr("href");
			var oHtml = '<div class="mItem "><div class="mItemInner">'
						+'<div class="mPic">'
						+oNewImg
						+'<input type="hidden" value="'+$(this).find(".pic").find("img").attr("src")+'?pid=' +$(this).find(".pic").find("img").attr("num") + '" name="p_filename[]">'
						+'<input class="psort" type="hidden" value="'+cs+'" name="p_sort[]">'
						+'<div class="funM">'
						+'</div>'
						+'<div class="funMtext">'
						+'<label>'
						+'<input type="radio" onclick="setIndexPic(this);" value="'+$(this).find(".pic").find("img").attr("src")+'?pid=' +$(this).find(".pic").find("img").attr("num") + '" class="input_r" name="jsPicPreviewList" />封面</label><a class="bigPicLin" style="bottom:84px;" target="_balnk" href="'+oPicLink+'" title="查看大图">查看大图</a>'
						+'<div class="delBtn" title="删除" id="'+cs+'"  imageSrc="'+$(this).find(".pic").find("img").attr("src")+'"></div>'
						+'</div>'
						+'</div>'
						+'</div>'
						+'<div class="inputBoxM jsNameInput nameInput ">'
						+'<input value="图片描述30字" type="text" class="jsInputCount input_text w126" onclick="if(this.value==\'图片描述30字\')this.value=\'\',this.className=\'jsInputCount input_text w126 input_text_on\'" onblur="if(this.value==\'\')this.value=\'图片描述30字\',this.className=\'jsInputCount input_text w126\'"/ name="p_title[]">'
						+'</div>'
						+'</div>'
			$(oHtml).appendTo("#"+toBox)//jsPicPreviewBoxM
			$("#picshow"+cs).show();
		}
		else
		{	
			var oNum = $(this).find("img").attr("num");
			$("#"+toBox).find("img").each(function(index, element) {
				if($(this).attr("num") == oNum )
				{
					$(this).parents(".mItem").remove()
				}
			});
			$(this).find(".btn").hide();
		}
	})
	
}
picPreview("jsPicPreviewList1",5,"thumbnails1",10)
picPreview("jsPicPreviewList2",10,"thumbnails2",2)
picPreview("jsPicPreviewList",3,"thumbnails0",9)


//图片选择拖动 
function picPreviewLive(obj){
	$("#"+obj).sortable();//拖动
	$("#"+obj).find(".mItemInner").find("img").live("mousemove",function(event){
		if($("#coordinates").length <=0)
		{
			$("<div id='coordinates' class='radius5' >点击拖动</div>").appendTo("body");
		}
		if($("#coordinates").length >=0)
		{  
			var oDiv=$("#coordinates");
			oDiv.css({left:event.pageX+4+'px',top:event.pageY+4+'px'})
		}
	}).live("mouseout",function(){
		$("#coordinates").remove()
	})
	
	$("#"+obj).find(".mItem").live("mousedown",function(){//
		$("#coordinates").hide();
		$(this).addClass("mItemHover");
		$(this).siblings(".mItem").find("img").css({opacity:0.4});
		$(this).siblings(".mItem").find(".funM").css({opacity:0.2});
		$(this).siblings(".mItem").find(".funMtext").css({opacity:0.4});
		
	}).live("mouseup",function(){
		$("#coordinates").hide();
		$(this).removeClass("mItemHover");	
		$(this).siblings(".mItem").find("img").css({opacity:1});
		$(this).siblings(".mItem").find(".funM").css({opacity:.6});
		$(this).siblings(".mItem").find(".funMtext").css({opacity:1});
	})
	
	$("#"+obj).find("label").live("mousedown",function(event){
		event.stopPropagation()
	})
	
	$("#"+obj).find(".delBtn").live("mousedown",function(event){
		event.stopPropagation()
	})
	$("#"+obj).find(".jsInputCount ").live("mousedown",function(event){
		event.stopPropagation()
	})
	
} 
$(function() {
    picPreviewLive("thumbnails2");
    picPreviewLive("thumbnails1");
    picPreviewLive("thumbnails0"); 


     $(".bigPicLin").live("click mousedown",function(event){
        $(this).parents(".mItem").removeClass("mItemHover");
        event.stopPropagation();
    });
});


</script>
