//
// error message 1.0
//
function confirmMsg(msg) {
	var con = confirm(msg);
	if (con) return true;
	else return false;
}
function confirmMsg(msg) {
	var con = confirm(msg);
	if (con) return true;
	else return false;
}
function showMsg (msg) {
  $(document).ready(function(){
    $('body').append('<div id="plOverlay"></div>');
    $('#plOverlay').css('opacity','0.4');
    resizeLayout();
    $('#plOverlay').fadeIn("slow");
    $('#plContent').html(msg);
    $('#plContainer').fadeIn(400);
    $('.plBtn').unbind();
    $('.plBtn').click(function(){
      closeLayout()
    });
    $('#plOverlay').click(function(){
      closeLayout()
    }); 
  });
}
function resizeLayout() {
  var pagewidth = $(document).width();
  var pageheight = $(document).height();
  $('#plOverlay').width(pagewidth);
  $('#plOverlay').height(pageheight);
}
function resizeMessage() {
  var comparedivWidth = $('#plContainer').width();
  var comparedivHeight = $('#plContainer').height();
  var copmtop = ($(window).height() / 2) - (comparedivHeight / 2);
  var copmleft = ($(window).width() / 2) - (comparedivWidth / 2);
  $('#plContainer').css('top',parseInt(copmtop));
  $('#plContainer').css('left',parseInt(copmleft));
}
function closeLayout() {
  $('#plContainer').fadeOut("slow");
  $('#plOverlay').fadeOut("slow", function() {
    $('#plOverlay').remove();
  });
}

//
// cross-slide 1.2
//
function formatText(index, panel) {
    return index + "";
}
$(function () {
    $('.cross-slide').crossSlide({
        easing: "easeInOutCirc",
        autoPlay: true,
        delay: 9000,
        startStopped: false,
        animationTime: 600,
        hashTags: true,
        buildNavigation: true,
        pauseOnHover: true,
     	startText: "Go",
        stopText: "Stop",
        navigationFormatter: formatText
    });
    $("#slide-jump").click(function(){
        $('.cross-slide').crossSlide(6);
    });
});
