    function redirect(url) {
		document.location.href = url;
	}

	function isset () {
		var objeler = arguments,
		uzunluk = objeler.length,
		no = 0,
		undef;
		if (uzunluk === 0) {
			// isset yok
			return false;
		}

		while (no !== uzunluk) {
			if (objeler[no] === undef || objeler[no] === null) {
				return false;
			}
			no++;
		}
		return true;
	}

    function write_review_parent_id (review_id) {
        jQuery('.li_comment_class').css({opacity:'0.1', filter:'alpha(opacity=10)'});
        jQuery('#li_comment_' + review_id).css({opacity:'1.0', filter:'alpha(opacity=100)'});

        var respond_temp_html = '<div id="review_form_content">' + jQuery('#review_form').html() + '</div>';
        jQuery('.comment-reply-link').css({'visibility':'hidden'});
        jQuery('#review_form').html('');
        jQuery('#li_comment_' + review_id).append(respond_temp_html);

        jQuery('.comment_form_errors_delete').html('').hide();
        jQuery('.comment_form_errors_input').css({"border":"2px solid #dcdcdc"});
        jQuery('#comment_form_general_message').html('&nbsp;').hide();

        jQuery('#comment_form_parent_id_input').val(review_id);
        jQuery('#clear_review_form_bar').attr('style', 'margin-top:300px;');
        jQuery('#respond').css({left:'0', position:'absolute', width:'590px', 'z-index':'2'});
        jQuery('#cancel-comment-reply-link').attr('onclick', 'return cancel_review_parent_id(\'' + review_id + '\');');
        jQuery('#cancel-comment-reply-link').show();
    }

    function cancel_review_parent_id (review_id) {
        jQuery('.li_comment_class').css({opacity:'1.0', filter:'alpha(opacity=100)'});

        var respond_temp_html = jQuery('#review_form_content').html();
        jQuery('.comment-reply-link').css({'visibility':'visible'});
        jQuery('#review_form_content').remove();
        jQuery('#review_form').html(respond_temp_html);

        jQuery('.comment_form_errors_delete').html('').hide();
        jQuery('.comment_form_errors_input').css({"border":"2px solid #dcdcdc"});
        jQuery('#comment_form_general_message').html('&nbsp;').hide();

        jQuery('#comment_form_parent_id_input').val('0');
        jQuery('#clear_review_form_bar').attr('style', 'margin:0;');
        jQuery('#respond').css({left:'0', position:'relative', width:'590px', 'z-index':'100'});
        jQuery('#cancel-comment-reply-link').removeAttr('onclick');
        jQuery('#cancel-comment-reply-link').hide();
    }

    function comment_form () {
        var author      = jQuery('#comment_form_author_input').val();
        var email       = jQuery('#comment_form_email_input').val();
        var url         = jQuery('#comment_form_url_input').val();
        var type        = jQuery('#comment_form_type_input').val();
        var type_id     = jQuery('#comment_form_type_id_input').val();
        var parent_id   = jQuery('#comment_form_parent_id_input').val();
        var message     = jQuery('#comment_form_message_input').val();
        var redirect	= jQuery('#comment_form_redirect_input').val();

        jQuery('#comment_form_loading').fadeIn('fast');
        jQuery('.comment_form_errors_delete').html('').hide();
        jQuery('.comment_form_errors_input').css({"border":"2px solid #dcdcdc"});
        jQuery('#comment_form_general_message').html('&nbsp;').hide();

        var comment_ajax = jQuery.ajax_post({
            url         : base_url + 'tr/yorum-ekle',
            type		: 'POST',
            data		: 'author=' + author + '&email=' + email + '&url=' + url + '&type=' + type + '&type_id=' + type_id + '&parent_id=' + parent_id + '&message=' + message,
            data_type	: 'json',
            result		: false,
            async		: false,
            send		: function() {},
            complete	: function() {},
            success		: function(data) {}
        });

        var error_count = 0;
        jQuery('#comment_form_loading').fadeOut('fast');

        if (comment_ajax.errors.field != '' && comment_ajax.errors.field != null) {
            var error_datas = comment_ajax.errors.field;
            jQuery.each(error_datas, function(e_key, e_value) {
                if(e_value != '') {
                    error_count += 1;
                    jQuery('#comment_form_' + e_key + '_error').html(' - ' + e_value).show();
                    jQuery('#comment_form_' + e_key + '_input').css({"border":"1px solid #FF8C8C"});
                }
            });
        }

        if (comment_ajax.errors.general != '' && comment_ajax.errors.general != null) {
            error_count += 1;
            jQuery('#comment_form_general_message').html(comment_ajax.errors.general).css({"color":"#FF8C8C"}).show();
        }

        if (comment_ajax.success != '' && error_count == 0) {
            jQuery('#comment_form_author_input, #comment_form_email_input, #comment_form_url_input, #comment_form_message_input').val('');
            jQuery('.comment_form_errors_delete').html('').hide();
            jQuery('#comment_form_general_message').html(comment_ajax.success).css({"color":"#3F9153"}).show();
            setTimeout("redirect('" + redirect + "');", 2000);
        }

        jQuery('#comment_form_author_input, #comment_form_email_input, #comment_form_url_input, #comment_form_message_input').focus(function(){
            jQuery(this).css({"border":"2px solid #dcdcdc"}).next('.require').text(' *');
        });
        return false;
    }

    function prettyphoto_open (image, title, description) {
        jQuery.prettyPhoto.open(image, title, description);
        jQuery.prettyPhoto.close();
    }

