﻿// JScript 文件

  
    
	if(window.attachEvent){
		window.attachEvent('onload',loadTagEvent); 
	}
	else{
		window.addEventListener('load',loadTagEvent,false);
	}
	
	function loadTagEvent()
	{
//		var divTagList = document.getElementById('divTagList');
//		var spanList = divTagList.getElementsByTagName('span');
//		for(var i=0; i<spanList.length; i++)
//		{
//			spanList[i].onmouseover = showTag;
//			spanList[i].onmouseout = hideTag;
//		}
//		var divTagInfo = document.getElementById('divTagInfo');
//		divTagInfo.onmouseover = showTag;
//		divTagInfo.onmouseout = hideTag;
//		
	}
		
	// 显示标签信息
	var currentTagId = 0;
	function showTag()
	{
		if(this.id == 'divTagInfo')
		{
			this.style.display = 'block';
			return;
		}
		if(this.tagId)currentTagId = this.tagId;
		var aProductCount = document.getElementById('aProductCount');
		aProductCount.innerHTML = this.productCount;
		aProductCount.href='/OriginalProduct/SearchProduct.aspx?tag='+this.tagName+'&&ctid=0&&tagOrName=tag';
		var obj = getElementAbsolutePosition(this);
		var divTagInfo = document.getElementById('divTagInfo');
		divTagInfo.style.top = obj.top - 46;
		divTagInfo.style.display = 'block';
		divTagInfo.style.left = obj.left + (obj.width - divTagInfo.offsetWidth) / 2;
		window.status = currentTagId;
		
	}
	
	// 隐藏标签信息
	function hideTag()
	{
		var divTagInfo = document.getElementById('divTagInfo');
		divTagInfo.style.display = 'none';
	}
	
	
		//链接到搜索照片标签
	function linkToSearchPhoto(name)
	{
	    window.location.href ='/PhotoShare/SearchPhoto.aspx?tag='+name+'&tagOrName=tag';
	}
    
    //链接到搜索作品标签
    function linkToSearchProduct(name)
    {
//        window.open('/OriginalProduct/SearchProduct.aspx.aspx?tag='+name+'&tagOrName=tag&ctid=0',"_blank");
        window.location.href= '/OriginalProduct/SearchProduct.aspx?tag='+name+'&tagOrName=tag&ctid=0';
    }
