﻿var CompanyName = 'OCEAN SECURITIES - CÔNG TY CỔ PHẦN CHỨNG KHOÁN ĐẠI DƯƠNG';
var PhoneNumber = '04 37726699';
var FaxNumber = '04 37726763';
var Email = 'admin@ocs.com.vn';
var ImgConectShow=4;
var BannerContent='FlexChart/Vn_Ha_Index.swf';
var RContent="WebData/TygiaTiente.swf";
var ClientLocation;
var Address = 'số 4 Láng Hạ - Ba Đình - Hà Nội';
var tiempo=setTimeout("scroll()",.1);
        function scroll()
        {
            window.status= CompanyName ;
            tiempo=setTimeout("scroll()",.1);
            return true;
        }
	/////////////////////////////////
	/////// Date Time //////////////
	////////////////////////////////
	    var today = new Date();
		var thisHours = today.getHours();
		var thisMinutes = today.getMinutes();
		var weekdayNames = ['Chủ nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'];
		var weekdayNamesEL = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
		var monthNamesR = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
		var thisDay = today.getDay();		
		var thisDate = today.getDate();
		var currMonth = today.getMonth();
		var currYear = today.getFullYear();
		if(today.getMinutes() < 10) {thisMinutes = "0" + today.getMinutes()};
		if(today.getHours() < 10) {thisHours = "0" + today.getHours()};
		function CurrentDatetime(d) 
		{
		    if(thisDate.length==1)thisDate="0"+thisDate;
			if(d==0)		
				return (weekdayNames[thisDay] + ", " + thisDate + "-" + monthNamesR[currMonth] + "-" + currYear );
			else return(weekdayNamesEL[thisDay] + ", " + monthNamesR[currMonth] + "-" +thisDate + "-" + currYear );
		}
		function DrawBanner(urlBanner)
		{		
		    var s = "<object data='"+urlBanner+"' type='application/x-shockwave-flash' height='250px' width='600px'>";
		    s += "<param name='movie' value='"+urlBanner+"'>";	
		   
		    s += "</object>";
		    return s;		
		}
		function DrawBanner_new(urlBanner)
		{		
		    var s = "<object data=\""+urlBanner+"\"  type=\"application/x-shockwave-flash\" height=\"130px\" width=\"300px\">";
		    s += "<param name=\"movie\"  value=\""+urlBanner+"\">";		
//		    s+="<param name=\"allowScriptAccess\" value=\"sameDomain\" />"	   
//		    s+= "<param name=\"play\" value=\"true\" />"
		    s += "</object>";
		    return s;		
		}
		function DrawRate(urlBanner)
		{		
		    var s = "<object data='"+urlBanner+"' type='application/x-shockwave-flash' height='490px' width='300px'>";
		    s += "<param name='movie' value='"+urlBanner+"'>";		
		    s += "</object>";
		    return s;		
		}
//////////////////////////////////////////////////////////////////////////////////////////////////////

var http;
    function reset()
	{	      
		if(http && http.readyState != 0){
			http.onreadystatechange = function(){};
			http.abort();
		}
		http = null;
	}
    function CreatHTTPObject() 
    {	 
        
	    if(typeof ActiveXObject != 'undefined') {
		    try {http = new ActiveXObject("Msxml2.XMLHTTP");}
		    catch (e) {
			    try {http = new ActiveXObject("Microsoft.XMLHTTP");}
			    catch (E) {http = false;}
		    }
	    } else if (XMLHttpRequest) {
		    try {http = new XMLHttpRequest();}
		    catch (e) {http = false;}
	    }
	    return http;
    }   
    function ProcessRequestCompany(v_params)
		{	
		    	
			if(http!=null)
			{
				http.onreadystatechange = readerCompany;
				http.open("GET", "WebData/CompanyPages.aspx?"+v_params, true);
				http.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
				http.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
				http.setRequestHeader("Pragma", "no-cache");				
	            http.setRequestHeader("Content-length",v_params.length);
				http.send(null);
			}			
		} 
		function ProcessRequestDetail(v_params)
		{	
		    	
			if(http!=null)
			{
				http.onreadystatechange = reader;
				http.open("GET", "WebData/DetailNews.aspx?"+v_params, true);
				http.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
				http.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
				http.setRequestHeader("Pragma", "no-cache");				
	            http.setRequestHeader("Content-length",v_params.length);
				http.send(null);
			}			
		}   
    function reader() 
    {    
	     if(http.readyState == 4 && http.status == 200)
	     {        
		   document.getElementById('Content_table_MN1_DetailIntruction').innerHTML=http.responseText;//	xmlDoc.firstChild.nodeValue		  
		   
	     }	
	     else{	   
	     } 
	}     
    function readerCompany() 
    {    
	     if(http.readyState == 4 && http.status == 200)
	     { 
		   document.getElementById('Div_company_Content_List').innerHTML=http.responseText;// xmlDoc.firstChild.nodeValue		  
		   document.getElementById('LoadingCompany').innerHTML= "";		  
		   reset();
	     }	
	     else{	        
	     }
	}    
    function ProcessRequestFull()
		{	
		
			if(http!=null)
			{	 			
				http.onreadystatechange = readerFull;	
				http.open("GET", "WebData/FullLayOut.aspx", true);
				http.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
				http.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
				http.setRequestHeader("Pragma", "no-cache");
				http.send(null);
			}			
		}  
		
    function readerFull() 
    {   
        
	     if(http.readyState == 4 && http.status == 200)
	     {	
		   getObj('FullLayoutNews').innerHTML=http.responseText;
		   reset();		 
	     }	
	     else{	   
	     //getObj('FullLayoutNews').innerHTML="<font color=red>Server Error</font>"//GetDataFromresponse
	     } 
	}   
function getObj(name)
{
  if (document.getElementById)
  {
    if(document.getElementById(name))
      return document.getElementById(name);
    //else
      //return false;
  }
  else if (document.all)
  {
	if (document.all[name])
      return document.all[name];
   // else
    //  return false; 
  }
  else if (document.layers)
  {
    if (document.layers[name])
      return document.layers[name];
    //else
     // return false;
  }
  return false
} 