function OpenWindowPrint(id){
	var content=$('#'+id).html();
	var printPage = window.open("","printPage","");
	printPage.document.open();
	printPage.document.write("<HTML><head></head><BODY>");
	printPage.document.write(content);
	printPage.document.close("</BODY><input type='button' value='Print'onclick='window.print()'></HTML>");
	printPage.print();
}
function OpenBrWindow(theURL,winName,features, myWidth, myHeight) {
	if(window.screen){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	var t = window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
	t.focus();
}
function mainmenu(){
	if($("#nav").length > 0){
		$("#nav ul").css({display: "none"}); 
		$("#nav li").hover(	function(){
								var target = $(this).find('ul:first');
								if(target.length>0){
									target.css({visibility: "visible",display: "none"}).show();
									if ( jQuery.browser.msie && jQuery.browser.version < 7) { 
										target.bgiframe();
									}
								}
								
							},function(){
								var target = $(this).find('ul:first');
								if(target.length>0){
									target.css({visibility: "hidden"});
									if ( jQuery.browser.msie && jQuery.browser.version < 7) { 
										target.bgiframe();
									}
								}
							});
	}else if($(".mainmenu tr:first a").length>0){
		$(".mainmenu tr:first ul").css({display: "none"});
		$(".mainmenu tr:first").find("a")
									.hover(function(){	
										var target = $(this).parent().find('ul:first');
										if(target.length>0){
											target.css({visibility: "visible",display: "none"}).show();
										}
									},function(){
										var target = $(this).parent().find('ul:first');
										if(target.length>0){
											target.css({visibility: "hidden"});
										}
									})
									.end()
									.find("ul")
									.hover(function(){										
										var target = $(this).parent().find('ul:first');
										if(target.length>0){
											target.css({visibility: "visible",display: "none"}).show();
										}
									},function(){
										var target = $(this).parent().find('ul:first');
										if(target.length>0){
											target.css({visibility: "hidden"});
										}
									});

									
	}
	
}
function submenu(){
	if($('#subFuncNav li:even').length>0){
		$('#subFuncNav ul:first').show();
		$('#subFuncNav li:even').addClass("bg");
	}
}
function rolemenu(){
  var roleMenuID  = "";
  if($('#rolenav ul').length>0){
  	roleMenuID = "rolenav";
  }else 
	if($('#rolenav06 ul').length>0){
		roleMenuID = "rolenav06";
  }	
  
  if($('#rolenav ul').length>0){
		$('#rolenav ul').hide();
		$('#rolenav ul:first').show();
		$('#rolenav li:even').addClass("bg");
		$('#rolenav li img').click(
			function() {
			  window.location.href = "#top";
				var checkElement = $(this).next();
				if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
					return false;
				}
				if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
					$('#rolenav li img').each(function(i,val) {
						var menuHeaderImg = $(val).attr("src").replace("close","open");
						$(val).attr( "src" , menuHeaderImg );
					});
					$(this).attr( "src" , $(this).attr("src").replace("open","close") );
					$('#rolenav ul:visible').slideUp('normal');
					checkElement.slideDown('normal');
					return false;
				}
			}
		);		
	}else 
	if($('#rolenav06 ul').length>0){
		$('#rolenav06 ul').hide();		
		$('#rolenav06 li:even').addClass("bg");
		$('#rolenav06 li img').mouseover(
			function() {								
			  window.location.href = "#top";			  
				var checkElement = $(this).next();
				if((checkElement.is('ul')) && (checkElement.is(':visible'))) {					
					return false;
				}
				if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {					
					$('#rolenav06 li img').each(function(i,val) {
						var menuHeaderImg = $(val).attr("src").replace("close","open");
						$(val).attr( "src" , menuHeaderImg );
					});
					$(this).attr( "src" , $(this).attr("src").replace("open","close") );
					$('#rolenav06 ul:visible').slideUp('normal');
					checkElement.slideDown('normal');
					return false;
				}
			}
		);
  }
		
  <!--點到哪一個功能頁面,左邊的選單就要在那個功能底下 By Henry-->
  if($("#menuUserType").length>0 && $("#menuUserType").val().length>0){   
  	if(document.getElementById("menuUserType").value.indexOf("visitor")>-1){
  	  $('#'+roleMenuID+' ul').hide();
  	  $('#'+roleMenuID+' ul:first').show();
      $('#'+roleMenuID+' li img').each(function(i,val) {
  			var menuHeaderImg = $(val).attr("src").replace("close","open");
  			$(val).attr( "src" , menuHeaderImg );
  		});
  		if($('#visitorImg').attr("src") != null){
  		  var temp = $('#visitorImg').attr("src").replace("open","close");
  		  $('#visitorImg').attr("src", temp);
  		}
    }
    if(document.getElementById("menuUserType").value.indexOf("exhibitor")>-1){
      $('#'+roleMenuID+' ul').hide();
  	  $('#'+roleMenuID+' ul:eq(1)').show();
      $('#'+roleMenuID+' li img').each(function(i,val) {
  			var menuHeaderImg = $(val).attr("src").replace("close","open");
  			$(val).attr( "src" , menuHeaderImg );
  		});
  		if($('#exhibitorImg').attr("src") != null){
  		  var temp = $('#exhibitorImg').attr("src").replace("open","close");
  		  $('#exhibitorImg').attr("src", temp);
  		}
    }
    if(document.getElementById("menuUserType").value.indexOf("press")>-1){
      $('#'+roleMenuID+' ul').hide();
  	  $('#'+roleMenuID+' ul:eq(2)').show();
      $('#'+roleMenuID+' li img').each(function(i,val) {
  			var menuHeaderImg = $(val).attr("src").replace("close","open");
  			$(val).attr( "src" , menuHeaderImg );
  		});
  		if($('#pressImg').attr("src") != null){
  		  var temp = $('#pressImg').attr("src").replace("open","close");
  		  $('#pressImg').attr("src", temp);
  		}
    }
  }
}

