﻿$(function(){
	$$.incForm();
	//
	$('#slides').slides({
		width: 938,
		height: 392,
		effect: 'fade',
		preload: true,
		play: 5000,
		pause: 2500,
		hoverPause: true
	});	
	//
	$('.rightnav > li')
		.find('a').each(function(i, n) {
			var href = $(this).attr('href');
			if($$.page == href){
				$(this).addClass('active');	
			}
     });	
	//
	$("#searchBtn").colorbox({
		width: 350, 
		height: 200, 
		iframe:true,
		scrolling: false
	});
	//
	$("#queryinput").focus(function(){
		var v = $(this).val();
		if(v=='请输入关键词'){
			$(this).val('');	
		}
	}).blur(function(){
		var v = $(this).val();
		if(v==''){
			$(this).val('请输入关键词');	
		}
	})
	//
	$("#querybtn").click(function(){
		var el = $("#queryinput"),
			val = el.val();
		//
		if(val&&val!='请输入关键词'){
			window.location.href = '/requestprice.asp?kw='+val;	
		}else{
			alert('请输入搜索产品关键字!')	
		}
			
	})
	//
	$(".txt").pagingbreak();
	//
	$("#requestselectall").click(function(){
		$(".pricecheckbox").attr('checked', true);							  
	})
	//
	$("#requestprice").click(function(){
		var val = [];
		$(".pricecheckbox").each(function(){
			if($(this).attr('checked')){
				val.push($(this).val());
			}								  
		});
		//
		if(val.length>0){
			$.colorbox({
				title: '产品询价',
				href:'core/form.asp?id=requestPriceForm&val={title:"'+ val.join(',') +'"}', 
				iframe: true,
				width:560, 
				height:470,
				scrolling: false
			});
		}else{
			alert('请选择需要询价的产品!')	
		}
	})
	//
	$("#ppricebtn").colorbox({
		title: '产品询价',
		iframe: true,
		width:560, 
		height:470,
		scrolling: false
	});	
	//
	$(".newslistleft > a > img").each(function(){
		var src = $(this).attr('src');
		if(!src){
			$(this).attr('src', 'images/logo60x60.gif');
		}
	})
	//
	$("#ppdfbtn").each(function(){
		var src = $(this).attr('src');
		if(!src){
			$(this).remove();
		}
	})
	//
	$(".ppdf > a").each(function(){
		var src = $(this).attr('src');
		if(!src){
			$(this).remove();
		}
	})
	
});
