
$(document).ready(function(){
	
	//Accordion							
	$("#accordion").accordion({ header: "h3", navigation: true, icons: false, autoHeight: false, event: "mousedown"});
	//$("#accordion").accordion({ header: "h3", navigation: true, icons: false, autoHeight: false, event: "mouseover"}); 
	$("#mNews").accordion({ header: "h3", navigation: true, icons: false, autoHeight: false, event: "mouseover"});
	$("#news").newsticker(6000);
	$("#mTestimonial").accordion({ header: "h3", navigation: true, icons: false, autoHeight: false, event: "mouseover"});
	$("#testimonial").newsticker(4000);
	$("button").button();

	$('.nojs').hide();			
	$('.dojs').show();			
	/*$.post('doset.php', { flag: "1"});*/
 
//	$('#btnOrder').easyTooltip({xOffset: "-50", yOffset: "80"});
	
	$('.r1').corner("10px");
	$('.r2').corner("20px");
	$('.rt').corner("top 20px");
	$('.rtr').corner("tr 20px");
	$('.rb').corner("bottom 10px");


	//Tabs									
		$('#tabs').tabs({
			selected: iTab, 
			fx: {opacity: 'toggle'} ,
			//cookie: { name: "producttab", expires: 7 },
			//spinner: 'Retrieving data...&#8230;', 
			ajaxOptions: {

				success: function(data, textStatus, XMLHttpRequest){
					$('.A').hide();	


					$("#tabs").undelegate(".Q", "click");
					$("#tabs").delegate(".Q", "click", function(){
						$('.A').slideUp();
						if ($(this).next().is(":visible")) {
							 $(this).next().slideUp("fast"); // slide it down
						}
						else {
							$(".A:visible").hide("fast");
							$(this).next().slideDown("fast"); // slide it down
						}
					});
										
				},
				
				cache: true,
				error: function(xhr, status, index, anchor) {
					$(anchor.hash).html('<div style="width:800px;">Ooops, we were unable to load the requested content. Please contact support if this problem continues.</div>');
				}
			}
		});				

	$('.dlgAccept').each(function() {
		var dialogOpts = { modal: true,	overlay: { background: "url(img/modal.png) repeat"}, buttons: {"Cancel": function() { $(this).dialog("close");}, "Accept": function() {$("#targetnojs").submit()}}, autoOpen: false, width:	450, title: $(this).attr('title') };
		var $dialog = $('<div></div>').load($(this).attr('href')).dialog(dialogOpts);

		$(this).click(function() {
			$dialog.dialog('open');

			return false;
		});
	});	


			
	//Colorbox
	$("a[rel='ssgroup']").colorbox();
	


});

	function showWait(val)
	{
		var oDiv = document.getElementById('mOverlay');
		oDiv.style.display='block';
		document.frmPaypal.submit(); 		
	}
