$(document).ready(function () {
    $('.slideshow1').cycle({
        fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });
});
//tabali
$(document).ready(function () {
    //When page loads...
    $(".tab_content").hide(); //Hide all content
    $("ul.tabs li:first").addClass("active").show(); //Activate first tab
    $(".tab_content:first").show(); //Show first tab content
    //On Click Event
    $("ul.tabs li").click(function () {
        $("ul.tabs li").removeClass("active"); //Remove any "active" class
        $(this).addClass("active"); //Add "active" class to selected tab
        $(".tab_content").hide(); //Hide all tab content
        var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
        $(activeTab).fadeIn(); //Fade in the active ID content
        return false;
    });
});

       $('#sendEmail').submit(function(){
          $('#sendEmail input[type=text]').each(function(n,element){
            if ($(element).val()=='') {
              alert('Field '+element.id+' must have a value');
              return false;
            }
          });
          return true;
        });

 function CreditCartNumbercheck(evt) {
	var k;

    	document.all ? k = e.keyCode : k = e.which;
      alert(k);
       /*	if(k == 39 || k == 34){
    		return false;
    	}else{
    		return true;
    	} */
    	return ((k > 64 && k < 91) || (k > 96 && k < 123) || (k >= 48 && k < 57) || k == 8);
}

function only_numbers(evt) {
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        status = "This field accepts numbers only."
        return false
    }
    status = ""
    return true
}

    function no_simbols(e) {
	var k;

    	document.all ? k = e.keyCode : k = e.which;
      /* alert(k);
    	if(k == 39 || k == 34){
    		return false;
    	}else{
    		return true;
    	} */
    	return ((k > 64 && k < 91) || (k > 96 && k < 123) || (k >= 48 && k < 57) || k == 8);
    }

function goodbye1(thebusiness) {
    var confirmgoodbye = confirm("Are you sure you want to delete this ?")
    if (confirmgoodbye) {
        window.location = "http://www.selectflorists.com/user_manager_blog.php?action=delete&item_id=" + thebusiness;
    }
}

function popup(page) {
    OpenWin = this.open(page, "CtrlWindow", "toolbar=No,menubar=No,location=No,scrollbars=No,resizable=No,status=No,width=250,height=360,left=160,top=150");
}

function popup1(page) {
    OpenWin = this.open(page, "CtrlWindow", "toolbar=No,menubar=No,location=No,scrollbars=yes,resizable=No,status=No,width=420,height=360,left=160,top=150");
}

function images_view(page) {
    OpenWin = this.open(page, "CtrlWindow", "toolbar=No,directories=No, menubar=No,location=No,scrollbars=No,resizable=No,status=No,width=620,height=715,left=0,top=0");
}

function items_view(page) {
    OpenWin = this.open(page, "CtrlWindow", "toolbar=No,directories=No, menubar=No,location=No,scrollbars=No,resizable=No,status=No,width=620,height=400,left=0,top=0");
}

function items_datails(page) {
    OpenWin = this.open(page, "CtrlWindow", "toolbar=No,directories=No, menubar=No,location=No,scrollbars=No,resizable=No,status=No,width=620,height=400,left=0,top=0");
}

function zip_code(page) {
    OpenWin = this.open(page, "CtrlWindow", "toolbar=No,menubar=No,location=No,scrollbars=No,resizable=No,status=No,width=750,height=450,left=160,top=150");
}

function getTime() {
    var d = new Date();
    var c_hour = d.getHours();
    var c_min = d.getMinutes();
    var c_sec = d.getSeconds();

    var suffix = "AM";
    if (c_hour >= 12) {
        suffix = "PM";
        c_hour = c_hour - 12;
    }
    if (c_hour == 0) {
        c_hour = 12;
    }

    if (c_min < 10) c_min = "0" + c_min

    var t = c_hour + "_" + c_min + "_" + suffix;
    //alert(t);
    return t;
}



function SetDate(Day, Month, Year, fn) {

    document.getElementById(fn).value = Month + '/' + Day + '/' + Year;
}

function showHide(shID) {
    if (document.getElementById(shID)) {
        if (document.getElementById(shID + '-show').style.display != 'none') {
            document.getElementById(shID + '-show').style.display = 'none';
            document.getElementById(shID).style.display = 'block';
        }
        else {
            document.getElementById(shID + '-show').style.display = 'inline';
            document.getElementById(shID).style.display = 'none';
        }
    }
}

function windowOpener(windowHeight, windowWidth, windowName, windowUri) {
    var centerWidth = (window.screen.width - windowWidth) / 2;
    var centerHeight = (window.screen.height - windowHeight) / 2;

    newWindow = window.open(windowUri, windowName, 'resizable=0,width=' + windowWidth + ',height=' + windowHeight + ',left=' + centerWidth + ',top=' + centerHeight);

    newWindow.focus();
    return newWindow.name;
}
function windowOpener_sroll(windowHeight, windowWidth, windowName, windowUri) {
    var centerWidth = (window.screen.width - windowWidth) / 2;
    var centerHeight = (window.screen.height - windowHeight) / 2;

    newWindow = window.open(windowUri, windowName, 'resizable=0,scrollbars=yes,width=' + windowWidth + ',height=' + windowHeight + ',left=' + centerWidth + ',top=' + centerHeight);

    newWindow.focus();
    return newWindow.name;
}

function SetButtonStatus(sender, target)
                                       // , targett
{
    if (sender.value.length > 4 && sender.value.length <= 6) {

    //  document.getElementById(target).style.display = 'block';
    //  document.getElementById(targett).innerHTML = '&nbsp;';
   //    document.getElementById(target2).style.display = 'block';

document.getElementById(target).disabled = '';

   } else {
        document.getElementById(target).disabled = 'disabled';
    // document.getElementById(targett).innerHTML = "<font color='red' size='1'>Please enter valid and 5 numbers Zip Code</font>";
    // document.getElementById(target).style.display = 'none';
   }

   //  document.getElementById(target2).style.display = 'none';



}

