﻿//var somethinggood="";

//	$.ajax({
//		type: "GET",
//		async: "true",
//		url: "../../php/googleapi.php",
//		success: function(php) {
//			somethinggood=String(php);
//			$('#weather').html(somethinggood + 'yes');
//		}		
//	});
//document.write("weather: " + somethinggood);

//$(document).ready(function(){
//  jQuery.getScript("http://www.google.com/ig/api?hl=en-us&weather=,,,25012085,121465701", function(ddd){
//	alert(ddd);
//  });
//});

//$.getJSON("http://www.google.com/ig/api?hl=en-us&weather=,,,25012085,121465701&format=json&jsoncallback=?", function(data){
//	//alert(data);
//});


//var oReq = new XMLHttpRequest();
//oReq.open("GET", "http://www.google.com/ig/api?hl=en-us&weather=,,,25012085,121465701", false);
//oReq.send(null);
//alert(oReq.responseXML.xml);

//  xmlhttp=null;
//  var Url="http://www.google.com/ig/api?hl=en-us&weather=,,,25012085,121465701"
  // THE SERVER SCRIPT TO HANDLE THE REQUEST
//  if (window.XMLHttpRequest)
//  {
//	xmlhttp=new XMLHttpRequest()
//	// For all modern browsers
//  } else if (window.ActiveXObject) {
//	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
//	// For (older) IE
//  }
//  if (xmlhttp!=null)
//  {
//	xmlhttp.onreadystatechange=onStateChange;
//	xmlhttp.open("GET", Url, true);
	//  (httpMethod,  URL,  asynchronous)
	// xmlhttp.overrideMimeType('text/xml');
//	xmlhttp.send(null);
//  } else {
//	alert("The XMLHttpRequest not supported");
//  }
//alert(xmlhttp.responseXML.xml);





//'../../javascript/media_en_US.xml'
//$('#promotionmsg').load('http://www.google.com/ig/api?hl=en-us&weather=,,,25012085,121465701');

//    doAjax("http://www.google.com/ig/api?hl=en-us&weather=,,,25012085,121465701");
//    return false;

//$.ajax({
//	type: "POST",	
//	url: "http://www.google.com/ig/api?hl=en-us&weather=,,,25012085,121465701",
//	contentType: "application/json; charset=utf-8",
//	async: "false",
  //      dataType: "jsonp",
//        success: function(msg) {alert("ok");}
//});


//if (window.XMLHttpRequest)
//  {// code for IE7+, Firefox, Chrome, Opera, Safari
//  xmlhttp=new XMLHttpRequest();
//  }
//else
//  {// code for IE6, IE5
//  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
//  }

//xmlhttp.onreadystatechange=function()
//{
//  if (xmlhttp.readyState==4 && xmlhttp.status==200)
//    {
//    alert(xmlhttp.responseText);
//    }
//}

//xmlhttp.open("GET","../../javascript/hello.txt",true);
//xmlhttp.open("GET","http://www.google.com/ig/api?hl=en-us&weather=,,,25012085,121465701",true);
//xmlhttp.send();
//alert("what");


if (var_index=="1") v_languagename=v_foldername;
var currentdatetime=new Date();
Date.prototype.addHours= function(h){
    this.setHours(this.getHours()+h);
    return this;
}
currentdatetime=currentdatetime.addHours(hour_difference);
if (this_website==1)
{
	currentdatetime=currentdatetime.addHours(1);
}
else if(this_website==2)
{
	currentdatetime=currentdatetime.addHours(1);
}
else if(this_website==3)
{
	currentdatetime=currentdatetime.addHours(1);
}
else if(this_website==4)
{
	currentdatetime=currentdatetime.addHours(1);
}
else if(this_website==5)
{
	currentdatetime=currentdatetime.addHours(1);
}
else if(this_website==6)
{
	currentdatetime=currentdatetime.addHours(1);
}
else if(this_website==7)
{
	//currentdatetime=currentdatetime.addHours(0);
}
//var_milisecond=currentdatetime.getTime();
var_secont=currentdatetime.getSeconds();
var_minute=currentdatetime.getMinutes();
var_hour=currentdatetime.getHours();
//var_weekday=currentdatetime.getDay();
var_day=currentdatetime.getDate();
var_month=currentdatetime.getMonth();
var_year=currentdatetime.getFullYear();
var_monthname="";
if (var_hour > 12)
{
	var_hour=var_hour - 12;
	var_am_pm=" PM";
}
else
{
	var_am_pm=" AM";
}
var_hour=("" + (100 + var_hour)).substring(1);
var_minute=("" + (100 + var_minute)).substring(1);
if (v_languagename == "en_us" || v_languagename == "en_US" || var_index =="-1")
{
	switch (var_month)
	{
        case 0: var_monthname="Jan";
        break;

        case 1: var_monthname="Feb";
        break;

        case 2: var_monthname="Mar";
        break;

        case 3: var_monthname="Apr";
        break;

        case 4: var_monthname="May";
        break;

        case 5: var_monthname="June";
        break;

        case 6: var_monthname="July";
        break;

        case 7: var_monthname="Aug";
        break;

        case 8: var_monthname="Sept";
        break;

        case 9: var_monthname="Oct";
        break;

        case 10: var_monthname="Nov";
        break;

        case 11: var_monthname="Dec";
        break;
	}
}

if (v_languagename != "en_us" && v_languagename != "en_US" && var_index !="-1")
{
	document.write(trans_localtime + ': ' + var_year + ' ' + trans_year + ' ' + (var_month + 1) + ' ' + trans_month + var_day + ' ' + trans_day + ' ' + var_hour + ':' + var_minute + var_am_pm);
}
else
{
	document.write(trans_localtime + ': ' + ("" + (100 + var_day)).substring(1) + ' ' + var_monthname + ' ' + var_year + ' ' + var_hour + ':' + var_minute + var_am_pm);
}

// ie7 issue: missing weather fixed
$.ajaxSettings.cache = false;

if (var_index=="-1")
{
	$.ajax({url:"php/weather.php?c=" + var_yahoowid, success:function(result){
	  $("#weather").append(result);
	}});
}
else if (var_index=="1")
{
	$.ajax({url:"../php/weather.php?c=" + var_yahoowid, success:function(result){
	  $("#weather").append(result);
	}});
}
else
{
	$.ajax({url:"../../php/weather.php?c=" + var_yahoowid, success:function(result){
	  $("#weather").append(result);
	}});
}