function actTabMenu(){
  if($("#actTabMunu").length > 0){
		$("#actTabMunu ul").css({display: "none"}); 
		$("#actTabMunu li").hover(
		function(){
			var target = $(this).find('ul:first');
			if(target.length>0){
				target.css({visibility: "visible",display: "none"}).show();
				if ( jQuery.browser.msie && jQuery.browser.version < 7) { 
					target.bgiframe();
				}
			}
		},
		function(){
			var target = $(this).find('ul:first');
			if(target.length>0){
				target.css({visibility: "hidden"});
				if ( jQuery.browser.msie && jQuery.browser.version < 7) { 
					target.bgiframe();
				}
			}
		});
	}
}

function fixIE7(){

		var userAgent = window.navigator.userAgent.toLowerCase();
		// 修正 jQuery.browser.version 比對問題
		$.browser.version = (userAgent.match( /.(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0, '0'])[1];
		var version = $.browser.version;

		if(version=="7.0"||version=="6.0"){
			$(function() {
				var zIndexNumber = 1000;
				$('div').each(function() {
					$(this).css('zIndex', zIndexNumber);
					zIndexNumber -= 10;
				});
			});
		}
}

function doPage(i){
   if($("#pageForm").length > 0){
		$("#pageForm input[name=currentPage]").val(i);
		$("#pageForm").submit();
   }else{
		alert("PageForm can't found.");
   }
}
function doChangePageSize(i){
   if($("#pageForm").length > 0){
		$("#pageForm input[name=pageSize]").val(i);
		$("#pageForm input[name=currentPage]").val(1);
		$("#pageForm").submit();
   }else{
		alert("PageForm can't found.");
   }
}
function doChangeOrderType(sort){
   if($("#pageForm").length > 0 && $("#pageForm input[name=orderType]").length > 0){
		$("#pageForm input[name=orderType]").val(sort);
		$("#pageForm").submit();
   }else{
		alert("PageForm can't found.");
   }
}

function doChangeAlbum(albumID){
  if($("#pageForm").length > 0){
    //$("#pageForm input[name=albumID]").val(albumID);
    $("#pageForm").submit();
  }else{
    alert("PageForm can't found.");
  }
}

function doChangePhoto(photoNum,windowName, photoPath, photoName, isHorizontal, lang, currentPhoto,winTitle){
	
  var temp = "";
  
  if(currentPhoto > 3){
    //var left = photoSize * (currentPhoto-3);
    //document.getElementById("pictb").style.left = "-" + left + "px";
  }
  
  var tempPhotoPath = photoPath.replace("-2.", "\.");
  
  if(isHorizontal == "Y"){
    temp = '<a href="javascript:downloadPhoto(\''+windowName+'\', \''+lang+'\', \''+tempPhotoPath+'\');"><img id="currentPhoto" name="currentPhoto" src="'+photoPath+'" alt="'+photoName+'" title="'+photoName+'" height="500" /></a>'; 
  }else if(isHorizontal == "N"){
    temp = '<a href="javascript:downloadPhoto(\''+windowName+'\', \''+lang+'\', \''+tempPhotoPath+'\');"><img id="currentPhoto" name="currentPhoto" src="'+photoPath+'" alt="'+photoName+'" title="'+photoName+'" width="500" /></a>'; 
  }else{
    temp = '<a href="javascript:downloadPhoto(\''+windowName+'\', \''+lang+'\', \''+tempPhotoPath+'\');"><img id="currentPhoto" name="currentPhoto" src="'+photoPath+'" alt="'+photoName+'" title="'+photoName+'" /></a>';
  }
  
  document.title = winTitle;
  $("meta[name='description']").attr("content",winTitle);
    
  document.getElementById("currentPhotoName").innerHTML = photoName;
  document.getElementById("photoImage").innerHTML = temp;
  
  photoID = photoNum;
  var pattern = new RegExp("\\?.*","gi");
  var prodURL = document.URL.replace(pattern,"")+"?id="+photoNum;
  ShareTool.likeByAjax(lang,prodURL,false); 
}

var photoSize = 128;
function doPhotoLeft(){
  var value = document.getElementById("pictb").style.left.replace("-", "").replace("px", "");
  if(value != "0"){
    value = Math.abs(parseInt(value) - photoSize);
    value = "-"+value+"px";
    document.getElementById("pictb").style.left = value;
  }
}

function doPhotoRight(photoNum){	
  var value = document.getElementById("pictb").style.left.replace("-", "").replace("px", "");
  if(parseInt(value) != (photoNum - 5)*photoSize && photoNum >= 5){
    value = parseInt(value) + photoSize;
    value = "-"+value+"px";
    document.getElementById("pictb").style.left = value;
  }
}

function setPhotoWidth(photoNum, currentPhoto){
  if(currentPhoto > 3){
    var left = photoSize * (currentPhoto-3);
    document.getElementById("pictb").style.left = "-" + left + "px";
  }
  var width = photoSize * photoNum;
  document.getElementById("pictb").style.width = width + "px";
}

var prodPhotoSize = 112;
function doProdPhotoLeft(){
  var value = document.getElementById("pictb").style.left.replace("-", "").replace("px", "");
  if(value != "0"){
    value = Math.abs(parseInt(value) - prodPhotoSize);
    value = "-"+value+"px";
    document.getElementById("pictb").style.left = value;
  }
}

function doProdPhotoRight(photoNum){
  var value = document.getElementById("pictb").style.left.replace("-", "").replace("px", "");  
  if ((parseInt(value) != (photoNum - 6)*prodPhotoSize) && photoNum > 6) {  	
    value = parseInt(value) + prodPhotoSize;
    value = "-"+value+"px";
    document.getElementById("pictb").style.left = value;
  }
}

function setProdPhotoWidth(photoNum){
  var value = prodPhotoSize * photoNum;
  document.getElementById("pictb").style.width = value + "px";
}

$(document).ready(function(){
	mainmenu();
	rolemenu();
	submenu();
	actTabMenu();

	if($("#idmenu").length > 0){
	  rolemenu4();
	}
	
	fixIE7();

	var url = new Array();
	url[0] = "product/list.html";
	url[1] = "product/index/list.html";
	url[2] = "product/info.html";
	url[3] = "exh/list.html";
	url[4] = "exh/info.html";
	url[5] = "exh/search.html";
	url[6] = "index.html";
	url[7] = "/";
	var currentURL = ""+document.location.href;
	currentURL = currentURL.replace(window.location.protocol + "//" + window.location.hostname,"");
	var idx = currentURL.indexOf("?");
	if(idx>-1){
		currentURL = currentURL.substring(7,idx);
	}else if(currentURL.length>7){
		currentURL = currentURL.substring(7);
	}
	for(var i=0;i<url.length;i++){
		if(currentURL==url[i]){
			$(document)[0].oncontextmenu = function() {return false;}  
		}
	}
});

function doSearch(val, text, isSubmit) {
	if(val) {
		  //hot keyword click
		  window.location.href = encodeURI(val);
		  return;
	}
  if($("input#condition").val()=="" || $("input#condition").val()==text){
      return false;
  }else if(isSubmit){
  	  //input key down
  	  if($("input[name=search]:checked").val()){
        $("#searchForm").attr('action', $("input[name=search]:checked").val());
        $("input[name=search]:checked").attr("disabled", true);
      }else{
      	$("#searchForm").attr("action", $("#search").val());
      	$("#search").attr("disabled", true);
      }
      $("#year").attr("disabled", true);
  	  return true;
  }else{
  	  //click search button
  	  var act = "";
  	  if($("input[name=search]:checked").val()){
        act = $("input[name=search]:checked").val();
        $("input[name=search]:checked").attr("disabled", true);
      }else{
      	act = $("#search").val();
      	$("#search").attr("disabled", true);
      }
      $("#year").attr("disabled", true);
      $("#searchForm").attr("action", act);
      $("#searchForm").submit();
  }
}

var FormUtil = {};

FormUtil.CheckBox = {};
FormUtil.CheckBox.setGroup = function (pcb, ccb){
    if(pcb==null){
      //alert("Checkbox.setGroup parent checkbox is null!!"); 沒資料時會顯示
      return;
    }
  
    pcb.onclick = function() {
        if( ccb != undefined ){
            if( ccb.length == undefined ){
                ccb.checked = this.checked;
            }else{
                for(var i=0; i<ccb.length; i++){
                    ccb[i].checked = this.checked;
                }
            }
        }else{
            this.checked = false;
        }
    };
    
    var clickEvent = function(){
        if( ccb.length == undefined ){
            pcb.checked = this.checked;
        }else{
            var state = true;
            for( var i=0; i<ccb.length; i++ ){
                if( !ccb[i].checked ){
                    state = false;
                    break;
                }
            }
            pcb.checked = state;
        }
    };
    
    if(ccb!=undefined) {
        if(ccb.length==undefined){
            ccb.onclick = clickEvent;
        }else{
            for(var i=0; i<ccb.length; i++){
                ccb[i].onclick = clickEvent;
            }
        }
    }
};
FormUtil.CheckBox.isChoose = function (ccb){
    if( ccb==null ){
        return false;
    }else{
        if( ccb.length==undefined ){
            return ccb.checked;
        }else{
            for(var i=0; i<ccb.length; i++){
                if( ccb[i].checked ){
                    return true;
                }
            }
        }
    }
    return false;
};
FormUtil.CheckBox.getCheckedValueList = function (ccb){
    if( ccb==null ){
        return "";
    }else{
        if( ccb.length==undefined ){
            return ccb.checked ? ccb.value : "";
        }else{
            var result = "";
            for(var i=0; i<ccb.length; i++){
                if( ccb[i].checked ){
                    result += "," + ccb[i].value;
                }
            }
            return result.length > 0 ? result.substring(1) : "";
        }
    }
};

FormUtil.Message = {};
FormUtil.MessageQueue = new Array();
FormUtil.Message = function (obj, message){
    var span = document.createElement("span");
    span.innerHTML = "&nbsp;<font color=red>" + message + "</font>";
	  
	  try{
	    var parent;
	    if(obj.selected!=undefined){
	    	parent = obj.parentNode;
			parent.appendChild(span);
	    }else if(obj.length!=undefined && obj.length>0 && obj[0].checked!=undefined){
	    	parent = obj[0].parentNode;
			parent.appendChild(span);
	    }else if(obj.parentNode!=undefined){
			parent = obj.parentNode;
			parent.appendChild(span);
		}else{
			/* reserved for Deng */
			obj.wrapAll("<span></span>");
			obj.after("&nbsp;<font color=red>" + message + "</font>");
		}
		FormUtil.MessageQueue.push(span);
    }catch(E){
    	alert(E);
    }
	  try{
	  	obj.focus();
	  }catch(e){
	  }
};
FormUtil.MessageReset = function (){
    var queue = FormUtil.MessageQueue;
    for(var i=0; i<queue.length; i++){
        var span = queue[i];
        span.parentNode.removeChild(span);
    }
    FormUtil.MessageQueue = null;
    FormUtil.MessageQueue = new Array();
};



var MsgUtil = {};
MsgUtil.validateMode = false;
MsgUtil.setMsg = function(obj){
  if(MsgUtil.validateMode){
     obj.each(
			 function(){
				 //if($(this).attr("type") == "text" || $(this).attr("type") == "password"){
					  var hitText = $(this).next();
					  
            if(hitText!=undefined && (hitText.attr("class")=="redtxt" || hitText.attr("class")=="prompttxt")){
				//alert(hitText.parent().html());
              hitText.css("display","");
            }					
			   //}
			 }
		 );
  }else{ 
    obj.each(      
			function(){		
				//if($(this).attr("type") == "text" || $(this).attr("type") == "password"){				
					  $(this).bind (
						"focus",
						function(){													  
              var hitText = $(this).next();		              
							if(hitText!=undefined && (hitText.attr("class")=="redtxt" || hitText.attr("class")=="prompttxt")){								
                 hitText.css("display","");                   
              }
						}
					);
				 $(this).bind (
						"blur",
						function(){
						  var hitText = $(this).next();		
							if(hitText!=undefined && (hitText.attr("class")=="redtxt" || hitText.attr("class")=="prompttxt")){
                hitText.css("display","none")
              }
						}
					);
			 //}
			}
		);
	}

}

function copySelectedOptions(from,to){
	var options = new Object();
	for(var i=0; i<to.options.length; i++){
		options[to.options[i].value] = true;
	}

	for(var i=0; i<from.options.length; i++){
		var o = from.options[i];
		if(o.selected){
			if (options[o.value] == null || options[o.value] == "undefined"){
				to.options[to.options.length] = new Option( o.text, o.value, false, false);
			}
		}
	}
	
	for(var i=from.options.length-1; i>=0; i--){
		if(from.options[i].selected){
			from.options[i] = null;
		}
	}
}

function removeSelectedOptions(obj){
	for (var i=(obj.options.length-1); i>=0; i--){
		var o = obj.options[i];
		if (o.selected){
			obj.options[i] = null;
		}
	}
}

function getAllSelectedValues(obj){
	var result = "";
	for(var i=0; i<obj.options.length; i++){
		result += ","+obj.options[i].value;
	}
	if(result!=""){
		result = result.substring(1);	
	}
	return result;
}

function getAllSelectedText(obj){
	var result = "";
	for(var i=0; i<obj.options.length; i++){
		result += ","+obj.options[i].text;
	}
	if(result!=""){
		result = result.substring(1);
	}
	return result;
}

function viewLocation(exhLang, ermsg, showID, showYear, checkboxName) {
  var items = "";
  $("input[id="+checkboxName+"]:checked").each(function() {
    items += "," + $(this).val();    
  })
  if (items.length == 0) {
    alert(ermsg);
    return;
  } 
  viewExhLocation(exhLang, ermsg, showID, showYear, items.substring(1));
}

function viewExhLocation(exhLang, ermsg, showID, showYear, items) {
  var loLang = "en-US";
  if ((exhLang == "zh_TW") || (exhLang == "zh_CN")) {
    loLang = "zh-TW";
  }
  OpenBrWindow('http://booth.e-taitra.com.tw/tts/boothviewer.aspx?showno=' + showID + '&showyear=' + showYear + '&language=' + loLang + '&invnum=' + items,
      'exhLocation','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes', 500, 480);
}


function doQuery(winTitle,showLang,ehxID,pID){
  tb_show(winTitle, "/"+showLang+"/visitor/messageBox/visMessageBoxPortalForm.html?doThickbox=1&exhID="+ehxID+"&pID="+pID+"&type=1", false, "keepThis=true&TB_iframe=true&height=400&width=680");
}

function doCollect(winTitle,showLang,pID,exhID){
 if(pID!=null){
   tb_show(winTitle, "/"+showLang+"/visitor/collection/myCollectionAdd.html?doThickbox=1&pID="+pID, false, "keepThis=true&TB_iframe=true&height=400&width=520"); 
 }else if(exhID!=null){
   tb_show(winTitle, "/"+showLang+"/visitor/collection/myCollectionAdd.html?doThickbox=1&exhID="+exhID, false, "keepThis=true&TB_iframe=true&height=400&width=520");
 } 
}

function doMyMenuInfo(lang){
  $.ajax({
    url: '/' + lang + '/myMenuInfo.html?_dc=' + new Date().getTime(),
    data:'',
    type:'GET',
    error:function(){
    },
    success:function(response){
      if(response.indexOf("false")>-1){
      }else{
        document.getElementById("myFuncList").style.display = "block";
//        document.getElementById("myFuncList").innerHTML = response;
		$("#myFuncList").html(response);
      }
    }
  });
}

function downloadPhoto(windowName, showLang, path){
  var now = new Date();
  tb_show(windowName, "/"+showLang+"/act/album/photo/downloadForm.html?path="+path, false, "keepThis=true&TB_iframe=true&height=230&width=750");
}


var BoxTool = {};
BoxTool.mode = "colorbox";
BoxTool.open = function (title, url, width, height) {
  $.fn.colorbox({title:title, href:url, open:true, iframe:true, overlayClose:false, width:width, height:height});
};
BoxTool.close = function () {
  $.fn.colorbox.close();
};
BoxTool.callback = parent;




//facebook 

var ShareTool = {};
ShareTool.like = function(lang,isAppend){						
	var url = encodeURIComponent(window.location);	
	var likeStr = 	"<iframe src=\"http://www.facebook.com/plugins/like.php?locale="+lang+"&href="+url+"&amp;send=false&amp;"+
  "layout=button_count&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=\" scrolling=\"no\" frameborder=\"0\" style=\"border:none;margin:0px; overflow:hidden;\" allowTransparency=\"true\"></iframe>";
                            
  var googleStr = "<g:plusone callback=\"\" href=\""+url+"\"></g:plusone>";                
  if(isAppend){
    $(".group_right #group").append(likeStr);    
  }else{  	
  	$(".group_right .group #likeArea").html(likeStr);    
  } 
}

ShareTool.likeByAjax = function(lang,pushURL,isAppend){			
	var url = encodeURIComponent(pushURL);	
	var likeStr = 	"<iframe src=\"http://www.facebook.com/plugins/like.php?locale="+lang+"&href="+url+"&amp;send=false&amp;"+
  "layout=button_count&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;\" scrolling=\"no\" frameborder=\"0\" style=\"border:none;margin:0px; overflow:hidden;\" allowTransparency=\"true\"></iframe>";
  if(isAppend){
    $(".group_right #group").append(likeStr);    
  }else{  	
  	$(".group_right #group #likeArea").html(likeStr);    
  }
  	
	
}

//因為產品,photo用AJAX LOAD DATA 所以要特別處理
ShareTool.pushByAjax = function(pushURL,title,pushType){	 
	var pushURL = encodeURIComponent(pushURL);
	var title = encodeURIComponent(title);	
	
	if(pushType=="FB"){
     var paramText  = 'u='+pushURL+'&t='+title;
     var url = "http://www.facebook.com/share.php?" + paramText;
     window.open(url,"facebook","");
  }else if(pushType=="Plurk"){  	
  	  var url = 'http://www.plurk.com/?qualifier=shares&status=' .concat(pushURL) .concat(' ') .concat('(') .concat(title) .concat(')');
  	  //var paramText  = 'status='+pushURL+"&#40;"+encodeURIComponent(title)+"&#41;";
      //var url = "http://www.plurk.com/?qualifier=shares&" + paramText;           
      window.open(url,"Blurk","");
  }else if(pushType=="Twitter"){
  	 //var paramText  = 'status='+pushURL+"&#40;"+encodeURIComponent(title)+"&#41;";
  	 var paramText  = 'status='.concat(pushURL) .concat(' ') .concat('(') .concat(title) .concat(')');
     var url = "http://twitter.com/home/?" + paramText;
     window.open(url,"Twitter","");
  }
};


ShareTool.push2FB = function(){
	var title  = $("title").html();
	var url = encodeURIComponent(window.location);
  var paramText  = 'u='+url+'&t='+encodeURIComponent(title)+"&_dc=" + new Date().getTime();
  var url = "http://www.facebook.com/share.php?" + paramText;
  window.open(url,"facebook","");
};
  
  
ShareTool.push2Plurk = function(){
	var title  = $("title").html();
	var url = encodeURIComponent(window.location);
  //var paramText  = 'status='+url+"&#40;"+encodeURIComponent(title)+"&#41;";
  //var paramText  = 'status='+url+"&#40;"+encodeURIComponent(title)+"&#41;";
  //var url = "http://www.plurk.com/?qualifier=shares&" + paramText;  
  var url = 'http://www.plurk.com/?qualifier=shares&status=' .concat(url) .concat(' ') .concat('(') .concat(encodeURIComponent(title)) .concat(')');
  window.open(url,"Blurk","");
};
  
ShareTool.push2Twitter= function(url,title){
	var title  = $("title").html();
	var url = encodeURIComponent(window.location);
 // var paramText  = 'status='+url+"&#40;"+encodeURIComponent(title)+"&#41;";
  var paramText  = 'status='.concat(url) .concat(' ') .concat('(') .concat(encodeURIComponent(title)) .concat(')');
  var url = "http://twitter.com/home/?" + paramText;
  window.open(url,"Twitter","");
 };
  

//首頁差異化展覽，產品要顯示廠商資訊
var notifyProdCode = "";  //首頁型錄留言的型錄ID
function showPP(objID,exhID,showLang,loadImg,prodBigPhotoPath,prodBigPhotoName){						
	 if(loadImg!=""){
	  	var tempPathLoading = "<div class=\"chead\">loading</div>"
	  	         +"<div class=\"cbody\"><img src=\""+loadImg+"\"></div>";
	    $("#"+objID).html(tempPathLoading);
	 } 	
   if($("#"+objID).html().toLowerCase().indexOf("<img")>=0){	 	 	   		  
        jQuery.ajax({
           type: "GET",
           url: "/"+showLang+"/exh/infoDetail.html",
           data: "id=" + exhID ,
           success:function(str){      
           	if(prodBigPhotoPath!=null && prodBigPhotoPath!="" && prodBigPhotoName!=null && prodBigPhotoName!=""){
           	  //版六要特別處理
           	  var tempStr =	"<div class=\"cinfoRltv\">"
                              +"<div class=\"cinfo\">"
                              + str
                              +"</div>"
                              +"<img src=\""+prodBigPhotoPath+"\" alt=\""+prodBigPhotoName+"\" border=\"0\" title=\""+prodBigPhotoName+"\"/>"
                              +"</div>";                 
               $("#"+objID).html(tempStr);    
           	}else{
           	  $("#"+objID).html(str); 	
           	}        	
            
           }, 
           error:function(msg, error){        	
             //alert(error);
           }
        });
   } 
   $("#"+objID).attr("style","display:block;");    
}
	
function hiddenPP(objID){		
	$("#"+objID).attr("style","display:none;");
}

function doContactExh(winTitle,showLang,notifyProdCode,exhibitorID){
	 tb_show(winTitle, "/"+showLang+"/notify/notifyForm.html?productCode="+notifyProdCode +"&exhibitorID="+exhibitorID, false, "keepThis=true&TB_iframe=true&height=450&width=750"); 
}
  
function openFilm(url,id,showLang){
		OpenBrWindow("/" + showLang + '/exh/film/openFilm.html?url='+url+'&id='+id ,'doOpenFileUrl','directories=0, location=0, resizable=1, scrollbars=1, toolbar=1','982','615');
}

