﻿// JScript File

var urldomainx= "http://www.thuonghieudoanhnghiep.com/";
var popup = "";
function viewPic(id){
		url = urldomainx + "prodetail.aspx?id="+id;				
		if(popup != "" ) popup.close();
		popup = window.open(url,'popup','height=650,width=700,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbar=yes');
		
}
function CheckDataDifferent(controlid, stringcheck, stringalert)
	{
		
		if (document.getElementById(controlid).value != stringcheck)
		{
			alert(stringalert)
  		document.getElementById(controlid).focus();		
			return "true";	
		}
		else
		{
			return "false";
		}
	}
	 function showvideofile(link_)     
 { 
        document.getElementById('container').innerHTML='<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" viewastext="" width="377" height="283"><param name="FileName" value="'+link_+'"><param name="TransparentAtStart" value="false"><param name="AutoStart" value="true"><param value="1" name="showstatusbar"/><param name="AnimationatStart" value="false"><param name="ShowControls" value="true"><param name="ShowDisplay" value="false"><param name="playCount" value="999"><param name="displaySize" value="0"><param name="Volume" value="100"><PARAM NAME="EnableFullScreenControls" VALUE="True"> <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+link_+'" name="MediaPlayer" transparentatstart="0" autostart="1" playcount="999" volume="100animationAtStart=0" displaysize="1"  showstatusbar="1" width="377" height="283"> </object>';
 }	
function ShowTVItem(file_)
{
        if(file_.indexOf('.flv')>-1)
        {
		var s1 = new SWFObject("mediaplayer.swf","mediaplayer","377","283","0");
		s1.addVariable("autostart","true");
		s1.addParam("allowfullscreen","true");
		s1.addVariable("width","377");
		s1.addVariable("height","283");
		s1.addVariable("file","images/content/"+file_);
		s1.addVariable("repeat","true");
		s1.write("container");
	}
	else
	{
	    showvideofile("images/content/"+file_);
	}
	
}




var programID =new Array();
var programUrl =new Array();

programID[0] = "vtv1";
programUrl[0] = "http://vtc.com.vn/lp/17/vtv1.aspx";
programID[1] = "vtv2";
programUrl[1] = "http://vtc.com.vn/lp/18/vtv2.aspx";
programID[2] = "vtv3";
programUrl[2] = "http://vtc.com.vn/lp/22/vtv3.aspx";
programID[3] = "vtv4";
programUrl[3] = "http://vtc.com.vn/lp/8/vtv4.aspx";

programID[4] = "vtc1";
programUrl[4] = "http://vtc.com.vn/lp/1/vtc1.aspx";
programID[5] = "vtc2";
programUrl[5] = "http://vtc.com.vn/lp/7/vtc2.aspx";
programID[6] = "vtc3";
programUrl[6] = "http://vtc.com.vn/view_Program.aspx?lpid=20";
programID[7] = "vtc4";
programUrl[7] = "http://vtc.com.vn/view_Program.aspx?lpid=21";
programID[8] = "vtc5";
programUrl[8] = "http://vtc.com.vn/view_Program.aspx?lpid=22";
programID[9] = "vtvc10";
programUrl[9] = "http://vtc.com.vn/lp/9/vtc10.aspx";

programID[10] = "vtvc10";
programUrl[10] = "http://vtc.com.vn/lp/9/vtc10.aspx";

programID[11] = "htv7";
programUrl[11] = "http://vtc.com.vn/lp/11/htv7.aspx";
programID[12] = "htv9";
programUrl[12] = "http://vtc.com.vn/lp/12/htv9.aspx";

programID[13] = "hbo";
programUrl[13] = "http://vtc.com.vn/lp/12/htv9.aspx";

programID[14] = "itv";
programUrl[14] = "http://www.itv.vn/";

function kenhdoc(id_)
{    
    if(id_=='1')
    {
        top.location.href="kvtv.aspx?catid=21";
    }
    document.location.href="tv.aspx?xurl="+id_;
}
function vn_online(id_)
{
    document.location.href="tv.aspx?url="+id_;   
}
function getTVOnlineTV(url)
{
   document.getElementById('container').innerHTML="<iframe src=\"gettvonline.aspx?url="+url+"\" frameborder=0 scrolling=\"no\" marginwidth=0 marginheight=0 height=\"380px\" width=\"480px\"  scrolling=\"no\"></iframe>";
    
}
function getTVOnline(url)
{
   document.getElementById('container').innerHTML="<iframe src=\"gettvonline.aspx?url="+url+"\" frameborder=0 scrolling=\"no\" marginwidth=0 marginheight=0 height=\"283px\" width=\"377px\" scrolling=\"no\"></iframe>";
    
}
function ShowTV1(id_)
{

url  =document.location.href;
if(url.indexOf('index.aspx')>-1)
{
   document.location.href = 'tv.aspx?id='+id_;
}
    for(i=0;i<ArrayId.length;i++)
    {
        if(id_==ArrayId[i].toString())
        {
            ShowTVItem(ArrayValues[i].toString());
        }
    }
}
function Savepass()
{
    v = document.getElementById('hidenurl').value;
    if(v=="0")
    {
        document.getElementById('hidenurl').value = "1";
    }
    else
    {
        document.getElementById('hidenurl').value = "0";
    }
}
function LeftSearch1()
{
 leftvalue_ = document.getElementById('searchall').value;
    if(leftvalue_=='')
    {
        alert('Vui lòng nhập từ khóa');
        return;
    }
    link = "http://www.google.com.vn/search?as_q=&hl=vi&num=10&btnG="+leftvalue_+"=&as_oq=&as_eq=&lr=&cr=&as_ft=i&as_filetype=&as_qdr=all&as_occt=any&as_dt=i&as_sitesearch=thuonghieudoanhnghiep.com&as_rights=";
    
    document.location.href='google.aspx?key='+leftvalue_;
}
function LeftSearch3()
{
    leftvalue_ = document.getElementById('searchall').value;
    if(leftvalue_=='')
    {
        alert('Vui lòng nhập từ khóa');
        return;
    }
    document.location.href='newscom.aspx?key='+leftvalue_;
}
function LeftSearch()
{
    leftvalue_ = document.getElementById('searchall').value;
    if(leftvalue_=='')
    {
        alert('Vui lòng nhập từ khóa');
        return;
    }
    
    document.location.href='listcom.aspx?key='+leftvalue_;
}
function ShowEmail()
{
    show_data_post('mail.aspx?e='+document.getElementById('txtemailleft').value);
}
function topmenu(id_)
{
    link = "index.aspx";
    if(id_=="1")
    {
         link = "index.aspx";
    }
    else if(id_=="2")
    {
         link = "comdetail.aspx?userid=58";
    }
    else if(id_=="3")
    {
         link = "readrss.aspx";
    }
    else if(id_=="4")
    {
         link = "showtv.aspx?istivi=1";
    }
    else if(id_=="5")
    {
         link = "need.aspx";
    }
    else if(id_=="6")
    {
         link = "contact.aspx";
    }
    else if(id_=="7")
    {
         link = "hl.aspx";
    }
    else if(id_=="8")
    {
         link = "hl.aspx?e=e";
    }
    else
    {
        link = "index.aspx";
    }
   
    document.location.href=link;
}


