﻿
function updateClock ( )
{
  var currentTime = new Date ( );

  var currentHours = currentTime.getHours ( );
  var currentMinutes = currentTime.getMinutes ( );
  var currentSeconds = currentTime.getSeconds ( );

  // Pad the minutes and seconds with leading zeros, if required
  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
  currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

  // Choose either "AM" or "PM" as appropriate
  var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

  // Convert the hours component to 12-hour format if needed
  currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

  // Convert an hours component of "0" to "12"
  currentHours = ( currentHours == 0 ) ? 12 : currentHours;

  // Compose the string for display
  var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;

  // Update the time display
  document.getElementById("clock").firstChild.nodeValue = currentTimeString;
}

function loadContentPage(contentPageName, categoryType, currentPageTitle)
{
	//Hide current links
	$(".contentNavLink").css({'display':'none'});
	
	if(categoryType!= null)
	{
		$("#lnk" + categoryType).css({'display':'inline'});
	}
	
    $("#lblContentPageTitle").html(currentPageTitle);

	loadPage = 'content/' + contentPageName+ '.html';
	$("#contentPageContent").load(loadPage);
	$("#toolTipBox").css({ 'display': 'none' });
	$("#pager").css({ 'display': 'none' });
}

function settitle(type)
{
    var pager = null;
	switch(type){	
	case 'home':
	    title = 'ברוכים הבאים לפוקט וורלדס';
	    text = 'פוקט וורלדס מתמחה בפיתוח ויישום פתרונות לניו מדיה.';
	    break;
	case 'services':
	    title = 'שירותים אינטרקטיביים';
	    text = 'פוקט מספקת פלטפורמה (IVR,SMS,WAP) להפעלת שירותים אינטרקטיביים מול משתמשי הקצה.';
	    pager = '<img src="images/pager_2.png">';
	    break;
	case 'development':
	    title = 'שירותי פיתוח';
	    text = 'פוקט מתמחה בפיתוח אפליקציות ל-Web  ולסלולר המותאמים לצרכים שלך.';
	    pager = '<img src="images/pager_1.png">';
	    break;
	case 'mobilemarketing':
	    title = 'שיווק סלולרי';
	    text = 'מגוון פתרונות לשיווק ממוקד ולהנעה לפעולה בקמפיין עצמאי או להשלמת המדיה המסורתית.';
	    pager = '<img src="images/pager_3.png">';
	    break;
	case 'mobiletools':
	    title = 'כלים סלולריים';
	    text = 'מגוון מוצרים סלולרים המעשירים ומעצימים את האתר שלך.';
	    pager = '<img src="images/pager_4.png">';
	    break;
	}

	$('#msgboxtitle').html(title);
	$('#msgboxtext').html(text);
	$('#toolTipBox').css({ 'display': 'block' });

    if (pager != null) {
        $("#pager").css({ 'display': 'block' });
        $('#pager').html(pager);
    }
    else {
        $("#pager").css({ 'display': 'none' });
    }
}

function showUrl(url) {
    window.open(url);
}

function showImage(image) {
    window.open("images/clients/" + image);
}


function hideURLbar() {
        window.scrollTo(0, 1);
}

