var AppPath="/";
function executeHandler(){
if (window.location.href.toLowerCase().indexOf("cmspagemode=edit")>0){  // exiting if in the sitefinity edit mode
 return false;
}

$(document).ready(function(){
 assignLinks();
 newCssSelector();
 fixFonts();
 //AddClass();
 //AddClasstoli();
 
 //End

if (jQuery.browser.msie && jQuery.browser.version == '6.0') {
  DD_belatedPNG.fix('.header,img');
}

var sfhover = function(){
 if (jQuery.browser.msie){
  $('ul.nav > li').hover(
	function(){
	  $(this).find('ul:first').css({display:'block'});
	},
	function(){
	  $(this).find('ul:first').css({display:'none'});
   });
  }
 }
 sfhover();
 });

 
 $('ul.nav > li,ul.nav2 > li').hover(
	
	function(){
	  $(this).addClass('active');
	},
	function(){
	  $(this).removeClass('active');
   }); 
 }

// <summary>
//  This function to assign target blank to the external link. html target blank is not a standard w3c validated code. insted of using target="_blank" we use rel="external" and replace the rel with javascript.
// </summary>

function assignLinks() 
{
 $("a[rel='external']").attr("target","_blank");
 $("a[href='#']").click(function(){
  return false;
 });
}


function newCssSelector() 
{
  $("ul.topNav > li:first-child").addClass("first1Child");
  $("ul li:first-child").addClass("firstChild");
  $("ul li:last-child").addClass("lastChild");
}

function AddClass() {
$('#Nav > li').hover(
 function(){
  $(this).addClass('selected');
 },
function(){
  $(this).removeClass('selected');
});
}

var $tranform1 = $('h1,h2');
var $tranform = $('ul.nav > li > a,h1');
function fixFonts() {
 Cufon.set('fontFamily', 'helvetica');
 Cufon.replace( $tranform , { 
  hover: true,
  textShadow: '1px 1px 1px #000'  
 });
 Cufon.replace( $tranform1 , { 
  hover: true
 });
}
 
function Cycle() {
$(function() {
  $('div.back').cycle({
    fx:    'fade',
    pause:  1,
    speed:  'slow',
    timeout: 3500,
    pager:  '#pager',
    slideExpr: 'img'
  });
});
}

function AddClasstoli() { 
  $('ul.nav li').eq(2).addClass('noMargin');
  $('ul.nav li').eq(5).addClass('noMargin');
  $('ul.nav li').eq(8).addClass('noMargin');
}


function googleMapInitialize()
{
 if (GBrowserIsCompatible()) {
  $("#googleMap").css({display: "block"});
  var map = new GMap2(document.getElementById("googleMap"));
  var point;
  map.setCenter(new GLatLng(25.003427, 55.155014), 17);
  point = new GLatLng(25.003427, 55.155014);
    map.openInfoWindow(map.getCenter(), "<div class='GooglemapLogo'><p><strong>Sabban Property Investments <br />Falcon House. <br />Dubai Investment Park, <br />Jebel Ali.<br /></strong><br /></p></div>");
     map.setMapType(G_NORMAL_MAP);
    map.setMapType(G_HYBRID_MAP);
    //map.setUIToDefault();
    var bottomRight = new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,10));
    map.addControl(new GMapTypeControl(),bottomRight);
  var bottomLeft = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(10,10));
  map.addControl(new GLargeMapControl3D,bottomLeft);
  map.addOverlay(new GMarker(point));
 }
}


