function BreakFrame( ) {
   if (window != top) {
      top.location.href = location.href;
   }
}

function Bookmark( ) {
   if ( navigator.userAgent.indexOf("Opera") != -1 ) {
      alert("Press Ctrl + T to bookmark this Webpage");
   } else if ( navigator.appName.indexOf("Microsoft") != -1 && parseInt(navigator.appVersion) >= 4 ) {
      window.external.AddFavorite('http://jobs.theemiratesnetwork.com/','TEN Jobs');
   } else {
      alert("Press Ctrl + D to bookmark this Webpage");
   }
}

function OpenBrowserWindow(theURL,winName,features,width,height) {
  var opera_minus = 0;
  if (navigator.userAgent.indexOf('Opera') != -1) {
     var OperaVersionLoc = navigator.userAgent.indexOf('Opera') + 6;
     var OperaVersion = parseInt( navigator.userAgent.substring(OperaVersionLoc,OperaVersionLoc+4) );
     if ( OperaVersion >= 7 ) {
        width = width + 16;
        height = height + 16;
     }
     resultsWindow = window.open(theURL,winName,features + "width=" + width.toString() + ",height=" + height.toString());
  } else if (navigator.appName.indexOf('Netscape') != -1) {
     width = width + 16;
     height = height + 24;
     resultsWindow = window.open(theURL,winName,features + "width=" + width.toString() + ",height=" + height.toString());
  } else if (navigator.appName.indexOf('Microsoft') != -1) {
     width = width + 20;
     height = height + 30;
     resultsWindow = window.open(theURL,winName,features + "width=" + width.toString() + ",height=" + height.toString());
  } else {
     resultsWindow = window.open(theURL,winName,features + "width=" + width.toString() + ",height=" + height.toString());
  }

  if ( self.screen ) {
     var TopRightX = ( screen.availWidth - width - 10 ) / 2;
     var TopRightY = ( screen.availHeight - height - 29 - opera_minus ) / 2;
  } else {
     var TopRightX = 20;
     var TopRightY = 20;
  }

  resultsWindow.moveTo( TopRightX, TopRightY );
}

function MM_openBrWindow(theURL,winName,features) { // Philipz Inc.
  var popupFeatures = features.split(",");
  var FeatureValue;
  var newFeatures = "";
  var width = 0;
  var height = 0;
  for ( var x = 0; x < popupFeatures.length; x++ ) {
     FeatureValue = popupFeatures[x].split("=");
     if ( FeatureValue[0] == "width" ) {
        width = parseInt( FeatureValue[1] );
     } else if ( FeatureValue[0] == "height" ) {
        height = parseInt( FeatureValue[1] );
     } else {
        newFeatures = newFeatures + popupFeatures[x] + ",";
     }
  }
  features = newFeatures.substring(0,newFeatures.length-1);

  if ( width != 0 && height != 0 ) {
     var OperaAdjustment = 0;
     if (navigator.userAgent.indexOf('Opera') != -1) {
        var OperaVersionLoc = navigator.userAgent.indexOf('Opera') + 6;
        var OperaVersion = parseInt( navigator.userAgent.substring(OperaVersionLoc,OperaVersionLoc+4) );
        if ( OperaVersion >= 7 && OperaVersion < 9 ) {
           width = width + 26;
           height = height + 6;
        }
        OperaAdjustment = 70;
     } else if (navigator.appName.indexOf('Netscape') != -1) {
        width = width + 16;
        height = height + 24;
     } else if (navigator.appName.indexOf('Microsoft') != -1) {
        width = width + 20;
        height = height + 30;
     }
     features = features + "width=" + width.toString() + ",height=" + height.toString();
     resultsWindow = window.open(theURL,winName,features);

     var TopRightX = 20;
     var TopRightY = 20;

     if ( self.screen ) {
        TopRightX = ( screen.availWidth - width - 10 ) / 2;
        TopRightY = ( screen.availHeight - height - OperaAdjustment - 29 ) / 2;
        if ( TopRightY < 0 ) { TopRightY = 0; }
        if ( TopRightX < 0 ) { TopRightX = 0; }
     }

     resultsWindow.moveTo( TopRightX, TopRightY );
  } else {
     resultsWindow = window.open(theURL,winName,features);
  }
}

function clearit ( fieldtoclear, textvaluetoclear ) {
	var object1 = document.getElementById(fieldtoclear);
	if ( object1.value == textvaluetoclear ) {
		object1.value = '';
	}
}

function hide_show ( object_name ) {
   object1 = document.getElementById(object_name);
   if ( object1.style.display == "none" ) {
      object1.style.display = "block";
   } else {
      object1.style.display = "none";
   }
}