﻿//
//Changed Tab
//
var StyleSheetPath="";
function ShowDivs(str,types,ahelf,aid)
{
var arr;
if(types==1)
 arr = new Array('gggsId','zwhdtId','dwjlId','qxdtId');
	for(var i = 0 ;i < arr.length;i++)
    {
        if(arr[i].toString() != str)
        {            
                document.getElementById(arr[i].toString()).style.backgroundImage = "url('/Images/pic-22.gif )";        			
                    document.getElementById("Span"+arr[i].toString()).style.display = "none";  				
        }
        else
        {           
		   document.getElementById(arr[i].toString()).style.backgroundImage = "url('/Images/pic-22a.gif )";            
           document.getElementById("Span"+arr[i].toString()).style.display = "";  
        }
    }
}
//
//Options Link
//
function LinkFinUrl(contrname)
{
var str;
var txtname=document.getElementById(contrname)
str=txtname.options[txtname.selectedIndex].value;
window.open(str);
}
//
//Trans Pic
//
var isIE = (document.all) ? true : false;

var $t = function (id) {
	return "string" == typeof id ? document.getElementById(id) : id;
};

var Class = {
	create: function() {
		return function() { this.initialize.apply(this, arguments); }
	}
}

var Extend = function(destination, source) {
	for (var property in source) {
		destination[property] = source[property];
	}
}

var Bind = function(object, fun) {
	return function() {
		return fun.apply(object, arguments);
	}
}

var Each = function(list, fun){
	for (var i = 0, len = list.length; i < len; i++) { fun(list[i], i); }
};


//ie only
var RevealTrans = Class.create();
RevealTrans.prototype = {
  initialize: function(container, options) {
	this._img = document.createElement("img");
	this._a = document.createElement("a");
	
	this._timer = null;
	this.Index = 0;
	this._onIndex = -1;
	
	this.SetOptions(options);
	
	this.Auto = !!this.options.Auto;
	this.Pause = Math.abs(this.options.Pause);
	this.Duration = Math.abs(this.options.Duration);
	this.Transition = parseInt(this.options.Transition);
	this.List = this.options.List;
	this.onShow = this.options.onShow;
	
	
	this._img.src = "javascript:void(0);";
	this._img.style.width = this._img.style.height = "100%"; this._img.style.border = 0;
	this._img.onmouseover = Bind(this, this.Stop);
	this._img.onmouseout = Bind(this, this.Start);
	isIE && (this._img.style.filter = "revealTrans()");
	
	this._a.target = "_blank";
	
	$t(container).appendChild(this._a).appendChild(this._img);
  },
  SetOptions: function(options) {
	this.options = {
		Auto:		true,
		Pause:		3000,
		Duration:	1,
		Transition:	23,
		List:		[],
		onShow:		function(){}
	};
	Extend(this.options, options || {});
  },
  Start: function() {
	clearTimeout(this._timer);
	
	if(!this.List.length) return;
	
	if(this.Index < 0 || this.Index >= this.List.length){ this.Index = 0; }
	
	if(this._onIndex != this.Index){ this._onIndex = this.Index; this.Show(this.List[this.Index]); }
	
	if(this.Auto){
		this._timer = setTimeout(Bind(this, function(){ this.Index++; this.Start(); }), this.Duration * 1000 + this.Pause);
	}
  },
 
  Show: function(list) {
	if(isIE){
		
		with(this._img.filters.revealTrans){
			Transition = this.Transition; Duration = this.Duration; apply(); play();
		}
	}
	
	this._img.src = list.img; this._img.alt = list.text;
	
	!!list["url"] ? (this._a.href = list["url"]) : this._a.removeAttribute("href");
	
	this.onShow();
  },
 
  Add: function(sIimg, sText, sUrl) {
	this.List.push({ img: sIimg, text: sText, url: sUrl });
  },
  
  Stop: function() {
	clearTimeout(this._timer);
  }
};
//
//Float Pic
//
function ReSizeScrollChange()
{    
	if(CheckUnFloatImg())
   {
	var rFloatImg = document.getElementById('rFloatImg');
	var bodIndex = document.getElementById('bodIndex');
	rFloatImg.style.top = bodIndex.scrollTop+400;
	rFloatImg.style.left = bodIndex.clientWidth - rFloatImg.offsetWidth;
	}
	else
	{
	HidFloatImg();
	}
}
function fristShowFloatImg()
{
   if(CheckUnFloatImg())
   {
    var rFloatImg = document.getElementById('rFloatImg');
	var bodIndex = document.getElementById('bodIndex');
    rFloatImg.style.left = bodIndex.clientWidth - rFloatImg.offsetWidth;
	}
	else
	{
	HidFloatImg();
	}
}
function HidFloatImg()
{document.getElementById("rFloatImg").style.display='none';}
function CheckUnFloatImg()
{
  var rFloatImg = document.getElementById('rFloatImg');
  if(rFloatImg.childNodes.length>1)
  {return true;}
  else
  {return false;}
}