var upload1, upload2;
jQuery(function() {	
	if(jQuery("#content").hasClass('swfFlashMultiUpload')){
	upload2 = new SWFUpload({
		// Backend Settings
		upload_url: "upload.html",
		post_params: {"PHPSESSID": "SWFUpload"},

		// File Upload Settings
		file_size_limit : "3000",	// 200 kb
		file_types : "*.jpg;*.gif;*.png",
		file_types_description : "Image Files",
		file_upload_limit : "50",
		file_queue_limit : "50",

		// Event Handler Settings (all my handlers are in the Handler.js file)
		file_dialog_start_handler : fileDialogStart,
		file_queued_handler : fileQueued,
		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_start_handler : uploadStart,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete,

		// Button Settings
		button_image_url : "fileadmin/images/XPButtonUploadText_61x22.png",
		button_placeholder_id : "spanButtonPlaceholder2",
		button_width: 61,
		button_height: 22,
		
		// Flash Settings
		flash_url : "fileadmin/flash/swfupload.swf",

		swfupload_element_id : "flashUI2",		// Setting from graceful degradation plugin
		degraded_element_id : "degradedUI2",	// Setting from graceful degradation plugin

		custom_settings : {
			progressTarget : "fsUploadProgress2",
			submitButtonId : "submitBtn",
			cancelButtonId : "btnCancel2"
		},

		// Debug Settings
		debug: false

	});
	}

	// style switcher
	jQuery('#styleSwitcher a').click(function() {
		setActiveStyleSheet(this.getAttribute("rel"));
		jQuery('#styleSwitcher').find('a').removeClass('active');
		jQuery(this).addClass('active');
		jQuery.cookie('size',jQuery(this).attr('id'));
		return false;
	});
	jQuery('#'+jQuery.cookie('size')).click(); 

	if ((jQuery.browser.msie) && (jQuery.browser.version <= 7)) {
		//jQuery('div.body').not('.menu').pngFix( );
		jQuery('ul#menu li').hover(
			function(){ 
				jQuery(this).addClass('rollOver');
			},
			function(){ 
				jQuery(this).removeClass('rollOver');
		});		
	}
	
	jQuery('#fe-category').change(function(){
		if(jQuery(this).val()!=0){
			jQuery('#fe-new-category').hide();
		} else {
			jQuery('#fe-new-category').show();
		}
	});
	
	jQuery('p.csc-linkToTop a').click(function(){
		window.scrollTo(0,0);
		return false;
	});
	jQuery('a.ecard_link').click(function(){
		jQuery('div.ecard_form').show();
	});
	jQuery('#add-upload-file').click(function(){
		jQuery('#other-upload-file').append('<div class="other-file-row">'+jQuery('#upload-file').html()+'<a href="javascript:void(0)" onclick="jQuery(this).parent().remove();">Bild aus der Liste entfernen</a></div>');
	});
	jQuery('#submitBtn').formValidator({
				onSuccess	: function() {  },
				scope		: '#validateForm',
				errorDiv	: '#errorDiv1'
			});
	jQuery('#submitBtnNewsletter').formValidator({
				onSuccess	: function() {  },
				scope		: '#validateFormNewsletter',
				errorDiv	: '#errorDiv1'
			});
	jQuery('#submitBtnSMS').formValidator({
				onSuccess	: function() {  },
				scope		: '#validateFormSMS',
				errorDiv	: '#errorDiv1'
			});
	//jQuery('.date-pick').datePicker({startDate: (new Date()).asString()}).val(new Date().asString()).trigger('change');
	jQuery('.date-pick' ).datetimepicker({showOn: "both", buttonImage: "fileadmin/images/calendar.jpg", buttonImageOnly: true, dateFormat: 'dd/mm/yy'});

	jQuery('a[rel^="lightbox"]').lightBox();
});

