var VG_statusstr2 =    "...5 min from the next Golfcourse...15 min from Center Cape Town...30 meters from the perfect Windsurf-Kite spot...0 meter to the own pool...0 meter to your perfect holiday accommodation";
var VG_statusstr2tmp = "."; 
var VG_PicLauf_Home = -1
var VG_Piclauf_Speed = 4000
var VG_Piclauf_Dir = "forward"
var VG_Piclauf_Status = "auto"
var VG_PicLauf_Deluxe = 0
var VG_PicLauf_Junior = 0
var VG_PicLauf_Superior = 0
var VG_PicLauf_LivingKitchenPool = 0

var VG_LoadFinish = 0
var VG_WaitForLoad = 0
var VG_Blink = 0

var VGa_PicHome = new Array
                      (
                        "Source/Pics/Home_1.jpg",
                        "Source/Pics/Home_2.jpg",
                        "Source/Pics/Home_3.jpg",
                        "Source/Pics/Home_4.jpg",
                        "Source/Pics/Home_5.jpg",
                        "Source/Pics/Home_6.jpg",
                        "Source/Pics/Home_7.jpg",
                        "Source/Pics/Home_8.jpg",
                        "Source/Pics/Home_9.jpg",
                        "Source/Pics/Home_10.jpg",
                        "Source/Pics/Home_11.jpg",
                        "Source/Pics/Home_12.jpg",
                        "Source/Pics/Home_13.jpg",
                        "Source/Pics/Home_14.jpg",
                        "Source/Pics/Home_15.jpg",
                        "Source/Pics/Home_16.jpg",
                        "Source/Pics/Home_17.jpg",
                        "Source/Pics/Home_18.jpg",
                        "Source/Pics/Home_19.jpg",
                        "Source/Pics/Home_20.jpg",
                        "Source/Pics/Home_21.jpg",
                        "Source/Pics/Home_22.jpg",
                        "Source/Pics/Home_23.jpg"
                      )
var VGa_PicRoomsDeluxe = new Array
                      (
                        "Source/Pics/Rooms_Deluxe_1.jpg",
                        "Source/Pics/Rooms_Deluxe_2.jpg",
                        "Source/Pics/Rooms_Deluxe_3.jpg",
                        "Source/Pics/Rooms_Deluxe_4.jpg"
                      )
var VGa_PicRoomsJunior = new Array
                      (
                        "Source/Pics/Rooms_Junior_1.jpg",
                        "Source/Pics/Rooms_Junior_2.jpg",
                        "Source/Pics/Rooms_Junior_3.jpg"
                      )
var VGa_PicRoomsSuperior = new Array
                      (
                        "Source/Pics/Rooms_Superior_1.jpg",
                        "Source/Pics/Rooms_Superior_2.jpg"
                      )

var VGa_PicRoomsLivingKitchenPool = new Array
                      (
                        "Source/Pics/Rooms_LivingKitchenPool_1.jpg",
                        "Source/Pics/Rooms_LivingKitchenPool_2.jpg",
                        "Source/Pics/Rooms_LivingKitchenPool_3.jpg",
                        "Source/Pics/Rooms_LivingKitchenPool_4.jpg",
                        "Source/Pics/Rooms_LivingKitchenPool_5.jpg",
                        "Source/Pics/Rooms_LivingKitchenPool_6.jpg",
                        "Source/Pics/Rooms_LivingKitchenPool_7.jpg",
                        "Source/Pics/Rooms_LivingKitchenPool_8.jpg"
                      )

var VGa_PicLoft2 = new Array
                      (
                        "Source/Pics/Loft2_Home1.jpg",
                        "Source/Pics/Loft2_Home2.jpg",
                        "Source/Pics/Loft2_Home3.jpg"
                      )

var VGa_PreImage = new Array()
var V_PreImageCounter=0

function F_PreImageLoader(V_Array,V_Count)
{
  for (var V_i = V_Count; V_i < V_Count+V_Array.length; V_i++)
  {
    V_PreImageCounter = V_PreImageCounter + 1
    VGa_PreImage[V_i] = new Image
    VG_WaitForLoad = 0
    VGa_PreImage[V_i].onLoad=imagesLoaded()
    VGa_PreImage[V_i].src = VGa_PicHome[V_i]
    while (VG_WaitForLoad == 0 )
    {
    }
  }
}

function imagesLoaded()
{
  VG_WaitForLoad = 1
}

function FG_StopPicLauf()
{
   VG_Piclauf_Status = "stop"
   window.clearTimeout(this.timeoutid)
}

function FG_StartPicLauf()
{
   if (VG_Piclauf_Status == "auto") return;
   VG_Piclauf_Status = "auto"
   VG_Piclauf_Dir = "forward"
   F_PicmoveMain()
}

function FG_ForwardPicLauf()
{
   VG_Piclauf_Status = "manual"
   VG_Piclauf_Dir = "forward"
   F_PicmoveMain()
}

function FG_BackwardPicLauf()
{
   VG_Piclauf_Status = "manual"
   VG_Piclauf_Dir = "backward"
   F_PicmoveMain()
}

function FG_InitHome()
{
  V_PreImageCounter = 0
  F_PreImageLoader(VGa_PicLoft2,3)
  F_PreImageLoader(VGa_PicHome,0)
  F_scroll2()
  F_Flicker()
  VG_Piclauf_Status = "auto"
  VG_Piclauf_Dir = "forward"
  F_PicmoveMain()
  window.document.getElementById("V_Loft2_1").src = VGa_PicLoft2[0]
  window.document.getElementById("V_Loft2_2").src = VGa_PicLoft2[1]
  window.document.getElementById("V_Loft2_3").src = VGa_PicLoft2[2]
}

