function fixpng()
{
	var arVersion = navigator.appVersion.split("MSIE");
	var version = parseFloat(arVersion[1]);

	if ((version >= 5.5) && (document.body.filters)) 
	{
	   for(var i=0; i<document.images.length; i++)
	   {
	      var img = document.images[i]
	      var imgName = img.src.toUpperCase()
	      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	      {
	         var imgID = (img.id) ? "id='" + img.id + "' " : "";
	         var imgClass = (img.className) ? "class='" + img.className + "' " : "";
	         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
	         var imgStyle = "display:inline-block;" + img.style.cssText ;
	         if (img.align == "left") imgStyle = "float:left;" + imgStyle;
	         if (img.align == "right") imgStyle = "float:right;" + imgStyle;
	         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
	         var strNewHTML = "<span " + imgID + imgClass + imgTitle;
	         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
	         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" ;
	         img.outerHTML = strNewHTML;
	         i = i-1;
	      }
	   }
	}
}
//window.onload = function() { fixpng();}
var nErrorCount = 0;
var arErrorMsg 	= new Array();
var bHasFocus 	= false;
arErrorMsg[0] 	= "---- The following errors occured ----" + String.fromCharCode(10);
function checkFieldValue(szType, formField, szMsg)
{	
	var szCheckValue 	= trim(formField.value);
	var szValid;
	var szInvalid;
	var bAllValid 		= true;
	var bFlagDot  		= false;	
	// Blank error
	if (szType == 'noblank')
	{		
		if (szCheckValue == "")
	  	{			
		  	nErrorCount ++;
			arErrorMsg[nErrorCount] = szMsg + String.fromCharCode(10);
			if(bHasFocus == false)
			{
				bHasFocus 		= true;				
				formField.value	= "";
				formField.focus();
			}
  		}
	}
	// Kiem tra dien chi email
	else if(szType == 'email')
	{ 
		if(!ValidateEmail(szCheckValue))
		{
			nErrorCount ++;
			arErrorMsg[nErrorCount] = szMsg + String.fromCharCode(10);
			if(bHasFocus == false)
			{
				bHasFocus 		= true;				
				formField.focus();				
			}
		}
	}
	// kiem tra co phai la ten ho khong
	else if(szType == 'vnname')
	{
		// special character
		szInvalid = "`1234567890-=\[];',./~!@#$%^&*()_+|{}:\"<>?";
		if(!isLegal(szCheckValue, szInvalid))
		{
			nErrorCount ++;
			arErrorMsg[nErrorCount] = szMsg + String.fromCharCode(10);
			if(bHasFocus == false)
			{
				bHasFocus 		= true;				
				formField.focus();
			}
		}
	}
	// address
	else if(szType == 'vnaddress')
	{
		// special character
		szInvalid = "`=;'~!@#$%^&*()_+|{}:\"<>?";
		if(!isLegal(szCheckValue, szInvalid))
		{
			nErrorCount ++;
			arErrorMsg[nErrorCount] = szMsg + String.fromCharCode(10);
			if(bHasFocus == false)
			{
				bHasFocus 		= true;				
				formField.focus();
			}
		}
	}
	else if(szType == 'integer')
	{
		/* ^\d+$ */
		if (!szCheckValue.match(/^\d+$/))
		{
			nErrorCount ++;
			arErrorMsg[nErrorCount] = szMsg + String.fromCharCode(10);
			if(bHasFocus == false)
			{
				bHasFocus 		= true;				
				formField.focus();
			}
		}
		}
		else if(szType == 'decimal')
		{
			/* ^((\d+\.\d+)|(\d+))$ */
		if (!szCheckValue.match(/^((\d+\.\d+)|(\d+))$/))
		{
			nErrorCount ++;
			arErrorMsg[nErrorCount] = szMsg + String.fromCharCode(10);
			if(bHasFocus == false)
			{
				bHasFocus 		= true;				
				formField.focus();
			}
		}
	}
	else if(szType == 'text')
	{
		/* ^[A-Za-z\s]+$ */
		if (!szCheckValue.match(/^[A-Za-z\s]+$/))
		{
			nErrorCount ++;
			arErrorMsg[nErrorCount] = szMsg + String.fromCharCode(10);
			if(bHasFocus == false)
			{
				bHasFocus 		= true;				
				formField.focus();
			}
		}
	}
	else if(szType == 'alphanumeric')
	{
		/* ^[\w\s\.\+\-\#\,\/\(\)]+$ */
		if (!szCheckValue.match(/^[\w\s\.\+\-\#\,\\/\(\)]+$/))
		{
			nErrorCount ++;
			arErrorMsg[nErrorCount] = szMsg + String.fromCharCode(10);
			if(bHasFocus == false)
			{
				bHasFocus 		= true;				
				formField.focus();
			}
		}
	}
	else if(szType == 'alphanum')
	{
		/* ^[\w\s]+$ */
		if (!szCheckValue.match(/^[\w\s]+$/))
		{
			nErrorCount ++;
			arErrorMsg[nErrorCount] = szMsg + String.fromCharCode(10);
			if(bHasFocus == false)
			{
				bHasFocus 		= true;				
				formField.focus();
			}
		}
	}
	else if(szType == 'username')
	{
		/* ^(([A-Za-z\d][A-Za-z\d_]+[a-zA-Z\d])|([a-zA-Z\d]+))$ */
		// neu co underscore thi khong nam dau hay cuoi username
		if (!szCheckValue.match(/^(([A-Za-z\d][A-Za-z\d_]+[a-zA-Z\d])|([a-zA-Z\d]+))$/))
		{
			nErrorCount ++;
			arErrorMsg[nErrorCount] = szMsg + String.fromCharCode(10);
			if(bHasFocus == false)
			{
				bHasFocus 		= true;			
				formField.focus();
			}
		}
	}
	else if(szType == 'verificationcode')
	{
		/* ^[A-Z0-9]{5}$ */
		if (!szCheckValue.match(/^[A-Z0-9]{5}$/))
		{
			nErrorCount ++;
			arErrorMsg[nErrorCount] = szMsg + String.fromCharCode(10);
			if(bHasFocus == false)
			{
				bHasFocus 		= true;				
				formField.focus();
			}
		}
	}
	else if(szType == 'phone')
		{
		if (!szCheckValue.match(/^((\(\+?84\)[\-\.\s]?)|(\+?84[\-\.\s]?)|(0))((\d{3}[\-\.\s]?\d{6})|(\d{2}[\-\.\s]?\d{8}))$/)){
			nErrorCount ++;
			arErrorMsg[nErrorCount] = szMsg + String.fromCharCode(10);
			if(bHasFocus == false)
			{
				bHasFocus = true; 
				formField.focus();
			}
		}
	}
	else if (szType == 'time')
	{
		var dtest;
		dtest=TestString(szCheckValue);
		if(dtest==false){		
			nErrorCount ++;
			arErrorMsg[nErrorCount] = szMsg + String.fromCharCode(10);
			if(bHasFocus == false)
			{
				bHasFocus 		= true;				
				formField.focus();
			}
		}			
	}
	else
	{
		if(szType == 'full')
		{
			szValid = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_ ";
		}

		else if(szType == 'URL')
		{
			szValid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.:/\\";
		}
		else if(szType == 'path')
		{
			szValid = "0123456789.+-_#,/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz () \\ ";
		}
		else if(szType == 'file')
		{
			szValid = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_.";
		}
		else
		{
			nErrorCount ++;
			arErrorMsg[nErrorCount] = "Error type."  + String.fromCharCode(10);
			return 1;
		}

		// thu tuc kiem tra, duyet chuoi can kiem tra
		for (i = 0;  i < szCheckValue.length;  i++)
  		{
    		ch = szCheckValue.charAt(i);
    		// neu co trong cac ky tu hop le thi bo qua
			for (j = 0;  j < szValid.length;  j++)
			{
	      		if (ch == szValid.charAt(j))
	      		{
					break;
	      		}

				if (j == szValid.length - 1)
				{

					bAllValid = false;
					break;
				}
			}
			if (!bAllValid)
			{
				nErrorCount ++;
				arErrorMsg[nErrorCount] = szMsg  + String.fromCharCode(10);
					
				if(bHasFocus == false)
				{
					bHasFocus 		= true;					
					formField.focus();
				}
				break;
			}
     	}
	}
}
function switchMainTab(index)
{
	tabs = document.getElementById("maintab").getElementsByTagName("li");
	for(var i = 0; i < tabs.length; i++) {
		if(tabs[i].className == "current") {
			/* Deactivate */
			tabs[i].className = "";
		}
	}
	if( index > -1 && index < tabs.length){
		/* Activate */
		tabs[index].className = "current";
	}
}

function switchSubTab(index)
{
	tabs = document.getElementById("subtab").getElementsByTagName("li");
	for(var i = 0; i < tabs.length; i++) {
		if(tabs[i].className == "current") {
			/* Deactivate */
			tabs[i].className = "";
		}
	}
	if( index > -1 && index < tabs.length){
		/* Activate */
		tabs[index].className = "current";
	}
}

function switchUserTab(index)
{
	tabs = document.getElementById("tab_user").getElementsByTagName("li");
	for(var i = 0; i < tabs.length; i++) {
		if(tabs[i].className == "current") {
			/* Deactivate */
			tabs[i].className = "";
		}
	}
	if( index > -1 && index < tabs.length){
		/* Activate */
		tabs[index].className = "current";
	}
}

function ValidateEmail(szEmail)
{
	// chi co 1 ky tu @ o giua, chieu dai username tu 1 den 64 ky tu
	// chieu dai domain tu 1 den 255 ky tu
	if (!szEmail.match(/^[^@]{1,64}@[^@]{1,255}$/))
	{
		return false;
	}

  	// chia 2 phan truoc va sau @
  	szEmailArray = szEmail.split("@");
  	// szEmailArray[0] user, szEmailArray[1] domain

  	// phan username, chieu dai tu max 64 ky tu
  	// valid character la ky tu chu a-zA-Z, ky tu so 0-9 dash _ hyphen - va dot .
  	// neu de trong quote "langxang, at vinacyber dot com dot vn!"@server.com
  	// tach cac phan phan chia boi dot .
  	szLocalArray = szEmailArray[0].split(".");

  	// kiem tra tung phan
  	for(i = 0; i < szLocalArray.length; i ++)
  	{
  		// part 1: neu co dau dash hay hyphen thi khong co o dau va o cuoi
  		// part 2: neu khong do dash hay hyphen thi la A-Za-z0-9 chieu dai tu 1 den 64 ky tu
  		// part 3: neu trong quote, phan trong quote khong chua \" dau quote hay \\ va back slash
		if (!szLocalArray[i].match(/^(([A-Za-z0-9][A-Za-z0-9_-]{0,62}[A-Za-z0-9])|([A-Za-z0-9]{1,64})|(\"[^(\\|\")]{0,62}\"))$/))
		{
      		return false;
    	}
  	}

  	// domain khong phai la IP
  	if (!szEmailArray[1].match(/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/))
  	{
  		// kiem tra valid domain, tach tung phan domain
    	szDomainArray = szEmailArray[1].split(".");
    	// it nhat co 2 phan cua domain sau @
    	if (szDomainArray.length < 2)
    	{
        	return false;
    	}
/*hungtm sua phan nay
24/11/08*/
		else
		{
			//phan sau dot (.) co kich thuoc < 3
			if(szDomainArray[1].length<2)
				return false;
		}/*end hungtm sua*/
    	// kiem tra tung phan
    	for(i = 0; i < szDomainArray.length; i++)
    	{
    		// maxinum la 64, chua A-Za-z, 0-9, co the chua hyphen -
    		// dau hyphen khong o dau va khong o cuoi, domain case in-sensitive
    		// neu khong co hyphen thi la A-Za-z0-9
			if (!szDomainArray[i].match(/^(([A-Za-z0-9][A-Za-z0-9-]{0,62}[A-Za-z0-9])|([A-Za-z0-9]{0,64}))$/))
			{
        		return false;
      		}
    	}

    	// kiem tra top domain
		// szDomainArray[szDomainArray.length - 1]
  	}
  	return true;
}
function isNumber(str) {
	var alphaExp = /^[0-9]+$/;
	if(str.match(alphaExp)){
		return true;
	}
	return false;
}
function isAlphabetAndNumber(str) {
	var alphaExp = /^[a-zA-Z0-9_]+$/;
	if (str.match(alphaExp)){
		return true;
	}
	return false;
}
function isLegal(szCheck, szInvalid) {
	// szInvalid cac ky tu dac biet
	for(i = 0; i < szInvalid.length; i ++) {
		// co ky tu dac biet trong chuoi can check
		if(szCheck.indexOf(szInvalid.charAt(i)) >= 0 )	{
			return false;
		}
    }
	return true;
}

function checkDate( strDate, strMessage1, strMessage2 ) 
{
 /**gia tri nhap vao phai la dd/mm/yyyy*/
	var szCheckValue 	= strDate.value.replace(/^\s+/, "");
	var arrayDATE;
    var dtest;
   	//arrayDATE = strDate.split("/"); 
	arrayDATE= szCheckValue.split("/");
	/** ngay cua he thong la mm/dd/yyyy nen phai doi ra ngay he thong */
	dtest = new Date(arrayDATE[1] + "/" + arrayDATE[0] + "/" + arrayDATE[2]);   
    if (dtest.getDate() != arrayDATE[0] || dtest.getMonth() +1 != arrayDATE[1] || dtest.getFullYear() != arrayDATE[2]) 
	{
    	alert( strMessage1 );   
		strDate.value='';
		return false;
    }
	if (arrayDATE[2]<=1900) 
	{
	   /**neu nam nho hon 1900 thi se ko insert duoc vao sql server*/
		alert(strMessage2);  
		strDate.value='';
		return false;
	}
	return true;
}

function checkTime ( strTime, strMessage )
{
	/* gia tri nhap vao phai la time HH:MM:SS TT*/		
	var dtest;
	dtest=TestString(strTime);
	if(dtest==false){		
		return false;
	}	
	return true;
}

function TestString(S) {
    return /^([01]?[0-9]|[2][0-3])(:[0-5][0-9])(:[0-5][0-9])([ ][A-A][M-M]|[ ][a-a][m-m]|[ ][p-p][m-m]|[ ][A-A][M-M])?$/.test(S);
}
/**
* Written by 		: TrÆ°Æ¡ng Kim Phá»¥ng
* Dated on			: 01/12/2007
* Description		: kiá»ƒm tra kÃ½ tá»± nháº­p vÃ o cÃ³ lÃ  sá»‘ hay ko
* Function			: function checkKey
*/
function checkKey(e){
	if ((e.keyCode >= 48 && e.keyCode <= 57) || e.keyCode == 8 || (e.keyCode>=96 && e.keyCode<=105) || e.keyCode == 9)
		return true;
	else
		return false;
}
var flagXuLyPoint;
//Kiá»ƒm tra gÃµ key
function checkCommaKey(e){
	var keyCode //= (window.event) ? event.keyCode : e.which;   
	if (window.event) keyCode = event.keyCode   
	else keyCode = e.which   
	// Was key that was pressed a numeric character (0-9) or . or <- or -> or backspace (8)?   
	if ( keyCode > 47 && keyCode < 58  || keyCode == 44 ||  keyCode == 37 || keyCode == 39 || keyCode == 8 ) {
		flagXuLyPoint = true;
		return; // if so, do nothing   else // otherwise, discard character   
	}
	flagXuLyPoint = false;
	if (window.event) //IE       
		window.event.returnValue = null;     
	else //Firefox       
		e.preventDefault(); 
}
function checkPointKey(e){
	var keyCode //= (window.event) ? event.keyCode : e.which;   
	if (window.event) keyCode = event.keyCode   
	else keyCode = e.which   
	// Was key that was pressed a numeric character (0-9) or , or <- or -> or backspace (8)?   
	if ( keyCode > 47 && keyCode < 58 || keyCode == 46 || keyCode == 37 || keyCode == 39 || keyCode < 32 ) {
		flagXuLyPoint = true;
		return; // if so, do nothing   else // otherwise, discard character   
	}
	flagXuLyPoint = false;
	if (window.event) //IE       
		window.event.returnValue = null;     
	else //Firefox       
		e.preventDefault(); 
	 
}
function addSimpleKey(node, strSimple ){
	var strStart 	= node.value;
	if(!flagXuLyPoint)	return;	
	strResult	= document.getElementById('idUnit').value;	
	if(strResult == 'USD') {
		arrSplit = strStart.split('.');
		if(arrSplit.length > 1 ) {
			str = arrSplit[0];
		}
		else {
			str = strStart;
		}
	}
	else {
		arrSplit = strStart.split(',');
		if(arrSplit.length > 1 ) {
			str = arrSplit[0];
		}
		else {
			str = strStart;
		}
	}
	
	str =filter(str ,'0123456789');	
	
	var cont = true;
	while(cont){
		if(str.charAt(0) == '0'){
			str = str.substr(1,str.length);
		}
		else cont = false;
	}
	temp="";
	for(i=str.length-1; i>=0; i--){
		temp=str.charAt(i)+temp;		
		if ( (((i-str.length)%3)==0) && (i!=0)){
			temp= strSimple + temp;
		}
	}	
	if(strResult == 'USD') {
		arrSplit = strStart.split('.');
		if(arrSplit.length > 1 ) {
			node.value = temp + '.' + arrSplit[1];
		}
		else {
			node.value = temp ;
		}
	}
	else {
		arrSplit = strStart.split(',');
		if(arrSplit.length > 1 ) {
			node.value = temp + ',' + arrSplit[1];
		}
		else {
			node.value = temp ;
		}
	}	
}
function filter(inputString, filterString){
	outString = "";	
	for(i=0; i<inputString.length; i++){
		if(filterString.indexOf(inputString.substr(i,1) )!=-1)
			outString = outString + inputString.substr(i,1);
	}	
	return outString;
}
function actionKey(e, idField) {
	strResult		= document.getElementById(idField).value;	
	var isBoolean 	= '';
	if(strResult == 'USD') {
		checkPointKey(e); 
	}
	else if(strResult == 'VND') {
		checkCommaKey(e);
	}
	
}
function keyUp(idField, strValue) {
	strResult	= document.getElementById(idField).value;		
	if(strResult == 'USD') {
		//addSimpleKey(strValue, ',');
	}
	else if(strResult == 'VND') {
		addSimpleKey(strValue, '.');
	}	
}
function onChange(strInput, idField) {	
	strValue = document.getElementById(idField).value;	
	if(strInput.value == 'VND') {
		/**
		* Tá»« $124,450.20 --> 124.450,20 VND 
		*/
		arrValue = strValue.split('.');		
		if(arrValue.length > 1 ) {
			strResult = replace(arrValue[0], ",", "\.") + ',' + arrValue[1];
		}
		else {
			strResult = replace(strValue, ",", "\.");				
		}
	}
	else {	
		/**
		* Tá»« 124.450,20 VND --> $124,450.20 
		*/
		arrValue = strValue.split(',');		
		if(arrValue.length > 1 ) {
			strResult = replace(arrValue[0], "\.", ",") + '.' + arrValue[1];
		}
		else {
			strResult = replace(strValue, "\.", ",");
			alert
		}				
	}
	document.getElementById(idField).value = strResult;
}
function replace(string,text,by) {
	// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}
function addPoint(node ){
	var str 	= node.value;
	if(!flagXuLyPoint)	return;	
	str =filter(str ,'0123456789');		
	var cont = true;
	while(cont){
		if(str.charAt(0) == '0'){
			str = str.substr(1,str.length);
		}
		else cont = false;
	}
	temp="";
	for(i=str.length-1; i>=0; i--){
		temp=str.charAt(i)+temp;		
		if ( (((i-str.length)%3)==0) && (i!=0)){
			temp= '.' + temp;
		}
	}	
	node.value = temp ;		
}
function removePoint(string){
	if (string.indexOf('.') > 0 ){
		arrString	=	string.split('.');
		strResult	=	arrString.join("");
		return strResult;
	}
	return string;
}
//khong cho nhap nhung ky tu dac biet
function inputMask(input)
{ 
var index = 0;
var len = input.value.length;
mask='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_@.'; 
while ((index < len) && (len != 0))
if (mask.indexOf(input.value.charAt(index)) == -1)
{
if (index == len-1)
input.value = input.value.substring(0, len-1);
else if (index == 0)
input.value = input.value.substring(1, len);
else input.value = input.value.substring(0, index)+input.value.substring(index+1, len);
index = 0;
len = input.value.length;
}
else index++;
}
//bo khoang trang phia truoc va sau chuoi truyen vao
function trim(str, chars) {
    return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

/***********************************************
* Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
 
var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=["images/homepage/fadeinslide/1.jpg", "", ""] //plain image syntax
fadeimages[1]=["images/homepage/fadeinslide/2.jpg", "", ""] //image with link syntax
fadeimages[2]=["images/homepage/fadeinslide/3.jpg", "", ""] //image with link and target syntax
 
var fadebgcolor="none"

////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause;
this.mouseovercheck=0;
this.delay=delay;
this.degree=10; //initial opacity degree (10%)
this.curimageindex=0;
this.nextimageindex=1;
fadearray[fadearray.length]=this;
this.slideshowid=fadearray.length-1;
this.canvasbase="canvas"+this.slideshowid;
this.curcanvas=this.canvasbase+"_0";
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}



//Highlight form element- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

var highlightcolor="lightyellow"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}