jQuery(document).ready(function($) {
	/* for top navigation */
	jQuery("#menu ul").css({display: "none"}); // Opera Fix

	jQuery(" #menu li").hover(function(){
		jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown(400);
	},function(){
		jQuery(this).find('ul:first').css({visibility: "hidden"});
	});

	/* initialize prettyphoto */
	jQuery("a[rel^='prettyPhoto']").prettyPhoto({
		theme: 'light_rounded'
	});

	/* Testimonial Cycle */
	jQuery('.cycle-testimonial').cycle({
		timeout: 5000,  // milliseconds between slide transitions (0 to disable auto advance)
		fx:      'scrollVert', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		pause:   0,	  // true to enable "pause on hover"
		prev:'.prev',  // selector for element to use as click trigger for previous slide
		next:'.next',  // selector for element to use as click trigger for previous slide
		cleartypeNoBg: true, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides)
		pauseOnPagerHover: 0 // true to pause when hovering over pager link
	});

	// jQuery('.toggle .toggle_content:first').show();
	jQuery(".toggle_title").toggle(
		function(){
			jQuery(this).addClass('toggle_active');
			jQuery(this).siblings('.toggle_content').slideDown("fast");
		},
		function(){
			jQuery(this).removeClass('toggle_active');
			jQuery(this).siblings('.toggle_content').slideUp("fast");
		}
	);

	jQuery(".tabs_container").each(function(){
		jQuery("ul.tabs",this).tabs("div.panes > div", {tabs:'li',effect: 'fade', fadeOutSpeed: -400});
	});
	jQuery(".mini_tabs_container").each(function(){
		jQuery("ul.mini_tabs",this).tabs("div.panes > div", {tabs:'li',effect: 'fade', fadeOutSpeed: -400});
	});
	jQuery.tools.tabs.addEffect("slide", function(i, done) {
		this.getPanes().slideUp();
		this.getPanes().eq(i).slideDown(function()  {
			done.call();
		});
	});

    jQuery('.vertical_slider').jCarouselLite({
        vertical: true,
        visible:  2,
        auto:     1500,
        speed:    3000
    });

	/* Initialize Equal Height*/
	jQuery("#content-col .equal").equalHeights();
	jQuery("#hosting-col .equal").equalHeights();
	jQuery("#footer-col .equal").equalHeights();
	jQuery("#boxcontact-col .equal").equalHeights();
	jQuery("#webhosting-col .equal").equalHeights();

	/* Initialize Corner Box */
	jQuery('.button, button, .box-grey, .bgwhite, .nav-testimonial, #nav-slide').corner("4px");

	/* Comment Form Processing */
    jQuery('#comment_form_author_input, #comment_form_email_input, #comment_form_url_input, #comment_form_message_input').focus(function(){
        jQuery(this).css({"border":"2px solid #dcdcdc"}).next('.require').text(' *');
    });
	/* Comment Form Processing */

	/* Contact Form Processing */
	jQuery('#contact_form_submit_button').click( function() {

		var name        = jQuery('#contact_form_name_input').val();
		var email       = jQuery('#contact_form_email_input').val();
        var subject     = jQuery('#contact_form_subject_input').val();
        var message     = jQuery('#contact_form_message_input').val();
		var department	= jQuery('#contact_form_department_input').val();
		var redirect	= jQuery('#contact_form_redirect_input').val();

		jQuery('#contact_form_loading').fadeIn('fast');
		jQuery('.contact_form_errors_delete').html('').hide();
		jQuery('.contact_form_errors_input').css({"border":"2px solid #dcdcdc"});
		jQuery('#contact_form_general_message').html('&nbsp;').hide();

		var login_ajax = jQuery.ajax_post({
			url		: site_url + 'contact_us/ajax_contact',
			type		: 'POST',
			data		: 'name=' + name + '&email=' + email + '&subject=' + subject + '&message=' + message + '&department=' + department,
			data_type	: 'json',
			result		: false,
			async		: false,
			send		: function() {},
			complete	: function() {},
			success		: function(data) {}
		});

		var error_count = 0;
		jQuery('#contact_form_loading').fadeOut('fast');

		if (login_ajax.errors.field != '' && login_ajax.errors.field != null) {
			var error_datas = login_ajax.errors.field;
			jQuery.each(error_datas, function(e_key, e_value) {
				if(e_value != '') {
					error_count += 1;
					jQuery('#contact_form_' + e_key + '_error').html(' - ' + e_value).show();
					jQuery('#contact_form_' + e_key + '_input').css({"border":"1px solid #FF8C8C"});
				}
			});
		}

		if (login_ajax.errors.general != '' && login_ajax.errors.general != null) {
			error_count += 1;
			jQuery('#contact_form_general_message').html(login_ajax.errors.general).css({"color":"#FF8C8C"}).show();
		}

		if (login_ajax.success != '' && error_count == 0) {
			jQuery('#contact_form_message_input, #contact_form_subject_input').val('');
			jQuery('.contact_form_errors_delete').html('').hide();
			jQuery('#contact_form_general_message').html(login_ajax.success).css({"color":"#3F9153"}).show();
			//setTimeout("redirect('" + redirect + "');", 2000);
		}
		return false;
	});

	jQuery('#contact_form_name_input, #contact_form_subject_input, #contact_form_message_input').focus(function(){
		jQuery(this).css({"border":"2px solid #dcdcdc"}).next('.require').text(' *');
	});
	/* Contact Form Processing */

	/* Login Form Processing */
	jQuery('#login-form').colorbox({scrolling:false, width:"465px", inline:true, href:"#footer_login_content"});
	jQuery('#footer_login_button').click( function() {

		var remember	= jQuery('#footer_login_remember_input').val();
		var username	= jQuery('#footer_login_username_input').val();
		var password	= jQuery('#footer_login_password_input').val();
		var redirect	= jQuery('#footer_login_redirect_input').val();

		jQuery('#footer_login_loading').fadeIn('fast');

		jQuery('.footer_login_errors_delete').html('').hide();
		jQuery('.footer_login_errors_input').css({"border":"2px solid #dcdcdc"});
		jQuery('#footer_login_general_message').html('&nbsp;').hide();

		var login_ajax = jQuery.ajax_post({
			url			: site_url + 'auth/ajax_login',
			type		: 'POST',
			data		: 'remember=' + remember + '&username=' + username + '&password=' + password,
			data_type	: 'json',
			result		: false,
			async		: false,
			send		: function() {},
			complete	: function() {},
			success		: function(data) {}
		});

		var error_count = 0;
		jQuery('#footer_login_loading').fadeOut('fast');

		if (login_ajax.errors.field != '' && login_ajax.errors.field != null) {
			var error_datas = login_ajax.errors.field;
			jQuery.each(error_datas, function(e_key, e_value) {
				if(e_value != '') {
					error_count += 1;
					jQuery('#footer_login_' + e_key + '_error').html(' - ' + e_value).show();
					jQuery('#footer_login_' + e_key + '_input').css({"border":"1px solid #FF8C8C"});
				}
			});
		}

		if (login_ajax.errors.general != '' && login_ajax.errors.general != null) {
			error_count += 1;
			jQuery('#footer_login_general_message').html(login_ajax.errors.general).css({"color":"#FF8C8C"}).show();
		}

		if (login_ajax.success != '' && error_count == 0) {
			jQuery('#footer_login_username_input, #footer_login_password_input').val('');
			jQuery('.footer_login_errors_delete').html('').hide();
			jQuery('#footer_login_general_message').html(login_ajax.success).css({"color":"#3F9153"}).show();
			setTimeout("redirect('" + redirect + "');", 2000);
		}

		jQuery('#login-form').colorbox.resize();
		return false;
	});

	jQuery('#footer_login_username_input, #footer_login_password_input').focus(function(){
		jQuery(this).css({"border":"2px solid #dcdcdc"}).next('.require').text(' *');
	});
	/* Login Form Processing */

	/* Sign Up Form Processing */
	jQuery('#signup-form').colorbox({scrolling:false, width:"465px", inline:true, href:"#footer_signup_content"});
	jQuery('#footer_signup_button').click( function() {

		var username	= jQuery('#footer_signup_username_input').val();
		var password	= jQuery('#footer_signup_password_input').val();
		var firstname	= jQuery('#footer_signup_firstname_input').val();
		var lastname	= jQuery('#footer_signup_lastname_input').val();
		var redirect	= jQuery('#footer_singup_redirect_input').val();
		var email		= jQuery('#footer_signup_email_input').val();

		jQuery('#footer_signup_loading').fadeIn('fast');

		jQuery('.footer_signup_errors_delete').html('').hide();
		jQuery('.footer_signup_errors_input').css({"border":"2px solid #dcdcdc"});
		jQuery('#footer_signup_general_message').html('&nbsp;').hide();

		var signup_ajax = jQuery.ajax_post({
			url			: site_url + 'auth/ajax_signup',
			type		: 'POST',
			data		: 'username=' + username + '&password=' + password + '&firstname=' + firstname + '&lastname=' + lastname + '&email=' + email,
			data_type	: 'json',
			result		: false,
			async		: false,
			send		: function() {},
			complete	: function() {},
			success		: function(data) {}
		});

		var error_count = 0;
		jQuery('#footer_signup_loading').fadeOut('fast');

		if (signup_ajax.errors.field != '' && signup_ajax.errors.field != null) {
			var error_datas = signup_ajax.errors.field;
			jQuery.each(error_datas, function(e_key, e_value) {
				if(e_value != '') {
					error_count += 1;
					jQuery('#footer_signup_' + e_key + '_error').html(' - ' + e_value).show();
					jQuery('#footer_signup_' + e_key + '_input').css({"border":"1px solid #FF8C8C"});
				}
			});
		}

		if (signup_ajax.errors.general != '' && signup_ajax.errors.general != null) {
			error_count += 1;
			jQuery('#footer_signup_general_message').html(signup_ajax.errors.general).css({"color":"#FF8C8C"}).show();
		}

		if (signup_ajax.success != '' && error_count == 0) {
			jQuery('#footer_signup_username_input, #footer_signup_password_input, #footer_signup_firstname_input, #footer_signup_lastname_input, #footer_signup_email_input').val('');
			jQuery('.footer_signup_errors_delete').html('').hide();
			jQuery('#footer_signup_general_message').html(signup_ajax.success).css({"color":"#3F9153"}).show();
			setTimeout("jQuery('#signup-form').colorbox.close();", 2000);
		}

		jQuery('#signup-form').colorbox.resize();
		return false;
	});

	jQuery('#footer_signup_username_input, #footer_signup_password_input, #footer_signup_firstname_input, #footer_signup_lastname_input, #footer_signup_email_input').focus(function(){
		jQuery(this).css({"border":"2px solid #dcdcdc"}).next('.require').text(' *');
	});
	/* Sign Up Form Processing *

	/* Sign Up Activate Form Processing */
	jQuery('#footer_signup_activate_button').click( function() {

		var username		= jQuery('#footer_signup_activate_username_input').val();
		var activation_key	= jQuery('#footer_signup_activate_activation_key_input').val();
		var redirect		= jQuery('#footer_signup_activate_redirect_input').val();

		jQuery('#footer_signup_activate_loading').fadeIn('fast');

		jQuery('.footer_signup_activate_errors_delete').html('').hide();
		jQuery('.footer_signup_activate_errors_input').css({"border":"2px solid #dcdcdc"});
		jQuery('#footer_signup_activate_general_message').html('&nbsp;').hide();

		var activate_ajax = jQuery.ajax_post({
			url			: site_url + 'auth/ajax_signup_activate',
			type		: 'POST',
			data		: 'username=' + username + '&activation_key=' + activation_key,
			data_type	: 'json',
			result		: false,
			async		: false,
			send		: function() {},
			complete	: function() {},
			success		: function(data) {}
		});

		var error_count = 0;
		jQuery('#footer_signup_activate_loading').fadeOut('fast');

		if (activate_ajax.errors.field != '' && activate_ajax.errors.field != null) {
			var error_datas = activate_ajax.errors.field;
			jQuery.each(error_datas, function(e_key, e_value) {
				if(e_value != '') {
					error_count += 1;
					jQuery('#footer_signup_activate_' + e_key + '_error').html(' - ' + e_value).show();
					jQuery('#footer_signup_activate_' + e_key + '_input').css({"border":"1px solid #FF8C8C"});
				}
			});
		}

		if (activate_ajax.errors.general != '' && activate_ajax.errors.general != null) {
			error_count += 1;
				jQuery('#footer_signup_activate_general_message').html(activate_ajax.errors.general).css({"color":"#FF8C8C"}).show();
		}

		if (activate_ajax.success != '' && error_count == 0) {
			jQuery('#footer_signup_activate_username_input, #footer_signup_activate_activation_key_input').val('');
			jQuery('.footer_signup_activate_errors_delete').html('').hide();
			jQuery('#footer_signup_activate_general_message').html(activate_ajax.success).css({"color":"#3F9153"}).show();
			setTimeout("redirect('" + redirect + "');", 2000);
		}

		jQuery.colorbox({scrolling:false, width:"465px", inline:true, href:"#footer_signup_activate_content"}).resize();
		return false;
	});

	jQuery('#footer_signup_activate_username_input, #footer_signup_activate_activation_key_input').focus(function(){
		jQuery(this).css({"border":"2px solid #dcdcdc"}).next('.require').text(' *');
	});
	/* Sign Up Activate Form Processing */

	/* Forgot Password Form Processing */
	jQuery('#footer_forgot_password_button').click( function() {

		var username		= jQuery('#footer_forgot_password_username_input').val();
		var redirect		= jQuery('#footer_forgot_password_redirect_input').val();

		jQuery('#footer_forgot_password_loading').fadeIn('fast');

		jQuery('.footer_forgot_password_errors_delete').html('').hide();
		jQuery('.footer_forgot_password_errors_input').css({"border":"2px solid #dcdcdc"});
		jQuery('#footer_forgot_password_general_message').html('&nbsp;').hide();

		var forgot_password_ajax = jQuery.ajax_post({
			url			: site_url + 'auth/ajax_forgot_password',
			type		: 'POST',
			data		: 'username=' + username,
			data_type	: 'json',
			result		: false,
			async		: false,
			send		: function() {},
			complete	: function() {},
			success		: function(data) {}
		});

		var error_count = 0;
		jQuery('#footer_forgot_password_loading').fadeOut('fast');

		if (forgot_password_ajax.errors.field != '' && forgot_password_ajax.errors.field != null) {
			var error_datas = forgot_password_ajax.errors.field;
			jQuery.each(error_datas, function(e_key, e_value) {
				if(e_value != '') {
					error_count += 1;
					jQuery('#footer_forgot_password_' + e_key + '_error').html(' - ' + e_value).show();
					jQuery('#footer_forgot_password_' + e_key + '_input').css({"border":"1px solid #FF8C8C"});
				}
			});
		}

		if (forgot_password_ajax.errors.general != '' && forgot_password_ajax.errors.general != null) {
			error_count += 1;
			jQuery('#footer_forgot_password_general_message').html(forgot_password_ajax.errors.general).css({"color":"#FF8C8C"}).show();
		}

		if (forgot_password_ajax.success != '' && error_count == 0) {
			jQuery('#footer_forgot_password_username_input').val('');
			jQuery('.footer_forgot_password_errors_delete').html('').hide();
			jQuery('#footer_forgot_password_general_message').html(forgot_password_ajax.success).css({"color":"#3F9153"}).show();
			setTimeout("redirect('" + redirect + "');", 2000);
		}

		jQuery.colorbox({scrolling:false, width:"465px", inline:true, href:"#footer_forgot_password_content"}).resize();
		return false;
	});

	jQuery('#footer_forgot_password_username_input').focus(function(){
		jQuery(this).css({"border":"2px solid #dcdcdc"}).next('.require').text(' *');
	});
	/* Forgot Password Form Processing */

	/* Reset Password Form Processing */
	jQuery('#footer_reset_password_button').click( function() {

		var username		= jQuery('#footer_reset_password_username_input').val();
		var activation_key	= jQuery('#footer_reset_password_activation_key_input').val();
		var redirect		= jQuery('#footer_reset_password_redirect_input').val();

		jQuery('#footer_reset_password_loading').fadeIn('fast');

		jQuery('.footer_reset_password_errors_delete').html('').hide();
		jQuery('.footer_reset_password_errors_input').css({"border":"2px solid #dcdcdc"});
		jQuery('#footer_reset_password_general_message').html('&nbsp;').hide();

		var reset_password_ajax = jQuery.ajax_post({
			url			: site_url + 'auth/ajax_reset_password',
			type		: 'POST',
			data		: 'username=' + username + '&activation_key=' + activation_key,
			data_type	: 'json',
			result		: false,
			async		: false,
			send		: function() {},
			complete	: function() {},
			success		: function(data) {}
		});

		var error_count = 0;
		jQuery('#footer_reset_password_loading').fadeOut('fast');

		if (reset_password_ajax.errors.field != '' && reset_password_ajax.errors.field != null) {
			var error_datas = reset_password_ajax.errors.field;
			jQuery.each(error_datas, function(e_key, e_value) {
				if(e_value != '') {
					error_count += 1;
					jQuery('#footer_reset_password_' + e_key + '_error').html(' - ' + e_value).show();
					jQuery('#footer_reset_password_' + e_key + '_input').css({"border":"1px solid #FF8C8C"});
				}
			});
		}

		if (reset_password_ajax.errors.general != '' && reset_password_ajax.errors.general != null) {
			error_count += 1;
				jQuery('#footer_reset_password_general_message').html(reset_password_ajax.errors.general).css({"color":"#FF8C8C"}).show();
		}

		if (reset_password_ajax.success != '' && error_count == 0) {
			jQuery('#footer_reset_password_username_input, #footer_reset_password_activation_key_input').val('');
			jQuery('.footer_reset_password_errors_delete').html('').hide();
			jQuery('#footer_reset_password_general_message').html(reset_password_ajax.success).css({"color":"#3F9153"}).show();
			setTimeout("redirect('" + redirect + "');", 2000);
		}

		jQuery.colorbox({scrolling:false, width:"465px", inline:true, href:"#footer_reset_password_content"}).resize();
		return false;
	});

	jQuery('#footer_reset_password_username_input, #footer_reset_password_activation_key_input').focus(function(){
		jQuery(this).css({"border":"2px solid #dcdcdc"}).next('.require').text(' *');
	});
	/* Reset Password Form Processing */
});
