﻿// JavaScript Document
function SetHome(obj,URI){
try{
obj.style.behavior='url(#default#homepage)';obj.setHomePage(URI);
}
catch(e){
if(window.netscape) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}
catch (e) {
alert('请打about:config页面进行安全设置');
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage',URI);
}
}
return false;
}

function addFavorite(url, label) {
    if (document.all)
    {
        window.external.addFavorite(url, label);
    }
    else if (window.sidebar)
    {
        window.sidebar.addPanel(label, url, '');
    }
}

function initDropList(){
	var tags=document.getElementsByName('searchbox');
	for(var i=0;i<tags.length;i++){
		tags[i].onclick=function(){			
			disDropList(this);	
		}	
	}
}

function disDropList(obj){					
	var objDrop=obj.nextSibling;//document.getElementById(dropid);
	if(objDrop.style.display=='block')
	{
		objDrop.style.display='none';
		obj.className='searchbox';
	}
	else
	{
		objDrop.style.display='block';
		obj.className='searchboxClicked';
	}
}

function flashObject(file_name,width,height){
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + width + '" height="' + height + '">');
  document.write('<param name="movie" value="' + file_name + '">');
  document.write('<param name="quality" value="high">');
  document.write('<param name="wmode" value="transparent">');
  document.write('<embed src="' + file_name + '" width="' + width + '" height="' + height + '" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
  document.write('</object>');
}

function chkInquiryForm(){
	var name=document.getElementById('name');
	var tel=document.getElementById('tel');
	var email=document.getElementById('email');
	var title=document.getElementById('title');
	var content=document.getElementById('content');
	var verifycode=document.getElementById('verifycode')
	if(name.value==""){
		alert('请填写姓名!');
		name.focus();
		return false;
	}
	if(tel.value==""){
		alert('请填写电话!');
		tel.focus();
		return false;
	}
	if(email.value==""){
		alert('请填写Email!');
		email.focus();
		return false;
	}
	if(title.value==""){
		alert('请填写主题!');
		title.focus();
		return false;
	}
	if(content.value==""){
		alert('请填写内容!');
		content.focus();
		return false;
	}
	if(verifycode.value==""){
		alert('请填写验证码!');
		verifycode.focus();
		return false;
	}
}

if(window.attachEvent)
{
	window.attachEvent("onload",  initDropList);
}
else if(window.addEventListener)
{
	window.addEventListener('load',  initDropList,  false);
}