function FG_InitRooms()
{
  V_PreImageCounter = 0
  F_PreImageLoader(VGa_PicRoomsDeluxe,V_PreImageCounter)
  F_PreImageLoader(VGa_PicRoomsDeluxe,V_PreImageCounter)
  F_PreImageLoader(VGa_PicRoomsSuperior,V_PreImageCounter)
  F_PreImageLoader(VGa_PicRoomsLivingKitchenPool,V_PreImageCounter)
  
  window.document.getElementById("V_deluxe_1").src = VGa_PicRoomsDeluxe[0]
  window.document.getElementById("V_deluxe_2").src = VGa_PicRoomsDeluxe[1]
  window.document.getElementById("V_deluxe_3").src = VGa_PicRoomsDeluxe[2]
  window.document.getElementById("V_deluxe_4").src = VGa_PicRoomsDeluxe[3]
  
  window.document.getElementById("V_junior_1").src = VGa_PicRoomsJunior[0]
  window.document.getElementById("V_junior_2").src = VGa_PicRoomsJunior[1]
  window.document.getElementById("V_junior_3").src = VGa_PicRoomsJunior[2]

  window.document.getElementById("V_superior_1").src = VGa_PicRoomsSuperior[0]
  window.document.getElementById("V_superior_2").src = VGa_PicRoomsSuperior[1]
  
  window.document.getElementById("V_livingkitchenpool_1").src = VGa_PicRoomsLivingKitchenPool[0]
  window.document.getElementById("V_livingkitchenpool_2").src = VGa_PicRoomsLivingKitchenPool[1]
  window.document.getElementById("V_livingkitchenpool_3").src = VGa_PicRoomsLivingKitchenPool[2]
  window.document.getElementById("V_livingkitchenpool_4").src = VGa_PicRoomsLivingKitchenPool[3]
  window.document.getElementById("V_livingkitchenpool_5").src = VGa_PicRoomsLivingKitchenPool[4]
  window.document.getElementById("V_livingkitchenpool_6").src = VGa_PicRoomsLivingKitchenPool[5]
  window.document.getElementById("V_livingkitchenpool_7").src = VGa_PicRoomsLivingKitchenPool[6]
  window.document.getElementById("V_livingkitchenpool_8").src = VGa_PicRoomsLivingKitchenPool[7]
}

function F_scroll2()
{ 
  var len
  window.document.getElementById("News_Laufschrift2").innerHTML = unescape(VG_statusstr2tmp)
  VG_statusstr2 = VG_statusstr2.substring(1,VG_statusstr2.length) + VG_statusstr2.substring(0,1); 
  VG_statusstr2tmp = VG_statusstr2.substring(0,115);
  task_id=window.setTimeout("F_scroll2()",200); 
  return;
} 

function F_PicmoveMain()
{
var V_path
var V_Image
    if (VG_Piclauf_Status == "stop") return;
    if (VG_Piclauf_Dir == "forward")
    {
       VG_PicLauf_Home = VG_PicLauf_Home + 1
       if (VG_PicLauf_Home == VGa_PicHome.length ) VG_PicLauf_Home = 0
    }
    else
    {
       VG_PicLauf_Home = VG_PicLauf_Home - 1
       if (VG_PicLauf_Home == -1) VG_PicLauf_Home = VGa_PicHome.length-1
    }
    V_path = VGa_PicHome[VG_PicLauf_Home]
    V_Image= new Image()
    V_Image.src = V_path
    window.document.getElementById("IMG_Laufpic").width = 760
    window.document.getElementById("IMG_Laufpic").height = 384
    window.document.getElementById("IMG_Laufpic").src = V_path
    if (VG_Piclauf_Status == "auto")
    {
       this.timeoutid = task_id=window.setTimeout("F_PicmoveMain()",VG_Piclauf_Speed);   
    }
return;
}

function FG_Load_Page(V_Language, V_Page)
{
  var V_attachedValue = V_Language
  var V_newURL = V_Page
  self.location.href = V_newURL + V_attachedValue //Load the new page
}

function FG_Load_PageToFrame(V_Language, V_Page, V_Frame)
{
  window.parent.frames[V_Frame].location.href = V_Page + V_Language 
}

function FG_GetBigPic(V_source)
{
var V_src = V_source
var V_srcnew
  V_srcnew = String(V_src).substring(0,V_src.length-4)
  V_srcnew=V_srcnew + "_big.jpg"
return V_srcnew
}

function FG_GetPDF(V_source)
{
var V_src = V_source
var V_srcnew
  V_srcnew = String(V_src).substring(0,V_src.length-4)
  V_srcnew=V_srcnew + "_big.pdf"
return V_srcnew
}


function F_Flicker()
{ 
  //var len
  //window.document.getElementById("News_Laufschrift2").innerHTML = unescape(VG_statusstr2tmp)
  //VG_statusstr2 = VG_statusstr2.substring(1,VG_statusstr2.length) + VG_statusstr2.substring(0,1); 
  //VG_statusstr2tmp = VG_statusstr2.substring(0,115);
 
 if (VG_Blink == 0)
 {
    VG_Blink = 1 
   window.document.getElementById("New_Opening").style.background = '#000000'
   window.document.getElementById("New_Opening").style.color = '#FFFFFF'
 }
 else
 {
    VG_Blink = 0
    window.document.getElementById("New_Opening").style.background = '#FFFFFF'
    window.document.getElementById("New_Opening").style.color = '#000000'
 }
  task_id=window.setTimeout("F_Flicker()",200); 
  return;
} 

