﻿if (top.frames.length > 0)
{
 top.location=self.location;
}



function setVisible(divID)
{
    var objDiv = document.getElementById(divID);
    
    if (objDiv.style.display == "none")
        objDiv.style.display = "block";
    else
        objDiv.style.display = "none";
}

function changeStyleMainItem(obj, flag)
{
    if (flag == 0)
        obj.style.color = "#ff0000";
    else
        obj.style.color = "#000000";
}

function changeStyleSubItem(obj, flag)
{
    if (flag == 0)
        obj.style.color = "#ff0000";
    else
        obj.style.color = "#696969";
}

function redirectProductList(subCatalogID)
{
    window.location = "underconstruction.htm";
}
function getProductListInSubCatalog(subCatalogID)
{
    window.location = "underconstruction.htm";
}
// JavaScript Document
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){  //do this so I can take a string too
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;
    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}

function startTrans(a,fname)

{
		a.filters[0].Apply();
		a.src = "imageproducts/" + fname;
		a.filters[0].Play()
}
function TellAFriend(url) 
{
		
		wName = "h" + url.length;
		var href = "/chuagiacthien/Email2Friend.aspx?yoururl=" + url
		opt = "left=" + (screen.availWidth-500)/2 + ",top=" + (screen.availHeight-350)/2
		opt += ",height=350,width=500"
		window.open(href,wName,opt)		
}
//For News Details
function Feedback(gt,id) 
{
		var href = "/chuagiacthien/NewsFeedback.aspx?GT="+gt+"&NewsPK=" + id
		opt = "left=" + (screen.availWidth-500)/2 + ",top=" + (screen.availHeight-400)/2
		opt += ",height=400,width=500"
		window.open(href,"NewsFeedback",opt)		
}

// Detail
function FeedbackDetail(id) 
{
		var href = "/demo/NewsFeedback.aspx?ItemPK=" + id
		opt = "left=" + (screen.availWidth-500)/2 + ",top=" + (screen.availHeight-400)/2
		opt += ",height=400,width=500"
		window.open(href,"NewsDetail",opt)		
}

function showtime () {
        var now = new Date();
        var hours = now.getHours();
        var minutes = now.getMinutes();
        var seconds = now.getSeconds()
        var timeValue = "" + ((hours >12) ? hours -12 :hours)
        timeValue += ((minutes < 10) ? ":0" : ":") + minutes
        timeValue += ((seconds < 10) ? ":0" : ":") + seconds
        if ((hours>0)&&(hours<=11))
        {
        timeValue += " A.M - SaigonSkyTravel - Good morning!"
        }
        else if (hours<=18)
        {
        timeValue += " P.M - SaigonSkyTravel - Good afternoon!"
        }
        else
        {
        timeValue += " P.M - SaigonSkyTravel - Good evening!"
        }
        window.status = timeValue;
        timerID = setTimeout("showtime()",1000);
        timerRunning = true;
}
showtime();