// style.js

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Copyright Veromar
																
   This script is not to be distributed and is not shareware.
                       														    
   If you have any questions about this script feel free to 	
   contact us via our website http://www.redcontour.com 		
   or email us on info@redcontour.com     						
														    	
   Last modified: 08/10/11
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/


/*~~~~~~~~~~~~~~~~~~~~~~~~~COMMON~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
// Input Text Field MaxLength + Count
function textCounter(field,cntfield,maxlimit) {
	if (field.value.length > maxlimit) // if too long...trim it!
		field.value = field.value.substring(0, maxlimit);
	// otherwise, update 'characters left' counter
	else
		cntfield.value = maxlimit - field.value.length;
}

/*~~~~~~~~~~~~~~~~~~~~~~~COMMON END~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

// Shop Popup
function popup(link,window_name,width,height)
{
	window.open(link,window_name,'width='+width+',height='+height+',scrollbars=1');
}

// ac_edit_profile - show hide delete button
function showMe (it, box) {
	var vis = (box.checked) ? "block" : "none";
	document.getElementById(it).style.display = vis;
}

// cp_members - Delete Member JavaScript //
function dm(user_id, username)
{
   if (confirm("Are you sure you want to delete: " + username + ""))
   {
      window.location.href = 'cp_members.php?dm=' + user_id;
   }
}

// cp_accom_reviews, cp_dest_reviews, cp_fd_reviews, cp_ttt_reviews & approve_review - Delete review (LINK) //
function drev(c_name, review_id, page_name)
{
	if (confirm("Are you sure you want to delete: " + c_name + ""))
	{
      window.location.href = page_name + '?drev=' + review_id;
	} else {
	   window.location.href = page_name;
	}
}


// Destinations - Show Countries JavaScript //
menu_status = new Array();

function showHide(theid){
    if (document.getElementById) {
    var switch_id = document.getElementById(theid);

        if(menu_status[theid] != 'show') {
           switch_id.className = 'show';
           menu_status[theid] = 'show';
        }else{
           switch_id.className = 'hide';
           menu_status[theid] = 'hide';
        }
    }
}

// Fancy box elements
$(document).ready(function() {
	/* This is basic - uses default settings */
	$("a#single_image").fancybox();
		
	/* This is will group elements (Galleries) & put the copy in the image frame*/
	$("a.grouped_elements").fancybox({
			'titlePosition'	: 'over'
	});
	
	/* Apply fancybox to multiple items */
	$("a.group").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false
	});
	
	/* Apply fancybox to preview review */
	$("#review_preview_load").fancybox({
		'padding'			: 0,
		'titlePosition'		: 'inside',
		'transitionIn'		: 'none',
		'transitionOut'		: 'none'
	});
	
	/* Apply #review_preview_load fancybox on page load */
	jQuery(document).ready(function() {
		$("#review_preview_load").trigger('click');
	});
	
	/* Apply fancybox to review register */
	$("#reg_preview_load").fancybox({
		'padding'			: 0,
		'titlePosition'		: 'inside',
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'showCloseButton'	: false
	});
	
	/* Apply fancybox to review login */
	$("#login_preview_load").fancybox({
		'padding'			: 0,
		'titlePosition'		: 'inside',
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'showCloseButton'	: false
	});
	
	/* Apply fancybox to contact us form*/
	$("#contact").fancybox({
		'padding'			: 0,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
	});
	
});






