// initialize main menu
ddsmoothmenu.init({
mainmenuid: "smoothmenu",
orientation: "h",
classname: "ddsmoothmenu",
shadow: false,
contentsource: "markup"
})


// cufon replace text with images via svc
Cufon.replace('h1,h3,.euro,#join-mnl-grid th, ,#join-mnl-grid td, .mediaPortfolio', { fontFamily: 'Eurostile LT Std', hover: true });
Cufon.replace('h4,.bank,th', { fontFamily: 'BankGothic Lt BT', hover: true });


// Login Popup
var popupStatus = 0;
function loadPopup(){
if(popupStatus==0) {
$("#backgroundPopup").css({
"opacity": "0.7"
});
$("#backgroundPopup").fadeIn("slow");
$("#login").fadeIn("slow");
$("#name").focus();
popupStatus = 1;
}
}


function disablePopup(){
  if(popupStatus==1){
    document.getElementById('errortxt').innerHTML = "";
    $("#backgroundPopup").fadeOut("slow");
    $("#login").fadeOut("slow");
    popupStatus = 0;
  }
}

// Coming Popup
$(document).ready(function(){
$(".comingsoon").click(function(){
popupcoming();
return false;
});

$("#bgpopupcoming").click(function(){
$("#bgpopupcoming").fadeOut("slow");
$("#popupcoming").fadeOut("slow");
this.popcoming = 0;
});

$("#popupcoming .close").click(function(){
$("#bgpopupcoming").fadeOut("slow");
$("#popupcoming").fadeOut("slow");
this.popcoming = 0;
});

});
var popcoming = 0;
function popupcoming() {
/*if(popcoming == 0) {*/
$("#bgpopupcoming").css({
"opacity": "0.7"
});
$("#bgpopupcoming").fadeIn("slow");
$("#popupcoming").fadeIn("slow");
this.popcoming = 1;
/*}*/ /*else {
$("#bgpopupcoming").fadeOut("slow");
$("#popupcoming").fadeOut("slow");
this.popcoming = 0;
}*/
}

/* My account */
var oldPassword = $('#oldPassword').val();
var newPassword = $('#newPassword').val();
var confirmPassword = $('#confirmPassword').val();
var activeTab;
function getactiveTab() {
activeTab = false
if($('#activeTab') != ' ') { activeTab = $('#activeTab').val(); }
return activeTab;
}

function flipMe(id, email, image, pageid){
var obj = "card"+id;
var side;
var m = document.getElementById(obj).children;
for (i=0; i<m.length; i++) {
if(m.item(i).title == 'card') side = 'front'; 
if(m.item(i).alt) image = m.item(i).alt;
}

if(side == 'front'){
backsidehtml = "<a href='index.php?page="+pageid+"&id="+id+"'>"+email+"</a>";
$("#"+obj).flip({
direction: 'lr',
color: '#aaa',
content: backsidehtml
});
}
else{
$("#"+obj).flip({
direction: 'lr',
color: '#aaa',
content: "<img src='scale.php?image="+image+"&y=120' border='0' title='card'>"
}); 	    
}  
}

$(document).ready(function(){
$("#yes").click(function () {
if(this.checked == true){
$("#starterkit .download").show("slow");
$("#starterkit .download-p").show("slow");
$("#starterkit h4 a").show("slow");
$("#starterkit-4c h4 a").show("slow");
}
else{
$("#starterkit .download").hide("slow");
$("#starterkit .download-p").hide("slow");
$("#starterkit h4 a").hide("slow");
$("#starterkit-4c h4 a").hide("slow");
}  
});
});

$(document).ready(function() {

$('#messages').animate({opacity:1.0}, 5000).fadeOut("slow");

// disble right click

$(document).bind("contextmenu",function(e){
  return false;
});


if($("#rData").val()) {
  $('.expTable').show();
}
else {
  $(".expTable").hide();
}

$(".expContent").hide();
//$(".edContent").hide();

$(".expAdd").click(function() {
  $(".expTable").show();
  $('.expAdd').hide();
});


if($("#hidpresent").val()) {
$("#sto").hide();
$("#adate").show();
$("#apresent").hide();
$("#txtpresent").show();
$("#txtpresent").val("present");
} else {
$("#txtpresent").hide();
$("#adate").hide();
}

$("#apresent").click(function() {
$("#sto").hide();
$("#txtpresent").show();
$("#txtpresent").val("present");
$("#adate").show();
$("#apresent").hide();
});

$("#adate").click(function() {
$("#sto").show();
$("#txtpresent").hide();
$("#txtpresent").val("");
$("#adate").hide();
$("#apresent").show();
});

var counter = 0;
$(".expHeader").click(function() {
  counter = counter+1;
  if(counter == 3) { counter = 1; }
  var eID = $(this).attr("id");
  if(counter == 1) { 
    $('#a_'+eID).fadeIn();
  }
  else { 
    $('#a_'+eID).fadeOut();
  }
});

$(".edHeader").click(function() {
  var edID = $(this).attr("id");
  $('#ed_'+edID).show();
});
 

  $('.name').each(function() {
      var fname = 'First Name';
      var lname = 'Last Name';
      
      $(this).focus(function() {
          if(this.value == fname || this.value == lname) {
              this.value = '';
          }
      });
   });
});

$(document).ready(function() {

});